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>TIFFReadRGBAStrip</title>
roentgen b75cab
roentgen b75cab
roentgen b75cab
roentgen b75cab

TIFFReadRGBAStrip

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

TIFFReadRGBAStrip − read and decode an image strip

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

#define TIFFGetR(abgr) ((abgr) & 0xff)

roentgen b75cab
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
roentgen b75cab
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
roentgen b75cab
#define TIFFGetA(abgr) (((abgr) >> 24) &
roentgen b75cab
0xff)

roentgen b75cab
roentgen b75cab

int TIFFReadRGBAStrip(TIFF *tif,

roentgen b75cab
uint32 row, 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

TIFFReadRGBAStrip reads a single strip of a

roentgen b75cab
strip-based image into memory, storing the result in the
roentgen b75cab
user supplied RGBA raster. The raster is assumed to
roentgen b75cab
be an array of width times rowsperstrip 32-bit entries,
roentgen b75cab
where width is the width of the image (TIFFTAG_IMAGEWIDTH)
roentgen b75cab
and rowsperstrip is the maximum lines in a strip
roentgen b75cab
(TIFFTAG_ROWSPERSTRIP).

roentgen b75cab
roentgen b75cab

The row value should be the row of the first row

roentgen b75cab
in the strip (strip * rowsperstrip, zero based).

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
strip. That is bottom to top organization. When reading a
roentgen b75cab
partial last strip in the file the last line of the image
roentgen b75cab
will begin at the beginning of the buffer.

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

TIFFReadRGBAStrip is just a wrapper around the

roentgen b75cab
more general TIFFRGBAImage(3TIFF) facilities.
roentgen b75cab
It’s main advantage over the similar
roentgen b75cab
TIFFReadRGBAImage() function is that for large images
roentgen b75cab
a single buffer capable of holding the whole image
roentgen b75cab
doesn’t need to be allocated, only enough for one
roentgen b75cab
strip. The TIFFReadRGBATile() function does a similar
roentgen b75cab
operation for tiled 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
TIFFReadRGBATile(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