Blame man/TIFFReadRGBAStrip.3tiff

Packit 994f1a
.\" $Id: TIFFReadRGBAStrip.3tiff,v 1.3 2005/11/02 11:07:18 dron Exp $
Packit 994f1a
.\"
Packit 994f1a
.\" Copyright (c) 1991-1997 Sam Leffler
Packit 994f1a
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
Packit 994f1a
.\"
Packit 994f1a
.\" Permission to use, copy, modify, distribute, and sell this software and 
Packit 994f1a
.\" its documentation for any purpose is hereby granted without fee, provided
Packit 994f1a
.\" that (i) the above copyright notices and this permission notice appear in
Packit 994f1a
.\" all copies of the software and related documentation, and (ii) the names of
Packit 994f1a
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit 994f1a
.\" publicity relating to the software without the specific, prior written
Packit 994f1a
.\" permission of Sam Leffler and Silicon Graphics.
Packit 994f1a
.\" 
Packit 994f1a
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
Packit 994f1a
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
Packit 994f1a
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
Packit 994f1a
.\" 
Packit 994f1a
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit 994f1a
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit 994f1a
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit 994f1a
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
Packit 994f1a
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
Packit 994f1a
.\" OF THIS SOFTWARE.
Packit 994f1a
.\"
Packit 994f1a
.if n .po 0
Packit 994f1a
.TH TIFFReadRGBAStrip 3TIFF "December 10, 1998" "libtiff"
Packit 994f1a
.SH NAME
Packit 994f1a
TIFFReadRGBAStrip \- read and decode an image strip into a fixed-format raster
Packit 994f1a
.SH SYNOPSIS
Packit 994f1a
.B "#include <tiffio.h>"
Packit 994f1a
.sp
Packit 994f1a
.B "#define TIFFGetR(abgr) ((abgr) & 0xff)"
Packit 994f1a
.br
Packit 994f1a
.B "#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)"
Packit 994f1a
.br
Packit 994f1a
.B "#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)"
Packit 994f1a
.br
Packit 994f1a
.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)"
Packit 994f1a
.sp
Packit 994f1a
.BI "int TIFFReadRGBAStrip(TIFF *" tif ", uint32 " row ", uint32 *" raster ")"
Packit 994f1a
.SH DESCRIPTION
Packit 994f1a
.IR TIFFReadRGBAStrip
Packit 994f1a
reads a single strip of a strip-based image into memory, storing the result in
Packit 994f1a
the user supplied RGBA
Packit 994f1a
.IR raster .
Packit 994f1a
The raster is assumed to be an array of width times rowsperstrip 32-bit
Packit 994f1a
entries, where width is the width of the image (TIFFTAG_IMAGEWIDTH) and
Packit 994f1a
rowsperstrip is the maximum lines in a strip (TIFFTAG_ROWSPERSTRIP). 
Packit 994f1a
Packit 994f1a
.PP
Packit 994f1a
The 
Packit 994f1a
.IR row
Packit 994f1a
value should be the row of the first row in the strip (strip * rowsperstrip,
Packit 994f1a
zero based).
Packit 994f1a
Packit 994f1a
.PP
Packit 994f1a
Note that the raster is assume to be organized such that the pixel at location
Packit 994f1a
(\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP]; with the
Packit 994f1a
raster origin in the 
Packit 994f1a
.I lower-left hand corner
Packit 994f1a
of the strip. That is bottom to top organization.  When reading a partial last
Packit 994f1a
strip in the file the last line of the image will begin at the beginning of
Packit 994f1a
the buffer.
Packit 994f1a
Packit 994f1a
.PP
Packit 994f1a
Raster pixels are 8-bit packed red, green, blue, alpha samples. The macros
Packit 994f1a
.IR TIFFGetR ,
Packit 994f1a
.IR TIFFGetG ,
Packit 994f1a
.IR TIFFGetB ,
Packit 994f1a
and
Packit 994f1a
.I TIFFGetA
Packit 994f1a
should be used to access individual samples. Images without Associated Alpha
Packit 994f1a
matting information have a constant Alpha of 1.0 (255).
Packit 994f1a
.PP
Packit 994f1a
See the 
Packit 994f1a
.IR TIFFRGBAImage (3TIFF) 
Packit 994f1a
page for more details on how various image types are converted to RGBA values.
Packit 994f1a
.SH NOTES
Packit 994f1a
Samples must be either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel must
Packit 994f1a
be either 1, 3, or 4 (i.e.
Packit 994f1a
.I SamplesPerPixel
Packit 994f1a
minus
Packit 994f1a
.IR ExtraSamples ).
Packit 994f1a
.PP
Packit 994f1a
Palette image colormaps that appear to be incorrectly written as 8-bit values
Packit 994f1a
are automatically scaled to 16-bits.
Packit 994f1a
.PP
Packit 994f1a
.I TIFFReadRGBAStrip
Packit 994f1a
is just a wrapper around the more general
Packit 994f1a
.IR TIFFRGBAImage (3TIFF)
Packit 994f1a
facilities.  It's main advantage over the similar 
Packit 994f1a
.IR TIFFReadRGBAImage() 
Packit 994f1a
function is that for large images a single buffer capable of holding the whole
Packit 994f1a
image doesn't need to be allocated, only enough for one strip.  The 
Packit 994f1a
.IR TIFFReadRGBATile() 
Packit 994f1a
function does a similar operation for tiled images.
Packit 994f1a
.SH "RETURN VALUES"
Packit 994f1a
1 is returned if the image was successfully read and converted.
Packit 994f1a
Otherwise, 0 is returned if an error was encountered.
Packit 994f1a
.SH DIAGNOSTICS
Packit 994f1a
All error messages are directed to the
Packit 994f1a
.IR TIFFError (3TIFF)
Packit 994f1a
routine.
Packit 994f1a
.PP
Packit 994f1a
.BR "Sorry, can not handle %d-bit pictures" .
Packit 994f1a
The image had
Packit 994f1a
.I BitsPerSample
Packit 994f1a
other than 1, 2, 4, 8, or 16.
Packit 994f1a
.PP
Packit 994f1a
.BR "Sorry, can not handle %d-channel images" .
Packit 994f1a
The image had
Packit 994f1a
.I SamplesPerPixel
Packit 994f1a
other than 1, 3, or 4.
Packit 994f1a
.PP
Packit 994f1a
\fBMissing needed "PhotometricInterpretation" tag\fP.
Packit 994f1a
The image did not have a tag that describes how to display the data.
Packit 994f1a
.PP
Packit 994f1a
\fBNo "PhotometricInterpretation" tag, assuming RGB\fP.
Packit 994f1a
The image was missing a tag that describes how to display it, but because it
Packit 994f1a
has 3 or 4 samples/pixel, it is assumed to be
Packit 994f1a
.SM RGB.
Packit 994f1a
.PP
Packit 994f1a
\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP. The image was
Packit 994f1a
missing a tag that describes how to display it, but because it has 1
Packit 994f1a
sample/pixel, it is assumed to be a grayscale or bilevel image.
Packit 994f1a
.PP
Packit 994f1a
.BR "No space for photometric conversion table" .
Packit 994f1a
There was insufficient memory for a table used to convert image samples to
Packit 994f1a
8-bit
Packit 994f1a
.SM RGB.
Packit 994f1a
.PP
Packit 994f1a
\fBMissing required "Colormap" tag\fP.
Packit 994f1a
A Palette image did not have a required
Packit 994f1a
.I Colormap
Packit 994f1a
tag.
Packit 994f1a
.PP
Packit 994f1a
.BR "No space for tile buffer" .
Packit 994f1a
There was insufficient memory to allocate an i/o buffer.
Packit 994f1a
.PP
Packit 994f1a
.BR "No space for strip buffer" .
Packit 994f1a
There was insufficient memory to allocate an i/o buffer.
Packit 994f1a
.PP
Packit 994f1a
.BR "Can not handle format" .
Packit 994f1a
The image has a format (combination of
Packit 994f1a
.IR BitsPerSample ,
Packit 994f1a
.IR SamplesPerPixel ,
Packit 994f1a
and
Packit 994f1a
.IR PhotometricInterpretation )
Packit 994f1a
that
Packit 994f1a
.I TIFFReadRGBAImage
Packit 994f1a
can not handle.
Packit 994f1a
.PP
Packit 994f1a
.BR "No space for B&W mapping table" .
Packit 994f1a
There was insufficient memory to allocate a table used to map grayscale data
Packit 994f1a
to
Packit 994f1a
.SM RGB.
Packit 994f1a
.PP
Packit 994f1a
.BR "No space for Palette mapping table" .
Packit 994f1a
There was insufficient memory to allocate a table used to map data to 8-bit
Packit 994f1a
.SM RGB.
Packit 994f1a
.SH "SEE ALSO"
Packit 994f1a
.BR TIFFOpen (3TIFF),
Packit 994f1a
.BR TIFFRGBAImage (3TIFF),
Packit 994f1a
.BR TIFFReadRGBAImage (3TIFF),
Packit 994f1a
.BR TIFFReadRGBATile (3TIFF),
Packit 994f1a
.BR libtiff (3TIFF)
Packit 994f1a
.PP
Packit 994f1a
Libtiff library home page:
Packit 994f1a
.BR http://www.remotesensing.org/libtiff/
Packit 994f1a