Exemplo n.º 1
0
        public void XMirror(ARGBImage a)
        {
            ARGB32 *pOut = data;
            ARGB32 *pIn  = a.data;

            for (int yy = 0; yy < height; yy++)
            {
                pIn = a.Data(width - 1, yy);
                for (int xx = 0; xx < width; xx++)
                {
                    *pOut++ = *pIn--;
                }
            }
        }
Exemplo n.º 2
0
        public void DecimateAndReduce(ARGBImage a, int factor)
        {
            byte *output = data;

            for (int y = 0; y < height; y++)
            {
                ARGB32 *pa = a.Data(0, y * factor);
                for (int x = 0; x < width; x++)
                {
                    *output++ = (*pa).R;
                    pa += factor;
                }
            }
        }
Exemplo n.º 3
0
        public void YMirror(ARGBImage a)
        {
            ARGB32 *pOut = data;
            ARGB32 *pIn  = a.data;

            for (int yy = 0; yy < height; yy++)
            {
                pIn = a.Data(0, height - yy - 1);
                for (int xx = 0; xx < width; xx++)
                {
                    *pOut++ = *pIn++;
                }
            }
        }
Exemplo n.º 4
0
        public void CopyRectangle(ARGBImage argbImage, int startX, int startY, int w, int h)
        {
            ARGB32 *pOrig    = argbImage.Data(0, 0);
            ARGB32 *pOutOrig = data;
            ARGB32 *p;
            ARGB32 *pOut;

            for (int j = startY; j < h; j++)
            {
                for (int i = startX; i < w; i++)
                {
                    p    = pOrig + j * argbImage.Width + i;
                    pOut = pOutOrig + j * width + i;

                    *pOut = *p;
                }
            }
        }
Exemplo n.º 5
0
        public void CopyRectangle(ARGBImage argbImage, int startX, int startY, int w, int h)
        {
            ARGB32* pOrig = argbImage.Data(0, 0);
            ARGB32* pOutOrig = data;
            ARGB32* p;
            ARGB32* pOut;

            for (int j = startY; j < h; j++)
            {
                for (int i = startX; i < w; i++)
                {
                    p = pOrig + j * argbImage.Width + i;
                    pOut = pOutOrig + j * width + i;

                    *pOut = *p;
                }
            }
        }
Exemplo n.º 6
0
        public unsafe ARGBImage GenerateY(ARGBImage image, int i)
        {
            ARGB32* p = image.Data(0, 0);
            for (int y = 0; y < height; y++)
            {
                // Gray code changes only one bit from one column/row to the next column/row
                int grayCode = y ^ (y >> 1);
                // pick out the bit for this image
                int bit = (grayCode & (1 << i)) >> i;

                for (int x = 0; x < width; x++)
                {
                    p->R = (byte)(255 * bit);
                    p->G = (byte)(255 * bit);
                    p->B = (byte)(255 * bit);
                    p->A = (byte)(255);
                    p++;
                }
            }
            return image;
        }
Exemplo n.º 7
0
        public unsafe ARGBImage GenerateY(ARGBImage image, int i)
        {
            ARGB32 *p = image.Data(0, 0);

            for (int y = 0; y < height; y++)
            {
                // Gray code changes only one bit from one column/row to the next column/row
                int grayCode = y ^ (y >> 1);
                // pick out the bit for this image
                int bit = (grayCode & (1 << i)) >> i;

                for (int x = 0; x < width; x++)
                {
                    p->R = (byte)(255 * bit);
                    p->G = (byte)(255 * bit);
                    p->B = (byte)(255 * bit);
                    p->A = (byte)(255);
                    p++;
                }
            }
            return(image);
        }
Exemplo n.º 8
0
        public void DecimateAndReduce(ARGBImage a, int factor)
        {
            byte* output = data;

            for (int y = 0; y < height; y++)
            {
                ARGB32* pa = a.Data(0, y * factor);
                for (int x = 0; x < width; x++)
                {
                    *output++ = (*pa).R;
                    pa += factor;
                }
            }
        }