Blame html/man/TIFFReadRGBAImage.3tiff.html

Packit 994f1a
Packit 994f1a
Packit 994f1a
<html>
Packit 994f1a
<head>
Packit 994f1a
<meta name="generator" content="groff -Thtml, see www.gnu.org">
Packit 994f1a
<meta name="Content-Style" content="text/css">
Packit 994f1a
<title>TIFFReadRGBAImage</title>
Packit 994f1a
</head>
Packit 994f1a
<body>
Packit 994f1a
Packit 994f1a

TIFFReadRGBAImage

Packit 994f1a
NAME
Packit 994f1a
SYNOPSIS
Packit 994f1a
DESCRIPTION
Packit 994f1a
NOTES
Packit 994f1a
RETURN VALUES
Packit 994f1a
DIAGNOSTICS
Packit 994f1a
SEE ALSO
Packit 994f1a
Packit 994f1a

Packit 994f1a
Packit 994f1a

NAME

Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

TIFFReadRGBAImage, TIFFReadRGBAImageOriented − read

Packit 994f1a
and decode an image into a fixed-format raster

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

SYNOPSIS

Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

#include <tiffio.h>

Packit 994f1a
Packit 994f1a

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

Packit 994f1a
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
Packit 994f1a
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
Packit 994f1a
#define TIFFGetA(abgr) (((abgr) >> 24) &
Packit 994f1a
0xff)

Packit 994f1a
Packit 994f1a

int TIFFReadRGBAImage(TIFF *tif,

Packit 994f1a
uint32 width, uint32 height,
Packit 994f1a
uint32 *raster, int
Packit 994f1a
stopOnError)
Packit 994f1a
int TIFFReadRGBAImageOriented(TIFF *tif,
Packit 994f1a
uint32 width, uint32 height,
Packit 994f1a
uint32 *raster, int orientation,
Packit 994f1a
int stopOnError)

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

DESCRIPTION

Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

TIFFReadRGBAImage reads a strip- or tile-based

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

Packit 994f1a
Packit 994f1a

TIFFReadRGBAImageOriented works like

Packit 994f1a
TIFFReadRGBAImage with except of that user can
Packit 994f1a
specify the raster origin position with the
Packit 994f1a
orientation parameter. Four orientations
Packit 994f1a
supported:

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

ORIENTATION_TOPLEFT

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

origin in top-left corner,

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

ORIENTATION_TOPRIGHT

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

origin in top-right corner,

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

ORIENTATION_BOTLEFT

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

origin in bottom-left corner and

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

ORIENTATION_BOTRIGHT

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

origin in bottom-right corner.

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

If you choose ORIENTATION_BOTLEFT result will be

Packit 994f1a
the same as returned by the TIFFReadRGBAImage.

Packit 994f1a
Packit 994f1a

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

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

Packit 994f1a
Packit 994f1a

TIFFReadRGBAImage converts non-8-bit images by

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

Packit 994f1a
Packit 994f1a

The paramater stopOnError specifies how to act if

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

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

NOTES

Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

In C++ the stopOnError parameter defaults to

Packit 994f1a
0.

Packit 994f1a
Packit 994f1a

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

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

Packit 994f1a
Packit 994f1a

Palettte image colormaps that appear to be incorrectly

Packit 994f1a
written as 8-bit values are automatically scaled to
Packit 994f1a
16-bits.

Packit 994f1a
Packit 994f1a

TIFFReadRGBAImage is just a wrapper around the

Packit 994f1a
more general TIFFRGBAImage(3TIFF) facilities.

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

RETURN VALUES

Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

1 is returned if the image was successfully read and

Packit 994f1a
converted. Otherwise, 0 is returned if an error was
Packit 994f1a
encountered and stopOnError is zero.

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

DIAGNOSTICS

Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

All error messages are directed to the

Packit 994f1a
TIFFError(3TIFF) routine.

Packit 994f1a
Packit 994f1a

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

Packit 994f1a
had BitsPerSample other than 1, 2, 4, 8, or 16.

Packit 994f1a
Packit 994f1a

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

Packit 994f1a
had SamplesPerPixel other than 1, 3, or 4.

Packit 994f1a
Packit 994f1a

Missing needed "PhotometricInterpretation"

Packit 994f1a
tag. The image did not have a tag that describes how to
Packit 994f1a
display the data.

Packit 994f1a
Packit 994f1a

No "PhotometricInterpretation" tag, assuming

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

Packit 994f1a
Packit 994f1a

No "PhotometricInterpretation" tag, assuming

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

Packit 994f1a
Packit 994f1a

No space for photometric conversion table. There

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

Packit 994f1a
Packit 994f1a

Missing required "Colormap" tag. A

Packit 994f1a
Palette image did not have a required Colormap
Packit 994f1a
tag.

Packit 994f1a
Packit 994f1a

No space for tile buffer. There was insufficient

Packit 994f1a
memory to allocate an i/o buffer.

Packit 994f1a
Packit 994f1a

No space for strip buffer. There was insufficient

Packit 994f1a
memory to allocate an i/o buffer.

Packit 994f1a
Packit 994f1a

Can not handle format. The image has a format

Packit 994f1a
(combination of BitsPerSample,
Packit 994f1a
SamplesPerPixel, and
Packit 994f1a
PhotometricInterpretation) that
Packit 994f1a
TIFFReadRGBAImage can not handle.

Packit 994f1a
Packit 994f1a

No space for B&W mapping table. There was

Packit 994f1a
insufficient memory to allocate a table used to map
Packit 994f1a
grayscale data to <small>RGB.</small>

Packit 994f1a
Packit 994f1a

No space for Palette mapping table. There was

Packit 994f1a
insufficient memory to allocate a table used to map data to
Packit 994f1a
8-bit <small>RGB.</small>

Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

SEE ALSO

Packit 994f1a
Packit 994f1a
Packit 994f1a
       cols="2" cellspacing="0" cellpadding="0">
Packit 994f1a
Packit 994f1a
Packit 994f1a
Packit 994f1a

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

Packit 994f1a
TIFFReadRGBAStrip(3TIFF),
Packit 994f1a
TIFFReadRGBATile(3TIFF), libtiff(3TIFF)

Packit 994f1a
Packit 994f1a

Libtiff library home page:

Packit 994f1a
http://www.remotesensing.org/libtiff/

Packit 994f1a
Packit 994f1a
Packit 994f1a

Packit 994f1a
</body>
Packit 994f1a
</html>