BitMiracle.LibTiff.Classic.Tiff.ReadRGBAImage C# (CSharp) Method

ReadRGBAImage() public method

Reads the image and decodes it into RGBA format raster.

ReadRGBAImage reads a strip- or tile-based image into memory, storing the result in the user supplied RGBA raster. The raster is assumed to be an array of width times height 32-bit entries, where width must be less than or equal to the width of the image (height may be any non-zero size). If the raster dimensions are smaller than the image, the image data is cropped to the raster bounds. If the raster height is greater than that of the image, then the image data are placed in the lower part of the raster. Note that the raster is assumed to be organized such that the pixel at location (x, y) is raster[y * width + x]; with the raster origin in the lower-left hand corner. Please use O:BitMiracle.LibTiff.Classic.Tiff.ReadRGBAImageOriented if you want to specify another raster origin.

Raster pixels are 8-bit packed red, green, blue, alpha samples. The Tiff.GetR, Tiff.GetG, Tiff.GetB, and Tiff.GetA should be used to access individual samples. Images without Associated Alpha matting information have a constant Alpha of 1.0 (255).

ReadRGBAImage converts non-8-bit images by scaling sample values. Palette, grayscale, bilevel, CMYK, and YCbCr images are converted to RGB transparently. Raster pixels are returned uncorrected by any colorimetry information present in the directory.

Samples must be either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. SamplesPerPixel minus ExtraSamples).

Palette image colormaps that appear to be incorrectly written as 8-bit values are automatically scaled to 16-bits.

ReadRGBAImage is just a wrapper around the more general TiffRgbaImage facilities.

All error messages are directed to the current error handler.

public ReadRGBAImage ( int width, int height, int raster ) : bool
width int The raster width.
height int The raster height.
raster int The raster (the buffer to place decoded image data to).
return bool
        public bool ReadRGBAImage(int width, int height, int[] raster)
        {
            return ReadRGBAImage(width, height, raster, false);
        }

Same methods

Tiff::ReadRGBAImage ( int width, int height, int raster, bool stopOnError ) : bool
Tiff