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

252 lines
6.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML><HEAD><TITLE>Manpage of TIFFReadRGBATile</TITLE>
</HEAD><BODY BGCOLOR=WHITE><FONT FACE="helvetica, sans, arial">
<H1>TIFFReadRGBATile</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>
TIFFReadRGBATile - read and decode an image tile 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 TIFFReadRGBATile(TIFF* tif, uint32 x, uint32 y, uint32 * raster )</B>
</PRE><A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<I>TIFFReadRGBATile</I>
reads a single tile of a tile-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 length 32-bit entries, where width
is the width of a tile (TIFFTAG_TILEWIDTH) and
length is the height of a tile (TIFFTAG_TILELENGTH).
<P>
<P>
The
<I>x</I>
and
<I>y</I>
values are the offsets from the top left corner to the top left corner
of the tile to be read. They must be an exact multiple of the tile
width and length.
<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 tile. That is bottom to top organization. Edge tiles which
partly fall off the image will be filled out with appropriate zeroed
areas.
<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="http:/cgi-bin/man2html?TIFFRGBAImage+3t">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>TIFFReadRGBATile</I>
is just a wrapper around the more general
<I><A HREF="http:/cgi-bin/man2html?TIFFRGBAImage+3t">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 tile. The
<I>TIFFReadRGBAStrip()</I>
function does a similar operation for stripped 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="http:/cgi-bin/man2html?TIFFError+3t">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="http:/cgi-bin/man2html?libtiff+3t">libtiff</A></I>(3T),
<I><A HREF="http:/cgi-bin/man2html?TIFFOpen+3t">TIFFOpen</A></I>(3T),
<I><A HREF="http:/cgi-bin/man2html?TIFFRGBAImage+3t">TIFFRGBAImage</A></I>(3T),
<I><A HREF="http:/cgi-bin/man2html?TIFFReadRGBAImage+3t">TIFFReadRGBAImage</A></I>(3T),
<I><A HREF="http:/cgi-bin/man2html?TIFFReadRGBAStrip+3t">TIFFReadRGBAStrip</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>