Blame html/man/TIFFReadRGBAImage.3tiff.html

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

TIFFReadRGBAImage

Packit 7838c8
NAME
Packit 7838c8
SYNOPSIS
Packit 7838c8
DESCRIPTION
Packit 7838c8
NOTES
Packit 7838c8
RETURN VALUES
Packit 7838c8
DIAGNOSTICS
Packit 7838c8
SEE ALSO
Packit 7838c8
Packit 7838c8

Packit 7838c8
Packit 7838c8

NAME

Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

TIFFReadRGBAImage, TIFFReadRGBAImageOriented − read

Packit 7838c8
and decode an image into a fixed-format raster

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

SYNOPSIS

Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

#include <tiffio.h>

Packit 7838c8
Packit 7838c8

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

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

Packit 7838c8
Packit 7838c8

int TIFFReadRGBAImage(TIFF *tif,

Packit 7838c8
uint32 width, uint32 height,
Packit 7838c8
uint32 *raster, int
Packit 7838c8
stopOnError)
Packit 7838c8
int TIFFReadRGBAImageOriented(TIFF *tif,
Packit 7838c8
uint32 width, uint32 height,
Packit 7838c8
uint32 *raster, int orientation,
Packit 7838c8
int stopOnError)

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

DESCRIPTION

Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

TIFFReadRGBAImage reads a strip- or tile-based

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

Packit 7838c8
Packit 7838c8

TIFFReadRGBAImageOriented works like

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

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

ORIENTATION_TOPLEFT

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

origin in top-left corner,

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

ORIENTATION_TOPRIGHT

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

origin in top-right corner,

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

ORIENTATION_BOTLEFT

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

origin in bottom-left corner and

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

ORIENTATION_BOTRIGHT

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

origin in bottom-right corner.

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

If you choose ORIENTATION_BOTLEFT result will be

Packit 7838c8
the same as returned by the TIFFReadRGBAImage.

Packit 7838c8
Packit 7838c8

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

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

Packit 7838c8
Packit 7838c8

TIFFReadRGBAImage converts non-8-bit images by

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

Packit 7838c8
Packit 7838c8

The paramater stopOnError specifies how to act if

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

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

NOTES

Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

In C++ the stopOnError parameter defaults to

Packit 7838c8
0.

Packit 7838c8
Packit 7838c8

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

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

Packit 7838c8
Packit 7838c8

Palettte image colormaps that appear to be incorrectly

Packit 7838c8
written as 8-bit values are automatically scaled to
Packit 7838c8
16-bits.

Packit 7838c8
Packit 7838c8

TIFFReadRGBAImage is just a wrapper around the

Packit 7838c8
more general TIFFRGBAImage(3TIFF) facilities.

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

RETURN VALUES

Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

1 is returned if the image was successfully read and

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

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

DIAGNOSTICS

Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

All error messages are directed to the

Packit 7838c8
TIFFError(3TIFF) routine.

Packit 7838c8
Packit 7838c8

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

Packit 7838c8
had BitsPerSample other than 1, 2, 4, 8, or 16.

Packit 7838c8
Packit 7838c8

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

Packit 7838c8
had SamplesPerPixel other than 1, 3, or 4.

Packit 7838c8
Packit 7838c8

Missing needed "PhotometricInterpretation"

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

Packit 7838c8
Packit 7838c8

No "PhotometricInterpretation" tag, assuming

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

Packit 7838c8
Packit 7838c8

No "PhotometricInterpretation" tag, assuming

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

Packit 7838c8
Packit 7838c8

No space for photometric conversion table. There

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

Packit 7838c8
Packit 7838c8

Missing required "Colormap" tag. A

Packit 7838c8
Palette image did not have a required Colormap
Packit 7838c8
tag.

Packit 7838c8
Packit 7838c8

No space for tile buffer. There was insufficient

Packit 7838c8
memory to allocate an i/o buffer.

Packit 7838c8
Packit 7838c8

No space for strip buffer. There was insufficient

Packit 7838c8
memory to allocate an i/o buffer.

Packit 7838c8
Packit 7838c8

Can not handle format. The image has a format

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

Packit 7838c8
Packit 7838c8

No space for B&W mapping table. There was

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

Packit 7838c8
Packit 7838c8

No space for Palette mapping table. There was

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

Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

SEE ALSO

Packit 7838c8
Packit 7838c8
Packit 7838c8
       cols="2" cellspacing="0" cellpadding="0">
Packit 7838c8
Packit 7838c8
Packit 7838c8
Packit 7838c8

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

Packit 7838c8
TIFFReadRGBAStrip(3TIFF),
Packit 7838c8
TIFFReadRGBATile(3TIFF), libtiff(3TIFF)

Packit 7838c8
Packit 7838c8

Libtiff library home page:

Packit 7838c8
http://www.simplesystems.org/libtiff/

Packit 7838c8
Packit 7838c8
Packit 7838c8

Packit 7838c8
</body>
Packit 7838c8
</html>