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

TIFFReadRGBAImage

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

TIFFReadRGBAImage, TIFFReadRGBAImageOriented − read

roentgen b75cab
and decode an image 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 TIFFReadRGBAImage(TIFF *tif,

roentgen b75cab
uint32 width, uint32 height,
roentgen b75cab
uint32 *raster, int
roentgen b75cab
stopOnError)
roentgen b75cab
int TIFFReadRGBAImageOriented(TIFF *tif,
roentgen b75cab
uint32 width, uint32 height,
roentgen b75cab
uint32 *raster, int orientation,
roentgen b75cab
int stopOnError)

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

TIFFReadRGBAImage reads a strip- or tile-based

roentgen b75cab
image into memory, storing the result in the user supplied
roentgen b75cab
raster. The raster is assumed to be an array of
roentgen b75cab
width times height 32-bit entries, where
roentgen b75cab
width must be less than or equal to the width of the
roentgen b75cab
image (height may be any non-zero size). If the
roentgen b75cab
raster dimensions are smaller than the image, the image data
roentgen b75cab
is cropped to the raster bounds. If the raster height is
roentgen b75cab
greater than that of the image, then the image data are
roentgen b75cab
placed in the lower part of the raster. (Note that the
roentgen b75cab
raster is assume to be organized such that the pixel at
roentgen b75cab
location (x,y) is
roentgen b75cab
raster[y*width+x]; with the
roentgen b75cab
raster origin in the lower-left hand corner.)

roentgen b75cab
roentgen b75cab

TIFFReadRGBAImageOriented works like

roentgen b75cab
TIFFReadRGBAImage with except of that user can
roentgen b75cab
specify the raster origin position with the
roentgen b75cab
orientation parameter. Four orientations
roentgen b75cab
supported:

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

ORIENTATION_TOPLEFT

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

origin in top-left corner,

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

ORIENTATION_TOPRIGHT

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

origin in top-right corner,

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

ORIENTATION_BOTLEFT

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

origin in bottom-left corner and

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

ORIENTATION_BOTRIGHT

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

origin in bottom-right corner.

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

If you choose ORIENTATION_BOTLEFT result will be

roentgen b75cab
the same as returned by the TIFFReadRGBAImage.

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

TIFFReadRGBAImage converts non-8-bit images by

roentgen b75cab
scaling sample values. Palette, grayscale, bilevel,
roentgen b75cab
<small>CMYK</small> , and YCbCr images are converted to
roentgen b75cab
<small>RGB</small> transparently. Raster pixels are returned
roentgen b75cab
uncorrected by any colorimetry information present in the
roentgen b75cab
directory.

roentgen b75cab
roentgen b75cab

The paramater stopOnError specifies how to act if

roentgen b75cab
an error is encountered while reading the image. If
roentgen b75cab
stopOnError is non-zero, then an error will terminate
roentgen b75cab
the operation; otherwise TIFFReadRGBAImage will
roentgen b75cab
continue processing data until all the possible data in the
roentgen b75cab
image have been requested.

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

In C++ the stopOnError parameter defaults to

roentgen b75cab
0.

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

Palettte 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

TIFFReadRGBAImage is just a wrapper around the

roentgen b75cab
more general TIFFRGBAImage(3TIFF) facilities.

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 and stopOnError is zero.

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
TIFFReadRGBAStrip(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