|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
<meta content="groff -Thtml, see www.gnu.org" name="generator">
|
|
kusano |
7d535a |
<meta content="text/css" name="Content-Style">
|
|
kusano |
7d535a |
<title>TIFFReadRGBATile</title>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFReadRGBATile
|
|
kusano |
7d535a |
NAME
|
|
kusano |
7d535a |
SYNOPSIS
|
|
kusano |
7d535a |
DESCRIPTION
|
|
kusano |
7d535a |
NOTES
|
|
kusano |
7d535a |
RETURN VALUES
|
|
kusano |
7d535a |
DIAGNOSTICS
|
|
kusano |
7d535a |
SEE ALSO
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
NAME
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFReadRGBATile − read and decode an image tile
|
|
kusano |
7d535a |
into a fixed-format raster
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
SYNOPSIS
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#include <tiffio.h>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="5" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#define TIFFGetR(abgr)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
((abgr) & 0xff)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#define TIFFGetG(abgr)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
(((abgr) >> 8) & 0xff)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#define TIFFGetB(abgr)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
(((abgr) >> 16) & 0xff)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#define TIFFGetA(abgr)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
(((abgr) >> 24) & 0xff)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
int TIFFReadRGBATile(TIFF *tif,
|
|
kusano |
7d535a |
uint32 x, uint32 y, uint32
|
|
kusano |
7d535a |
*raster)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
DESCRIPTION
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFReadRGBATile reads a single tile of a
|
|
kusano |
7d535a |
tile-based image into memory, storing the result in the user
|
|
kusano |
7d535a |
supplied RGBA raster. The raster is assumed to be an
|
|
kusano |
7d535a |
array of width times length 32-bit entries, where width is
|
|
kusano |
7d535a |
the width of a tile (TIFFTAG_TILEWIDTH) and length is the
|
|
kusano |
7d535a |
height of a tile (TIFFTAG_TILELENGTH).
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The x and y values are the offsets from the
|
|
kusano |
7d535a |
top left corner to the top left corner of the tile to be
|
|
kusano |
7d535a |
read. They must be an exact multiple of the tile width and
|
|
kusano |
7d535a |
length.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Note that the raster is assume to be organized such that
|
|
kusano |
7d535a |
the pixel at location (x,y) is
|
|
kusano |
7d535a |
raster[y*width+x]; with the
|
|
kusano |
7d535a |
raster origin in the lower-left hand corner of the
|
|
kusano |
7d535a |
tile. That is bottom to top organization. Edge tiles which
|
|
kusano |
7d535a |
partly fall off the image will be filled out with
|
|
kusano |
7d535a |
appropriate zeroed areas.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Raster pixels are 8-bit packed red, green, blue, alpha
|
|
kusano |
7d535a |
samples. The macros TIFFGetR, TIFFGetG,
|
|
kusano |
7d535a |
TIFFGetB, and TIFFGetA should be used to
|
|
kusano |
7d535a |
access individual samples. Images without Associated Alpha
|
|
kusano |
7d535a |
matting information have a constant Alpha of 1.0 (255).
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
See the TIFFRGBAImage(3TIFF) page for more details
|
|
kusano |
7d535a |
on how various image types are converted to RGBA values.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
NOTES
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Samples must be either 1, 2, 4, 8, or 16 bits.
|
|
kusano |
7d535a |
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
|
|
kusano |
7d535a |
SamplesPerPixel minus ExtraSamples).
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Palette image colormaps that appear to be incorrectly
|
|
kusano |
7d535a |
written as 8-bit values are automatically scaled to
|
|
kusano |
7d535a |
16-bits.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFReadRGBATile is just a wrapper around the more
|
|
kusano |
7d535a |
general TIFFRGBAImage(3TIFF) facilities. It’s
|
|
kusano |
7d535a |
main advantage over the similar TIFFReadRGBAImage()
|
|
kusano |
7d535a |
function is that for large images a single buffer capable of
|
|
kusano |
7d535a |
holding the whole image doesn’t need to be allocated,
|
|
kusano |
7d535a |
only enough for one tile. The TIFFReadRGBAStrip()
|
|
kusano |
7d535a |
function does a similar operation for stripped images.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
RETURN VALUES
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
1 is returned if the image was successfully read and
|
|
kusano |
7d535a |
converted. Otherwise, 0 is returned if an error was
|
|
kusano |
7d535a |
encountered.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
DIAGNOSTICS
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
All error messages are directed to the
|
|
kusano |
7d535a |
TIFFError(3TIFF) routine.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Sorry, can not handle %d-bit pictures. The image
|
|
kusano |
7d535a |
had BitsPerSample other than 1, 2, 4, 8, or 16.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Sorry, can not handle %d-channel images. The image
|
|
kusano |
7d535a |
had SamplesPerPixel other than 1, 3, or 4.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Missing needed "PhotometricInterpretation"
|
|
kusano |
7d535a |
tag. The image did not have a tag that describes how to
|
|
kusano |
7d535a |
display the data.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
No "PhotometricInterpretation" tag, assuming
|
|
kusano |
7d535a |
RGB. The image was missing a tag that describes how to
|
|
kusano |
7d535a |
display it, but because it has 3 or 4 samples/pixel, it is
|
|
kusano |
7d535a |
assumed to be <small>RGB.</small>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
No "PhotometricInterpretation" tag, assuming
|
|
kusano |
7d535a |
min-is-black. The image was missing a tag that describes
|
|
kusano |
7d535a |
how to display it, but because it has 1 sample/pixel, it is
|
|
kusano |
7d535a |
assumed to be a grayscale or bilevel image.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
No space for photometric conversion table. There
|
|
kusano |
7d535a |
was insufficient memory for a table used to convert image
|
|
kusano |
7d535a |
samples to 8-bit <small>RGB.</small>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Missing required "Colormap" tag. A
|
|
kusano |
7d535a |
Palette image did not have a required Colormap
|
|
kusano |
7d535a |
tag.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
No space for tile buffer. There was insufficient
|
|
kusano |
7d535a |
memory to allocate an i/o buffer.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
No space for strip buffer. There was insufficient
|
|
kusano |
7d535a |
memory to allocate an i/o buffer.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Can not handle format. The image has a format
|
|
kusano |
7d535a |
(combination of BitsPerSample,
|
|
kusano |
7d535a |
SamplesPerPixel, and
|
|
kusano |
7d535a |
PhotometricInterpretation) that
|
|
kusano |
7d535a |
TIFFReadRGBAImage can not handle.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
No space for B&W mapping table. There was
|
|
kusano |
7d535a |
insufficient memory to allocate a table used to map
|
|
kusano |
7d535a |
grayscale data to <small>RGB.</small>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
No space for Palette mapping table. There was
|
|
kusano |
7d535a |
insufficient memory to allocate a table used to map data to
|
|
kusano |
7d535a |
8-bit <small>RGB.</small>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
SEE ALSO
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
cols="2" cellspacing="0" cellpadding="0">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
TIFFOpen(3TIFF), TIFFRGBAImage(3TIFF),
|
|
kusano |
7d535a |
TIFFReadRGBAImage(3TIFF),
|
|
kusano |
7d535a |
TIFFReadRGBAStrip(3TIFF), libtiff(3TIFF)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Libtiff library home page:
|
|
kusano |
7d535a |
http://www.remotesensing.org/libtiff/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|