BitMiracle.LibTiff.Classic.TiffRgbaImage.GetRaster C# (CSharp) Метод

GetRaster() публичный Метод

Reads the underlaying TIFF image and decodes it into RGBA format raster.

GetRaster reads image into memory using current "get" (Get) method, storing the result in the user supplied RGBA raster using one of the "put" (PutContig or PutSeparate) methods. 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 placement depends on the value of ReqOrientation property. 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 specified by the value of ReqOrientation property.

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).

GetRaster 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.

All error messages are directed to the current error handler.

public GetRaster ( int raster, int offset, int width, int height ) : bool
raster int The raster (the buffer to place decoded image data to).
offset int The zero-based byte offset in at which /// to begin storing decoded bytes.
width int The raster width.
height int The raster height.
Результат bool
        public bool GetRaster(int[] raster, int offset, int width, int height)
        {
            if (get == null)
            {
                Tiff.ErrorExt(tif, tif.m_clientdata, tif.FileName(), "No \"get\" method setup");
                return false;
            }

            return get(this, raster, offset, width, height);
        }