Blame thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBAImage.3tiff.html

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
<meta content="groff -Thtml, see www.gnu.org" name="generator">
kusano 7d535a
<meta content="text/css" name="Content-Style">
kusano 7d535a
<title>TIFFReadRGBAImage</title>
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

TIFFReadRGBAImage

kusano 7d535a
NAME
kusano 7d535a
SYNOPSIS
kusano 7d535a
DESCRIPTION
kusano 7d535a
NOTES
kusano 7d535a
RETURN VALUES
kusano 7d535a
DIAGNOSTICS
kusano 7d535a
SEE ALSO
kusano 7d535a
kusano 7d535a

kusano 7d535a
kusano 7d535a

NAME

kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

TIFFReadRGBAImage, TIFFReadRGBAImageOriented − read

kusano 7d535a
and decode an image into a fixed-format raster

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

SYNOPSIS

kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

#include <tiffio.h>

kusano 7d535a
kusano 7d535a

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

kusano 7d535a
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
kusano 7d535a
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
kusano 7d535a
#define TIFFGetA(abgr) (((abgr) >> 24) &
kusano 7d535a
0xff)

kusano 7d535a
kusano 7d535a

int TIFFReadRGBAImage(TIFF *tif,

kusano 7d535a
uint32 width, uint32 height,
kusano 7d535a
uint32 *raster, int
kusano 7d535a
stopOnError)
kusano 7d535a
int TIFFReadRGBAImageOriented(TIFF *tif,
kusano 7d535a
uint32 width, uint32 height,
kusano 7d535a
uint32 *raster, int orientation,
kusano 7d535a
int stopOnError)

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

DESCRIPTION

kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

TIFFReadRGBAImage reads a strip- or tile-based

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

kusano 7d535a
kusano 7d535a

TIFFReadRGBAImageOriented works like

kusano 7d535a
TIFFReadRGBAImage with except of that user can
kusano 7d535a
specify the raster origin position with the
kusano 7d535a
orientation parameter. Four orientations
kusano 7d535a
supported:

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

ORIENTATION_TOPLEFT

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

origin in top-left corner,

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

ORIENTATION_TOPRIGHT

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

origin in top-right corner,

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

ORIENTATION_BOTLEFT

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

origin in bottom-left corner and

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

ORIENTATION_BOTRIGHT

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

origin in bottom-right corner.

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

If you choose ORIENTATION_BOTLEFT result will be

kusano 7d535a
the same as returned by the TIFFReadRGBAImage.

kusano 7d535a
kusano 7d535a

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

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

kusano 7d535a
kusano 7d535a

TIFFReadRGBAImage converts non-8-bit images by

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

kusano 7d535a
kusano 7d535a

The paramater stopOnError specifies how to act if

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

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

NOTES

kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

In C++ the stopOnError parameter defaults to

kusano 7d535a
0.

kusano 7d535a
kusano 7d535a

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

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

kusano 7d535a
kusano 7d535a

Palettte image colormaps that appear to be incorrectly

kusano 7d535a
written as 8-bit values are automatically scaled to
kusano 7d535a
16-bits.

kusano 7d535a
kusano 7d535a

TIFFReadRGBAImage is just a wrapper around the

kusano 7d535a
more general TIFFRGBAImage(3TIFF) facilities.

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

RETURN VALUES

kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

1 is returned if the image was successfully read and

kusano 7d535a
converted. Otherwise, 0 is returned if an error was
kusano 7d535a
encountered and stopOnError is zero.

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

DIAGNOSTICS

kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

All error messages are directed to the

kusano 7d535a
TIFFError(3TIFF) routine.

kusano 7d535a
kusano 7d535a

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

kusano 7d535a
had BitsPerSample other than 1, 2, 4, 8, or 16.

kusano 7d535a
kusano 7d535a

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

kusano 7d535a
had SamplesPerPixel other than 1, 3, or 4.

kusano 7d535a
kusano 7d535a

Missing needed "PhotometricInterpretation"

kusano 7d535a
tag. The image did not have a tag that describes how to
kusano 7d535a
display the data.

kusano 7d535a
kusano 7d535a

No "PhotometricInterpretation" tag, assuming

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

kusano 7d535a
kusano 7d535a

No "PhotometricInterpretation" tag, assuming

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

kusano 7d535a
kusano 7d535a

No space for photometric conversion table. There

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

kusano 7d535a
kusano 7d535a

Missing required "Colormap" tag. A

kusano 7d535a
Palette image did not have a required Colormap
kusano 7d535a
tag.

kusano 7d535a
kusano 7d535a

No space for tile buffer. There was insufficient

kusano 7d535a
memory to allocate an i/o buffer.

kusano 7d535a
kusano 7d535a

No space for strip buffer. There was insufficient

kusano 7d535a
memory to allocate an i/o buffer.

kusano 7d535a
kusano 7d535a

Can not handle format. The image has a format

kusano 7d535a
(combination of BitsPerSample,
kusano 7d535a
SamplesPerPixel, and
kusano 7d535a
PhotometricInterpretation) that
kusano 7d535a
TIFFReadRGBAImage can not handle.

kusano 7d535a
kusano 7d535a

No space for B&W mapping table. There was

kusano 7d535a
insufficient memory to allocate a table used to map
kusano 7d535a
grayscale data to <small>RGB.</small>

kusano 7d535a
kusano 7d535a

No space for Palette mapping table. There was

kusano 7d535a
insufficient memory to allocate a table used to map data to
kusano 7d535a
8-bit <small>RGB.</small>

kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

SEE ALSO

kusano 7d535a
kusano 7d535a
kusano 7d535a
       cols="2" cellspacing="0" cellpadding="0">
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a

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

kusano 7d535a
TIFFReadRGBAStrip(3TIFF),
kusano 7d535a
TIFFReadRGBATile(3TIFF), libtiff(3TIFF)

kusano 7d535a
kusano 7d535a

Libtiff library home page:

kusano 7d535a
http://www.remotesensing.org/libtiff/

kusano 7d535a
kusano 7d535a
kusano 7d535a

kusano 7d535a
kusano 7d535a