libtiff/html/man/TIFFReadRGBAStrip.3t.html
1999-11-23 04:29:23 +00:00

250 lines
6.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML><HEAD><TITLE>Manpage of TIFFReadRGBAStrip</TITLE>
</HEAD><BODY BGCOLOR=WHITE><FONT FACE="helvetica, sans, arial">
<H1>TIFFReadRGBAStrip</H1>
Section: Misc. Reference Manual Pages (3T)<BR>Updated: December 10, 1998<BR><A HREF="#index">Index</A>
<BR><A HREF="index.html">Return to Main Contents</A>
<HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
TIFFReadRGBAStrip - read and decode an image strip into a fixed-format raster
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:/usr/include/tiffio.h">tiffio.h</A>&gt;</B>
<B>#define TIFFGetR(abgr) ((abgr) &amp; 0xff)</B>
<B>#define TIFFGetG(abgr) (((abgr) &gt;&gt; 8) &amp; 0xff)</B>
<B>#define TIFFGetB(abgr) (((abgr) &gt;&gt; 16) &amp; 0xff)</B>
<B>#define TIFFGetA(abgr) (((abgr) &gt;&gt; 24) &amp; 0xff)</B>
<B>int TIFFReadRGBAStrip(TIFF* tif, tstrip_t strip, uint32 * raster )</B>
</PRE><A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<I>TIFFReadRGBAStrip</I>
reads a single strip of a strip-based image into memory, <BR>
storing the result in the user supplied RGBA
<I>raster</I>.
The raster is assumed to be an array of
width times rowsperstrip 32-bit entries, where width
is the width of the image (TIFFTAG_IMAGEWIDTH) and
rowsperstrip is the maximum lines in a strip (TIFFTAG_ROWSPERSTRIP).
<P>
<P>
The
<I>strip</I>
value should be the strip number (strip zero is the first) as returned by the
<I>TIFFComputeStrip</I>
function, but always for sample 0.
<P>
<P>
Note that the raster is assume to be organized such that the pixel
at location (<I>x</I>,<I>y</I>) is <I>raster</I>[<I>y</I>*<I>width</I>+<I>x</I>];
with the raster origin in the
<I>lower-left hand corner</I>
of the strip. That is bottom to top organization. When reading a partial
last strip in the file the last line of the image will begin at the
beginning of the buffer.
<P>
<P>
Raster pixels are 8-bit packed red, green, blue, alpha samples.
The macros
<I>TIFFGetR</I>,
<I>TIFFGetG</I>,
<I>TIFFGetB</I>,
and
<I>TIFFGetA</I>
should be used to access individual samples.
Images without Associated Alpha matting information have a constant
Alpha of 1.0 (255).
<P>
See the
<I><A HREF="TIFFRGBAImage.3t.html">TIFFRGBAImage</A></I>(3T)
page for more details on how various image types are converted to RGBA
values.
<A NAME="lbAE">&nbsp;</A>
<H2>NOTES</H2>
Samples must be either 1, 2, 4, 8, or 16 bits.
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
<I>SamplesPerPixel</I>
minus
<I>ExtraSamples</I>).
<P>
Palette image colormaps that appear to be incorrectly written
as 8-bit values are automatically scaled to 16-bits.
<P>
<I>TIFFReadRGBAStrip</I>
is just a wrapper around the more general
<I><A HREF="TIFFRGBAImage.3t.html">TIFFRGBAImage</A></I>(3T)
facilities. It's main advantage over the similar
<I>TIFFReadRGBAImage()</I>
function is that for large images a single
buffer capable of holding the whole image doesn't need to be allocated,
only enough for one strip. The
<I>TIFFReadRGBATile()</I>
function does a similar operation for tiled images.
<A NAME="lbAF">&nbsp;</A>
<H2>RETURN VALUES</H2>
1 is returned if the image was successfully read and converted.
Otherwise, 0 is returned if an error was encountered.
<A NAME="lbAG">&nbsp;</A>
<H2>DIAGNOSTICS</H2>
All error messages are directed to the
<I><A HREF="TIFFError.3t.html">TIFFError</A></I>(3T)
routine.
<P>
<B>Sorry, can not handle %d-bit pictures</B>.
The image had
<I>BitsPerSample</I>
other than 1, 2, 4, 8, or 16.
<P>
<B>Sorry, can not handle %d-channel images</B>.
The image had
<I>SamplesPerPixel</I>
other than 1, 3, or 4.
<P>
<B>Missing needed &quot;PhotometricInterpretation&quot; tag</B>.
The image did not have a tag that describes how to display
the data.
<P>
<B>No &quot;PhotometricInterpretation&quot; tag, assuming RGB</B>.
The image was missing a tag that describes how to display it,
but because it has 3 or 4 samples/pixel, it is assumed to be
<FONT SIZE="-1">RGB.</FONT>
<P>
<B>No &quot;PhotometricInterpretation&quot; tag, assuming min-is-black</B>.
The image was missing a tag that describes how to display it,
but because it has 1 sample/pixel, it is assumed to be a grayscale
or bilevel image.
<P>
<B>No space for photometric conversion table</B>.
There was insufficient memory for a table used to convert
image samples to 8-bit
<FONT SIZE="-1">RGB.</FONT>
<P>
<B>Missing required &quot;Colormap&quot; tag</B>.
A Palette image did not have a required
<I>Colormap</I>
tag.
<P>
<B>No space for tile buffer</B>.
There was insufficient memory to allocate an i/o buffer.
<P>
<B>No space for strip buffer</B>.
There was insufficient memory to allocate an i/o buffer.
<P>
<B>Can not handle format</B>.
The image has a format (combination of
<I>BitsPerSample</I>,
<I>SamplesPerPixel</I>,
and
<I>PhotometricInterpretation</I>)
that
<I>TIFFReadRGBAImage</I>
can not handle.
<P>
<B>No space for B&amp;W mapping table</B>.
There was insufficient memory to allocate a table used to map
grayscale data to
<FONT SIZE="-1">RGB.</FONT>
<P>
<B>No space for Palette mapping table</B>.
There was insufficient memory to allocate a table used to map
data to 8-bit
<FONT SIZE="-1">RGB.</FONT>
<A NAME="lbAH">&nbsp;</A>
<H2>BUGS</H2>
Orientations other than bottom-left, or top-left are
not handled correctly.
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
<I><A HREF="libtiff.3t.html">libtiff</A></I>(3T),
<I><A HREF="TIFFOpen.3t.html">TIFFOpen</A></I>(3T),
<I><A HREF="TIFFRGBAImage.3t.html">TIFFRGBAImage</A></I>(3T),
<I><A HREF="TIFFReadRGBAImage.3t.html">TIFFReadRGBAImage</A></I>(3T),
<I><A HREF="TIFFReadRGBATile.3t.html">TIFFReadRGBATile</A></I>(3T)
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">NOTES</A><DD>
<DT><A HREF="#lbAF">RETURN VALUES</A><DD>
<DT><A HREF="#lbAG">DIAGNOSTICS</A><DD>
<DT><A HREF="#lbAH">BUGS</A><DD>
<DT><A HREF="#lbAI">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="index.html">man2html</A>,
using the manual pages.<BR>
Time: 01:31:38 GMT, November 23, 1999
</BODY>
</HTML>