BitMiracle.LibTiff.Classic.TiffRgbaImage.putRGBAAcontig16bittile C# (CSharp) Method

putRGBAAcontig16bittile() private static method

16-bit packed samples => RGBA w/ associated alpha (known to have Map == null)
private static putRGBAAcontig16bittile ( TiffRgbaImage img, int raster, int rasterOffset, int rasterShift, int x, int y, int width, int height, byte buffer, int offset, int bufferShift ) : void
img TiffRgbaImage
raster int
rasterOffset int
rasterShift int
x int
y int
width int
height int
buffer byte
offset int
bufferShift int
return void
        private static void putRGBAAcontig16bittile(
            TiffRgbaImage img, int[] raster, int rasterOffset, int rasterShift,
            int x, int y, int width, int height, byte[] buffer, int offset, int bufferShift)
        {
            int samplesperpixel = img.samplesperpixel;

            short[] wp = Tiff.ByteArrayToShorts(buffer, offset, buffer.Length);
            int wpPos = 0;

            bufferShift *= samplesperpixel;
            while (height-- > 0)
            {
                for (x = width; x-- > 0; )
                {
                    raster[rasterOffset] = PACKW4(wp[wpPos], wp[wpPos + 1], wp[wpPos + 2], wp[wpPos + 3]);
                    rasterOffset++;
                    wpPos += samplesperpixel;
                }

                rasterOffset += rasterShift;
                wpPos += bufferShift;
            }
        }