10139N/A<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
10139N/A<!--ArborText, Inc., 1988-1999, v.4002-->
13666N/A<!--ARC : LSARC 2003/085 libtiff, libjpeg, and libpng-->
10139N/A<!ENTITY exde-tt "EXTENDED DESCRIPTION">
10139N/A<!ENTITY synp-tt "SYNOPSIS">
10139N/A<!ENTITY cmd "TIFFReadRGBAImage">
10139N/A<!ENTITY % commonents SYSTEM "smancommon.ent">
10139N/A%commonents;
10139N/A<!ENTITY % gnomecommonents SYSTEM "gnomecommon.ent">
10139N/A%gnomecommonents;
10139N/A<!ENTITY % booktitles SYSTEM "booktitles.ent">
10139N/A%booktitles;
10139N/A<!ENTITY suncopy "Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.">
10139N/A]>
10139N/A<?Pub UDT _bookmark _target>
10139N/A<?Pub EntList brvbar bull cross dash diam diams frac12 frac13 frac14 hellip
10139N/A laquo lArr loz mdash nabla ndash para pound rArr raquo sect yen amp>
10139N/A<?Pub Inc>
10139N/A<?PubInc>
10139N/A<refentry id="TIFFReadRGBAImage-3tiff">
10139N/A<!-- %Z%%M% %I% %E% SMI; -->
10139N/A<refmeta><refentrytitle>TIFFReadRGBAImage</refentrytitle><manvolnum>3tiff
10139N/A</manvolnum>
10139N/A<refmiscinfo class="date">05 Apr 2004</refmiscinfo>
10139N/A<refmiscinfo class="sectdesc">&man3;</refmiscinfo>
10139N/A<refmiscinfo class="software">&release;</refmiscinfo>
10139N/A<refmiscinfo class="arch">generic</refmiscinfo>
10139N/A<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
10139N/A</refmeta>
10139N/A<indexterm><primary>TIFFReadRGBAImage</primary></indexterm><indexterm><primary>
10139N/Aread and decode an image into a fixed-format raster</primary></indexterm>
10139N/A<refnamediv id="TIFFReadRGBAImage-3tiff-name"><refname>TIFFReadRGBAImage</refname>
10139N/A<refpurpose>read and decode an image into a fixed-format raster</refpurpose>
10139N/A</refnamediv>
10139N/A<refsect1 id="TIFFReadRGBAImage-3tiff-synp"><title>&synp-tt;</title>
10139N/A<programlisting>#include &lt;tiffio.h>
10139N/A#define TIFFGetR(abgr) ((abgr) &amp; 0xff)
10139N/A#define TIFFGetG(abgr) (((abgr) >> 8) &amp; 0xff)
10139N/A#define TIFFGetB(abgr) (((abgr) >> 16) &amp; 0xff)
10139N/A#define TIFFGetA(abgr) (((abgr) >> 24) &amp; 0xff)
10139N/Aint TIFFReadRGBAImage(TIFF* tif, u_long width, u_long height, u_long* raster, int stopOnError)
10139N/A</programlisting>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFReadRGBAImage-3tiff-desc"><title>&desc-tt;</title>
10139N/A<para><literal>TIFFReadRGBAImage</literal> reads a strip- or tile-based image
10139N/Ainto memory, storing the result in the user-supplied raster. The raster is
10139N/Aassumed to be an array of <replaceable>width</replaceable> times <replaceable>
10139N/Aheight</replaceable> 32-bit entries, whe<?Pub Caret>re <replaceable>width
10139N/A</replaceable> must be less than or equal to the width of the image, and <replaceable>
10139N/Aheight</replaceable> may be any non-zero size. If the raster dimensions are
10139N/Asmaller than the image, the image data is cropped to the raster bounds. If
10139N/Athe raster height is greater than that of the image, then the image data is
10139N/Aplaced in the lower part of the raster. Note that the raster is assumed to
10139N/Abe organized such that the pixel at location (<replaceable>x,y</replaceable>)
10139N/Ais <replaceable>raster[y*width+x]</replaceable>, with the raster origin in
10139N/Athe bottom-left corner.</para>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFReadRGBAImage-3tiff-exde"><title>&exde-tt;</title>
10139N/A<para>Raster pixels are 8-bit packed red, green, blue, alpha samples. The
10139N/Amacros <literal>TIFFGetR</literal>, <literal>TIFFGetG</literal>, <literal>
10139N/ATIFFGetB</literal>, and <literal>TIFFGetA</literal> should be used to access
10139N/Aindividual samples. Images without Associated Alpha matting information have
10139N/Aa constant Alpha of 1.0 (255).</para>
10139N/A<para><literal>TIFFReadRGBAImage</literal> converts non-8-bit images by scaling
10139N/Asample values. Palette, grayscale, bilevel, CMYK, and YCbCr images are converted
10139N/Ato RGB transparently. Raster pixels are returned uncorrected by any colorimetry
10139N/Ainformation present in the directory.</para>
10139N/A<para>The parameter <literal>stopOnError</literal> specifies how to act if
10139N/Aan error is encountered while reading the image. If <literal>stopOnError</literal>
10139N/Ais non-zero, then an error terminates the operation. Otherwise, <literal>
10139N/ATIFFReadRGBAImage</literal> continues to process data until all of the possible
10139N/Adata in the image has been requested.</para>
10139N/A<para>Samples must be either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel
10139N/Amust be either 1, 3, or 4 (that is, <literal>SamplesPerPixel</literal> minus <literal>
10139N/AExtraSamples</literal>).</para>
10139N/A<para>Palette image colormaps that appear to be incorrectly written as 8-bit
10139N/Avalues are automatically scaled to 16-bits.</para>
10139N/A<para><literal>TIFFReadRGBAImage</literal> is just a wrapper around the more
10139N/Ageneral <literal>TIFFRGBAImage(3tiff)</literal> facilities.</para>
10139N/A<refsect2 id="TIFFReadRGBAImage-3tiff-exde-diags">
10139N/A<title>Diagnostics</title>
10139N/A<para>All error messages are directed to the <literal>TIFFError(3tiff)</literal>
10139N/Aroutine.</para>
10139N/A<variablelist termlength="wholeline">
10139N/A<varlistentry><term>Sorry, can not handle %d-bit pictures.</term><listitem>
10139N/A<para>The image has a <literal>BitsPerSample</literal> value other than 1,
10139N/A2, 4, 8, or 16.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>Sorry, can not handle %d-channel images.</term><listitem>
10139N/A<para>The image has a <literal>SamplesPerPixel</literal> value other than
10139N/A1, 3, or 4.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>Missing needed "PhotometricInterpretation" tag.</term>
10139N/A<listitem><para>The image does not have a tag that describes how to display
10139N/Athe data.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>No "PhotometricInterpretation" tag, assuming RGB.</term>
10139N/A<listitem><para>The image does not have a tag that describes how to display
10139N/Athe data, but is assumed to be RGB because the image has 3 or 4 samples/pixel.
10139N/A</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>No "PhotometricInterpretation" tag, assuming min-is-black.
10139N/A</term><listitem><para>The image does not have a tag that describes how to
10139N/Adisplay the data, but is assumed to be a grayscale or bilevel image because
10139N/Athe image has 1 sample/pixel.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>No space for photometric conversion table.</term><listitem>
10139N/A<para>There is insufficient memory for a table needed to convert image samples
10139N/Ato 8-bit RGB.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>Missing required "Colormap" tag.</term><listitem><para>
10139N/AA Palette image does not have a required <literal>Colormap</literal> tag.
10139N/A</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>No space for tile buffer.</term><listitem><para>There
10139N/Ais insufficient memory to allocate an i/o buffer.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>No space for strip buffer.</term><listitem><para>There
10139N/Ais insufficient memory to allocate an i/o buffer.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>Can not handle format.</term><listitem><para>The image
10139N/Ahas a format (combination of <literal>BitsPerSample</literal>, <literal>SamplesPerPixel
10139N/A</literal>, and <literal>PhotometricInterpretation</literal>) that <literal>
10139N/ATIFFReadRGBAImage</literal> cannot process.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>No space for B&amp;W mapping table.</term><listitem><para>
10139N/AThere is insufficient memory to allocate a table needed to map grayscale data
10139N/Ato RGB.</para>
10139N/A</listitem></varlistentry>
10139N/A<varlistentry><term>No space for Palette mapping table.</term><listitem><para>
10139N/AThere is insufficient memory to allocate a table needed to map data to 8-bit
10139N/ARGB.</para>
10139N/A</listitem></varlistentry>
10139N/A</variablelist></refsect2>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFReadRGBAImage-3tiff-rtrn"><title>&rtrn-tt;</title>
10139N/A<para>1 is returned if the image was successfully read and converted. Otherwise,
10139N/A0 is returned if an error was encountered and <literal>stopOnError</literal>
10139N/Ais zero.</para>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFReadRGBAImage-3tiff-attr"><title>&attr-tt;</title>
10139N/A<para>See <olink targetdocent="REFMAN5" localinfo="attributes-5"><citerefentry>
10139N/A<refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>
10139N/Afor descriptions of the following attributes:</para>
10139N/A<informaltable frame="all">
10139N/A<tgroup cols="2" colsep="1" rowsep="1"><colspec colname="COLSPEC0" colwidth="1*">
10139N/A<colspec colname="COLSPEC1" colwidth="1*">
10139N/A<thead>
10139N/A<row><entry align="center" valign="middle">ATTRIBUTE TYPE</entry><entry align="center"
10139N/Avalign="middle">ATTRIBUTE VALUE</entry></row>
10139N/A</thead>
10139N/A<tbody>
18745N/A<row><entry><para>Availability</para></entry><entry><para>image/library/libtiff</para></entry>
10139N/A</row>
10139N/A<row><entry colname="COLSPEC0"><para>Interface stability</para></entry><entry
13623N/Acolname="COLSPEC1"><para>Uncommitted</para></entry></row>
10139N/A</tbody>
10139N/A</tgroup>
10139N/A</informaltable>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFReadRGBAImage-3tiff-also"><title>&also-tt;</title>
10139N/A<!--Reference to another man page-->
10139N/A<!--Reference to a Help manual-->
10139N/A<!--Reference to a book.-->
10139N/A<para><citerefentry><refentrytitle>libtiff</refentrytitle><manvolnum>3</manvolnum>
10139N/A</citerefentry>, <citerefentry><refentrytitle>TIFFOpen</refentrytitle><manvolnum>
10139N/A3tiff</manvolnum></citerefentry>, <citerefentry><refentrytitle>TIFFRGBAImage
10139N/A</refentrytitle><manvolnum>3tiff</manvolnum></citerefentry>, <citerefentry>
10139N/A<refentrytitle>TIFFReadRGBAStrip</refentrytitle><manvolnum>3tiff</manvolnum>
10139N/A</citerefentry>, <citerefentry><refentrytitle>TIFFReadRGBATile</refentrytitle>
10139N/A<manvolnum>3tiff</manvolnum></citerefentry></para>
10139N/A</refsect1>
10139N/A<refsect1 id="TIFFReadRGBAImage-3tiff-note"><title>&note-tt;</title>
10139N/A<para>Orientations other than bottom-left or top-left are not processed correctly.
10139N/A</para>
10139N/A<para>In C++, the <literal>stopOnError</literal> parameter defaults to 0.
10139N/A</para>
10139N/A<para>This man page was originally written by Sam Leffler. Updated by Breda McColgan, Sun Microsystems Inc., 2004.</para>
10139N/A</refsect1>
10139N/A</refentry>
10139N/A<?Pub *0000009392>