Current File : //usr/man/man3tiff/TIFFReadRGBAStrip.3tiff
'\" te
.TH TIFFReadRGBAStrip 3tiff "05 Apr 2004" "" ""
.SH "NAME"
TIFFReadRGBAStrip \- read and decode an image strip 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 TIFFReadRGBAStrip(TIFF* tif, tstrip_t strip, uint32 * raster )\fR
.fi
.sp
.SH ""
.PP
\fBTIFFReadRGBAStrip\fR reads a single strip of a strip-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 \fIrowsperstrip\fR 32-bit entries, where \fIwidth\fR
is the width of the image (\fBTIFFTAG_IMAGEWIDTH\fR), and \fIrowsperstrip\fR is the maximum number of lines in a strip (\fBTIFFTAG_ROWSPERSTRIP\fR)\&.
.PP
The \fIstrip\fR value should be the strip number
(the first strip is strip zero) as returned by the \fBTIFFComputeStrip\fR function, but always for sample 0\&.
.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 strip\&.
That is, bottom-to-top organization\&. When reading a partial last strip in
the file, the last line of the image begins at the beginning of the buffer\&.
.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), \fBTIFFReadRGBATile\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
\fBTIFFReadRGBAStrip\fR is just a wrapper around the more
general \fBTIFFRGBAImage(3tiff)\fR facilities\&. The main advantage
of \fBTIFFReadRGBAStrip\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 strip\&. The \fBTIFFReadRGBATile()\fR function
performs a similar operation for tiled 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