Esempio n. 1
0
        public void Copy(FloatImage input)
        {
            float * pIn = input.Data(0, 0);
            ushort *p   = data;

            for (int i = 0; i < width * height; i++)
            {
                *p++ = (ushort)(*pIn++);
            }
        }
Esempio n. 2
0
        public void Copy(FloatImage x, FloatImage y)
        {
            Float2 *p = data;

            float *px = x.Data(0, 0);
            float *py = y.Data(0, 0);

            for (int i = 0; i < width * height; i++)
            {
                p->x = *px++;
                p->y = *py++;
                p++;
            }
        }
Esempio n. 3
0
        //Converts a float depth frame into a 32-bit frame
        public void CopyFloatImageForGrayscaleDisplay(FloatImage floatImage, float maxVal)
        {
            float * pIn        = floatImage.Data(0, 0);
            double  multiplier = 255.0 / maxVal;
            ARGB32 *pOut       = data;

            for (int i = 0; i < width * height; i++)
            {
                byte intensity = (byte)(multiplier * *pIn++);//(255 * *pIn++ / maxVal);
                pOut->A   = 255;
                pOut->R   = intensity;
                pOut->G   = intensity;
                pOut++->B = intensity;
            }
        }
Esempio n. 4
0
        public void Copy(FloatImage x, FloatImage y, FloatImage z)
        {
            Float3* p = data;

            float* px = x.Data(0, 0);
            float* py = y.Data(0, 0);
            float* pz = z.Data(0, 0);

            for (int i = 0; i < width * height; i++)
            {
                p->x = *px++;
                p->y = *py++;
                p->z = *pz++;
                p++;
            }
        }
Esempio n. 5
0
        public void Threshold(FloatImage a, float threshold)
        {
            float *pa = a.Data(0, 0);
            byte * p  = data;

            for (int i = 0; i < width * height; i++)
            {
                if (*pa++ > threshold)
                {
                    *p++ = 255;
                }
                else
                {
                    *p++ = 0;
                }
            }
        }
Esempio n. 6
0
        public void Copy(FloatImage a, float min, float max)
        {
            float *pa = a.Data(0, 0);
            byte * p  = data;
            float  s  = 255.0f / (max - min);

            for (int i = 0; i < width * height; i++)
            {
                int value = (int)(s * (*pa++ - min));

                if (value < 0)
                {
                    *p++ = 0;
                }
                else if (value > 255)
                {
                    *p++ = (byte)255;
                }
                else
                {
                    *p++ = (byte)value;
                }
            }
        }
Esempio n. 7
0
        public void Copy(FloatImage a, float min, float max)
        {
            float* pa = a.Data(0, 0);
            byte* p = data;
            float s = 255.0f / (max - min);

            for (int i = 0; i < width * height; i++)
            {
                int value = (int)(s * (*pa++ - min));

                if (value < 0)
                    *p++ = 0;
                else if (value > 255)
                    *p++ = (byte)255;
                else
                    *p++ = (byte)value;
            }
        }
Esempio n. 8
0
 public void Threshold(FloatImage a, float threshold)
 {
     float* pa = a.Data(0, 0);
     byte* p = data;
     for (int i = 0; i < width * height; i++)
     {
         if (*pa++ > threshold)
             *p++ = 255;
         else
             *p++ = 0;
     }
 }