263 lines
6.2 KiB
HTML
263 lines
6.2 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||
|
<HTML><HEAD><TITLE>Manpage of TIFFReadRGBAImage</TITLE>
|
||
|
</HEAD><BODY BGCOLOR=WHITE><FONT FACE="helvetica, sans, arial">
|
||
|
<H1>TIFFReadRGBAImage</H1>
|
||
|
Section: Misc. Reference Manual Pages (3T)<BR>Updated: February 14, 1992<BR><A HREF="#index">Index</A>
|
||
|
<BR><A HREF="index.html">Return to Main Contents</A>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="lbAB"> </A>
|
||
|
<H2>NAME</H2>
|
||
|
|
||
|
TIFFReadRGBAImage - read and decode an image into a fixed-format raster
|
||
|
<A NAME="lbAC"> </A>
|
||
|
<H2>SYNOPSIS</H2>
|
||
|
|
||
|
<PRE>
|
||
|
<B>#include <<A HREF="file:/usr/include/tiffio.h">tiffio.h</A>></B>
|
||
|
|
||
|
<B>#define TIFFGetR(abgr) ((abgr) & 0xff)</B>
|
||
|
<B>#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)</B>
|
||
|
<B>#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)</B>
|
||
|
<B>#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)</B>
|
||
|
|
||
|
<B>int TIFFReadRGBAImage(TIFF* tif, u_long width, u_long height, u_long* raster, int stopOnError)</B>
|
||
|
</PRE><A NAME="lbAD"> </A>
|
||
|
<H2>DESCRIPTION</H2>
|
||
|
|
||
|
<I>TIFFReadRGBAImage</I>
|
||
|
|
||
|
reads a strip- or tile-based image into memory, storing the<BR>
|
||
|
result in the user supplied
|
||
|
<I>raster</I>.
|
||
|
|
||
|
The raster is assumed to be an array of
|
||
|
<I>width</I>
|
||
|
|
||
|
times
|
||
|
<I>height</I>
|
||
|
|
||
|
32-bit entries, where
|
||
|
<I>width</I>
|
||
|
|
||
|
must be less than or equal to the width of the image (<I>height</I>
|
||
|
|
||
|
may be any non-zero size).
|
||
|
If the raster dimensions are smaller than the image, the image data
|
||
|
is cropped to the raster bounds.
|
||
|
If the raster height is greater than that of the image, then the
|
||
|
image data are placed in the lower part of the raster.
|
||
|
(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 lower-left hand corner.)
|
||
|
<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>
|
||
|
|
||
|
<I>TIFFReadRGBAImage</I>
|
||
|
|
||
|
converts non-8-bit images by scaling sample values.
|
||
|
Palette, grayscale, bilevel,
|
||
|
<FONT SIZE="-1">CMYK</FONT>, and YCbCr images are converted to
|
||
|
<FONT SIZE="-1">RGB</FONT>
|
||
|
transparently.
|
||
|
Raster pixels are returned uncorrected by any colorimetry information
|
||
|
present in the directory.
|
||
|
<P>
|
||
|
|
||
|
The paramater
|
||
|
<I>stopOnError</I>
|
||
|
|
||
|
specifies how to act if an error is encountered while reading
|
||
|
the image.
|
||
|
If
|
||
|
<I>stopOnError</I>
|
||
|
|
||
|
is non-zero, then an error will terminate the operation; otherwise
|
||
|
<I>TIFFReadRGBAImage</I>
|
||
|
|
||
|
will continue processing data until all the possible data in the
|
||
|
image have been requested.
|
||
|
<A NAME="lbAE"> </A>
|
||
|
<H2>NOTES</H2>
|
||
|
|
||
|
In C++ the
|
||
|
<I>stopOnError</I>
|
||
|
|
||
|
parameter defaults to 0.
|
||
|
<P>
|
||
|
|
||
|
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>
|
||
|
|
||
|
Palettte image colormaps that appear to be incorrectly written
|
||
|
as 8-bit values are automatically scaled to 16-bits.
|
||
|
<P>
|
||
|
|
||
|
<I>TIFFReadRGBAImage</I>
|
||
|
|
||
|
is just a wrapper around the more general
|
||
|
<I><A HREF="TIFFRGBAImage.3t.html">TIFFRGBAImage</A></I>(3T)
|
||
|
|
||
|
facilities.
|
||
|
<A NAME="lbAF"> </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 and
|
||
|
<I>stopOnError</I>
|
||
|
|
||
|
is zero.
|
||
|
<A NAME="lbAG"> </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 "PhotometricInterpretation" tag</B>.
|
||
|
The image did not have a tag that describes how to display
|
||
|
the data.
|
||
|
<P>
|
||
|
|
||
|
<B>No "PhotometricInterpretation" 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 "PhotometricInterpretation" 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 "Colormap" 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&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"> </A>
|
||
|
<H2>BUGS</H2>
|
||
|
|
||
|
Orientations other than bottom-left, or top-left are
|
||
|
not handled correctly.
|
||
|
<A NAME="lbAI"> </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="TIFFReadRGBAStrip.3t.html">TIFFReadRGBAStrip</A></I>(3T),
|
||
|
|
||
|
<I><A HREF="TIFFReadRGBATile.3t.html">TIFFReadRGBATile</A></I>(3T)
|
||
|
|
||
|
|
||
|
<HR>
|
||
|
<A NAME="index"> </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>
|