public ReadRGBAStrip ( int row, int raster ) : bool | ||
row | int | The row. |
raster | int | The RGBA raster. |
return | bool |
ReadRGBAStrip reads a single strip of a strip-based image into memory, storing the result in the user supplied RGBA raster. If specified strip is the last strip, then it will only contain the portion of the strip that is actually within the image space. The raster is assumed to be an array of width times rowsperstrip 32-bit entries, where width is the width of the image (TiffTag.IMAGEWIDTH) and rowsperstrip is the maximum lines in a strip (TiffTag.ROWSPERSTRIP).
The row value should be the row of the first row in the strip (strip * rowsperstrip, zero based).
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 strip. That is bottom to top organization. When reading a partial last strip in the file the last line of the image will begin at the beginning of the buffer.
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.
ReadRGBAStrip'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 strip. The ReadRGBATile function does a similar operation for tiled images.
ReadRGBAStrip is just a wrapper around the more general TiffRgbaImage facilities.
All error messages are directed to the current error handler.
public ReadRGBAStrip ( int row, int raster ) : bool | ||
row | int | The row. |
raster | int | The RGBA raster. |
return | bool |