示例#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);
            }
        }
示例#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++;
            }
        }
示例#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;
                }
            }
        }