Esempio n. 1
0
        /// <summary>
        /// Copy from a Luminance image to the BGRb pixel buffer.
        /// </summary>
        /// <param name="dst">The destination of the copy.</param>
        /// <param name="src">The source of the copy.</param>
        unsafe public static GDIDIBSection Copy(GDIDIBSection dst, PixelArray<Lumb> src)
        {
            int imageSize = src.Width * src.Height;
            
            for (int y = 0; y < src.Height; y++)
                for (int x = 0; x < src.Width; x++)
                {
                    dst.SetColor(x, y, src.GetColor(x, y));
                }

            return dst;
        }
Esempio n. 2
0
        /// <summary>
        /// Copy from a Luminance image to the BGRb pixel buffer.
        /// </summary>
        /// <param name="dst">The destination of the copy.</param>
        /// <param name="src">The source of the copy.</param>
        public static GDIDIBSection Copy(GDIDIBSection dst, PixelArray<Lumb> src)
        {
            //Lumb* srcPointer = (Lumb*)src.Pixels.ToPointer();
            //BGRb* dstPointer = (BGRb*)dst.Pixels.ToPointer();
            
            for (int row = 0; row < src.Height; row++)
                for (int column = 0; column < src.Width; column++)
                {
                    dst.SetColor(column, row, src.GetColor(column, row));
                    //Lumb lumPixel = srcPointer[src.CalculateOffset(column, row)];
                    //byte lum = lumPixel.Lum;

                    //dstPointer[dst.Accessor.CalculateOffset(column, row)] = new BGRb(lum, lum, lum);
                }

            return dst;
        }