roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
<meta content="groff -Thtml, see www.gnu.org" name="generator">
roentgen b75cab
<meta content="text/css" name="Content-Style">
roentgen b75cab
<title>TIFFReadRGBATile</title>
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

TIFFReadRGBATile

roentgen b75cab
NAME
roentgen b75cab
SYNOPSIS
roentgen b75cab
DESCRIPTION
roentgen b75cab
NOTES
roentgen b75cab
RETURN VALUES
roentgen b75cab
DIAGNOSTICS
roentgen b75cab
SEE ALSO
roentgen b75cab
roentgen b75cab

roentgen b75cab
roentgen b75cab

NAME

roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

TIFFReadRGBATile − read and decode an image tile

roentgen b75cab
into a fixed-format raster

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

SYNOPSIS

roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

#include <tiffio.h>

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="5" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

#define TIFFGetR(abgr)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

((abgr) & 0xff)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

#define TIFFGetG(abgr)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

(((abgr) >> 8) & 0xff)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

#define TIFFGetB(abgr)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

(((abgr) >> 16) & 0xff)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

#define TIFFGetA(abgr)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

(((abgr) >> 24) & 0xff)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

int TIFFReadRGBATile(TIFF *tif,

roentgen b75cab
uint32 x, uint32 y, uint32
roentgen b75cab
*raster)

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

DESCRIPTION

roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

TIFFReadRGBATile reads a single tile of a

roentgen b75cab
tile-based image into memory, storing the result in the user
roentgen b75cab
supplied RGBA raster. The raster is assumed to be an
roentgen b75cab
array of width times length 32-bit entries, where width is
roentgen b75cab
the width of a tile (TIFFTAG_TILEWIDTH) and length is the
roentgen b75cab
height of a tile (TIFFTAG_TILELENGTH).

roentgen b75cab
roentgen b75cab

The x and y values are the offsets from the

roentgen b75cab
top left corner to the top left corner of the tile to be
roentgen b75cab
read. They must be an exact multiple of the tile width and
roentgen b75cab
length.

roentgen b75cab
roentgen b75cab

Note that the raster is assume to be organized such that

roentgen b75cab
the pixel at location (x,y) is
roentgen b75cab
raster[y*width+x]; with the
roentgen b75cab
raster origin in the lower-left hand corner of the
roentgen b75cab
tile. That is bottom to top organization. Edge tiles which
roentgen b75cab
partly fall off the image will be filled out with
roentgen b75cab
appropriate zeroed areas.

roentgen b75cab
roentgen b75cab

Raster pixels are 8-bit packed red, green, blue, alpha

roentgen b75cab
samples. The macros TIFFGetR, TIFFGetG,
roentgen b75cab
TIFFGetB, and TIFFGetA should be used to
roentgen b75cab
access individual samples. Images without Associated Alpha
roentgen b75cab
matting information have a constant Alpha of 1.0 (255).

roentgen b75cab
roentgen b75cab

See the TIFFRGBAImage(3TIFF) page for more details

roentgen b75cab
on how various image types are converted to RGBA values.

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

NOTES

roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

Samples must be either 1, 2, 4, 8, or 16 bits.

roentgen b75cab
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
roentgen b75cab
SamplesPerPixel minus ExtraSamples).

roentgen b75cab
roentgen b75cab

Palette image colormaps that appear to be incorrectly

roentgen b75cab
written as 8-bit values are automatically scaled to
roentgen b75cab
16-bits.

roentgen b75cab
roentgen b75cab

TIFFReadRGBATile is just a wrapper around the more

roentgen b75cab
general TIFFRGBAImage(3TIFF) facilities. It’s
roentgen b75cab
main advantage over the similar TIFFReadRGBAImage()
roentgen b75cab
function is that for large images a single buffer capable of
roentgen b75cab
holding the whole image doesn’t need to be allocated,
roentgen b75cab
only enough for one tile. The TIFFReadRGBAStrip()
roentgen b75cab
function does a similar operation for stripped images.

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

RETURN VALUES

roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

1 is returned if the image was successfully read and

roentgen b75cab
converted. Otherwise, 0 is returned if an error was
roentgen b75cab
encountered.

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

DIAGNOSTICS

roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

All error messages are directed to the

roentgen b75cab
TIFFError(3TIFF) routine.

roentgen b75cab
roentgen b75cab

Sorry, can not handle %d-bit pictures. The image

roentgen b75cab
had BitsPerSample other than 1, 2, 4, 8, or 16.

roentgen b75cab
roentgen b75cab

Sorry, can not handle %d-channel images. The image

roentgen b75cab
had SamplesPerPixel other than 1, 3, or 4.

roentgen b75cab
roentgen b75cab

Missing needed "PhotometricInterpretation"

roentgen b75cab
tag. The image did not have a tag that describes how to
roentgen b75cab
display the data.

roentgen b75cab
roentgen b75cab

No "PhotometricInterpretation" tag, assuming

roentgen b75cab
RGB. The image was missing a tag that describes how to
roentgen b75cab
display it, but because it has 3 or 4 samples/pixel, it is
roentgen b75cab
assumed to be <small>RGB.</small>

roentgen b75cab
roentgen b75cab

No "PhotometricInterpretation" tag, assuming

roentgen b75cab
min-is-black. The image was missing a tag that describes
roentgen b75cab
how to display it, but because it has 1 sample/pixel, it is
roentgen b75cab
assumed to be a grayscale or bilevel image.

roentgen b75cab
roentgen b75cab

No space for photometric conversion table. There

roentgen b75cab
was insufficient memory for a table used to convert image
roentgen b75cab
samples to 8-bit <small>RGB.</small>

roentgen b75cab
roentgen b75cab

Missing required "Colormap" tag. A

roentgen b75cab
Palette image did not have a required Colormap
roentgen b75cab
tag.

roentgen b75cab
roentgen b75cab

No space for tile buffer. There was insufficient

roentgen b75cab
memory to allocate an i/o buffer.

roentgen b75cab
roentgen b75cab

No space for strip buffer. There was insufficient

roentgen b75cab
memory to allocate an i/o buffer.

roentgen b75cab
roentgen b75cab

Can not handle format. The image has a format

roentgen b75cab
(combination of BitsPerSample,
roentgen b75cab
SamplesPerPixel, and
roentgen b75cab
PhotometricInterpretation) that
roentgen b75cab
TIFFReadRGBAImage can not handle.

roentgen b75cab
roentgen b75cab

No space for B&W mapping table. There was

roentgen b75cab
insufficient memory to allocate a table used to map
roentgen b75cab
grayscale data to <small>RGB.</small>

roentgen b75cab
roentgen b75cab

No space for Palette mapping table. There was

roentgen b75cab
insufficient memory to allocate a table used to map data to
roentgen b75cab
8-bit <small>RGB.</small>

roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

SEE ALSO

roentgen b75cab
roentgen b75cab
roentgen b75cab
       cols="2" cellspacing="0" cellpadding="0">
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

TIFFOpen(3TIFF), TIFFRGBAImage(3TIFF),

roentgen b75cab
TIFFReadRGBAImage(3TIFF),
roentgen b75cab
TIFFReadRGBAStrip(3TIFF), libtiff(3TIFF)

roentgen b75cab
roentgen b75cab

Libtiff library home page:

roentgen b75cab
http://www.remotesensing.org/libtiff/

roentgen b75cab
roentgen b75cab
roentgen b75cab

roentgen b75cab
roentgen b75cab