Beispiel #1
0
        public void Copy(ShortImage a, int shift)
        {
            ushort *pa = a.Data(0, 0);
            byte *  p  = data;

            for (int i = 0; i < width * height; i++)
            {
                *p++ = (byte)(*pa++ >> shift);
            }
        }
Beispiel #2
0
        public void Copy(ShortImage shortImage)
        {
            ushort *p    = shortImage.Data(0, 0);
            ARGB32 *pOut = data;

            for (int i = 0; i < width * height; i++)
            {
                pOut->A   = 255;
                pOut->R   = (byte)*p;
                pOut->G   = (byte)*p;
                pOut++->B = (byte)*p++;
            }
        }
Beispiel #3
0
        public void Threshold(ShortImage a, ushort threshold)
        {
            ushort *pa = a.Data(0, 0);
            byte *  p  = data;

            for (int i = 0; i < width * height; i++)
            {
                if (*pa++ > threshold)
                {
                    *p++ = 255;
                }
                else
                {
                    *p++ = 0;
                }
            }
        }