Engines/FlatRedBallXNA/FlatRedBall/IO/PngLoader.cs
/// <summary>
/// Reverses the filtering done on a scanline of pixels that have been filtered using Method 0 (Subtract)
/// </summary>
/// <param name="image">A reference to the byte[] containing the image(decompressed)</param>
/// <param name="pointer">The index of the byte where this scanline begins(after the filter byte)</param>
/// <param name="bps">The number of bits per scanline.</param>
/// <param name="bpp">The number of bytes per pixel</param>
/// <param name="bitDepth">The number of bits per sample</param>
Reverses the filtering done on a scanline of pixels that have been filtered using Method 0 (Subtract)
Reverses the filtering done on a scanline of pixels that have been filtered using Method 0 ( Subtract )
private static void ReverseFilterSub(ref byte[] image, uint pointer, uint bps, float bpp, byte bitDepth)
        {
            if (bitDepth >= 8)
            {
                for (uint i = (uint)(pointer + bpp); i < pointer + bps; ++i)
                {
                    image[i] += image[(int)(i - bpp)];
                }
            }
        }
private static void ReverseFilterSub ( ref byte [ ] image , uint pointer , uint bps , float bpp , byte bitDepth ) { if ( bitDepth >= 8 ) { for ( uint i = ( uint ) ( pointer + bpp ) ; i < pointer + bps ; ++ i ) { image [ i ] += image [ ( int ) ( i - bpp ) ] ; } } }
Reverses the filtering done on a scanline of pixels that have been filtered using Method 0 (Subtract)
Reverses the filtering done on a scanline of pixels that have been filtered using Method 0 ( Subtract )
//Add the byte to the corresponding byte in the previous pixel
byte[]
ref
pointer
uint
The index of the byte where this scanline begins(after the filter byte)
The index of the byte where this scanline begins ( after the filter byte )
bps
uint
The number of bits per scanline.
The number of bits per scanline .
bpp
float
The number of bytes per pixel
The number of bytes per pixel
bitDepth
byte
The number of bits per sample
The number of bits per sample
image
A reference to the byte[] containing the image(decompressed)
A reference to the byte [] containing the image ( decompressed )