public ReadRGBATile ( int col, int row, int raster ) : bool | ||
col | int | The column. |
row | int | The row. |
raster | int | The RGBA raster. |
return | bool |
ReadRGBATile reads a single tile of a 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 length 32-bit entries, where width is the width of the tile (TiffTag.TILEWIDTH) and length is the height of a tile (TiffTag.TILELENGTH).
The col and row values are the offsets from the top left corner of the image to the top left corner of the tile to be read. They must be an exact multiple of the tile width and length.
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 of the tile. That is bottom to top organization. Edge tiles which partly fall off the image will be filled out with appropriate zeroed areas.
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).
See TiffRgbaImage for more details on how various image types are converted to RGBA values.
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.
ReadRGBATile's main advantage over the similar O:BitMiracle.LibTiff.Classic.Tiff.ReadRGBAImage function is that for large images a single buffer capable of holding the whole image doesn't need to be allocated, only enough for one tile. The ReadRGBAStrip function does a similar operation for stripped images.
ReadRGBATile is just a wrapper around the more general TiffRgbaImage facilities.
All error messages are directed to the current error handler.
public ReadRGBATile ( int col, int row, int raster ) : bool | ||
col | int | The column. |
row | int | The row. |
raster | int | The RGBA raster. |
return | bool |