Current File : //usr/man/man3tiff/TIFFReadRGBATile.3tiff
'\" te
.TH TIFFReadRGBATile 3tiff "05 Apr 2004" "" ""
.SH "NAME"
TIFFReadRGBATile \- read and decode an image tile into a fixed-format raster
.SH "SYNOPSIS"
.sp
.nf
\f(CW#include <tiffio\&.h>
#define TIFFGetR(abgr) ((abgr) & 0xff)
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
int TIFFReadRGBATile(TIFF* tif, uint32 x, uint32 y, uint32 * raster )\fR
.fi
.sp
.SH ""
.PP
\fBTIFFReadRGBATile\fR reads a single tile of a tile-based
image into memory, storing the result in the user-supplied RGBA raster\&. The
raster is assumed to be an array of \fIwidth\fR times \fIlength\fR 32-bit entries, where \fIwidth\fR
is the width of a tile (\fBTIFFTAG_TILEWIDTH\fR), and \fIheight\fR is the height of a tile (\fBTIFFTAG_TILELENGTH\fR)\&.
.PP
The \fIx\fR and \fIy\fR values
are the offsets from the top-left corner to the top-left corner of the
tile to be read\&. These values must be an exact multiple of the tile width
and length\&.
.PP
Note that the raster is assumed to be organized such that the pixel
at location (\fIx,y\fR) is \fIraster[y*width+x]\fR, with the raster origin in the bottom-left corner of the tile\&.
That is, bottom-to-top organization\&. Edge tiles that partly fall off the image
are filled out with appropriate zeroed areas\&.
.SH "EXTENDED DESCRIPTION"
.PP
Raster pixels are 8-bit packed red, green, blue, alpha samples\&. The
macros \fBTIFFGetR\fR, \fBTIFFGetG\fR, \fBTIFFGetB\fR, and \fBTIFFGetA\fR should be used to access
individual samples\&. Images without Associated Alpha matting information have
a constant Alpha of 1\&.0 (255)\&.
.PP
See \fBTIFFRGBAImage(3tiff)\fR for more information about how
various image types are converted to RGBA values\&.
.SS "Diagnostics"
.PP
All error messages are directed to the \fBTIFFError(3tiff)\fR
routine\&.
.sp
.ne 2
.mk
\fBSorry, can not handle %d-bit pictures\&.\fR
.sp .6
.in +4
The image has a \fBBitsPerSample\fR value other than 1,
2, 4, 8, or 16\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBSorry, can not handle %d-channel images\&.\fR
.sp .6
.in +4
The image has a \fBSamplesPerPixel\fR value other than
1, 3, or 4\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBMissing needed "PhotometricInterpretation" tag\&.\fR
.sp .6
.in +4
The image does not have a tag that describes how to display
the data\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBNo "PhotometricInterpretation" tag, assuming RGB\&.\fR
.sp .6
.in +4
The image does not have a tag that describes how to display
the data, but is assumed to be RGB because the image has 3 or 4 samples/pixel\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBNo "PhotometricInterpretation" tag, assuming min-is-black\&.\fR
.sp .6
.in +4
The image does not have a tag that describes how to
display the data, but is assumed to be a grayscale or bilevel image because
the image has 1 sample/pixel\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBNo space for photometric conversion table\&.\fR
.sp .6
.in +4
There is insufficient memory for a table needed to convert image samples
to 8-bit RGB\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBMissing required "Colormap" tag\&.\fR
.sp .6
.in +4
A Palette image does not have a required \fBColormap\fR tag\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBNo space for tile buffer\&.\fR
.sp .6
.in +4
There
is insufficient memory to allocate an i/o buffer\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBNo space for strip buffer\&.\fR
.sp .6
.in +4
There
is insufficient memory to allocate an i/o buffer\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBCan not handle format\&.\fR
.sp .6
.in +4
The image
has a format (combination of \fBBitsPerSample\fR, \fBSamplesPerPixel\fR, and \fBPhotometricInterpretation\fR) that \fBTIFFReadRGBAStrip\fR cannot process\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBNo space for B&W mapping table\&.\fR
.sp .6
.in +4
There is insufficient memory to allocate a table needed to map grayscale data
to RGB\&.
.sp
.sp 1
.in -4
.sp
.ne 2
.mk
\fBNo space for Palette mapping table\&.\fR
.sp .6
.in +4
There is insufficient memory to allocate a table needed to map data to 8-bit
RGB\&.
.sp
.sp 1
.in -4
.SH ""
.PP
1 is returned if the image was successfully read and converted\&. Otherwise,
0 is returned if an error was encountered\&.
.SH ""
.PP
See \fBattributes\fR(5)
for descriptions of the following attributes:
.sp
.TS
tab() allbox;
cw(2.750000i)| cw(2.750000i)
lw(2.750000i)| lw(2.750000i).
ATTRIBUTE TYPEATTRIBUTE VALUE
Availabilityimage/library/libtiff
Interface stabilityUncommitted
.TE
.sp
.SH ""
.PP
\fBlibtiff\fR(3), \fBTIFFOpen\fR(3tiff), \fBTIFFRGBAImage\fR(3tiff), \fBTIFFReadRGBAImage\fR(3tiff), \fBTIFFReadRGBAStrip\fR(3tiff)
.SH ""
.PP
Orientations other than bottom-left or top-left are not processed correctly\&.
.PP
Samples must be either 1, 2, 4, 8, or 16 bits\&. Colorimetric samples/pixel
must be either 1, 3, or 4 (that is, \fBSamplesPerPixel\fR minus \fBExtraSamples\fR)\&.
.PP
Palette image colormaps that appear to be incorrectly written as 8-bit
values are automatically scaled to 16-bits\&.
.PP
\fBTIFFReadRGBATile\fR is just a wrapper around the more
general \fBTIFFRGBAImage(3tiff)\fR facilities\&. The main advantage
of \fBTIFFReadRGBATile\fR over the similar \fBTIFFReadRGBAImage()\fR function is that for large images, it is not necessary to allocate
a single buffer capable of holding the whole image\&. The buffer only needs
to hold one tile\&. The \fBTIFFReadRGBAStrip()\fR function performs
a similar operation for stripped images\&.
.PP
This man page was originally written by Sam Leffler\&. Updated by Breda McColgan, Sun Microsystems Inc\&., 2004\&.
...\" created by instant / solbook-to-man, Thu 20 Mar 2014, 02:30
...\" LSARC 2003/085 libtiff, libjpeg, and libpng