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-->
12147N/A<!
ENTITY exde-
tt "EXTENDED DESCRIPTION">
10139N/A<!
ENTITY cmd "TIFFReadRGBATile">
12288N/A<!
ENTITY suncopy "Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.">
12294N/A<
refentry id="TIFFReadRGBATile-3tiff">
11066N/A<
refmeta><
refentrytitle>TIFFReadRGBATile</
refentrytitle><
manvolnum>3tiff</
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<
indexterm><
primary>TIFFReadRGBATile</
primary></
indexterm><
indexterm><
primary>
10139N/Aread and decode an image tile into a fixed-format raster</
primary></
indexterm>
10139N/A<
refnamediv id="TIFFReadRGBATile-3tiff-name"><
refname>TIFFReadRGBATile</
refname>
10139N/A<
refpurpose>read and decode an image tile into a fixed-format raster</
refpurpose>
10139N/A<
refsect1 id="TIFFReadRGBATile-3tiff-synp"><
title>&synp-tt;</
title>
10139N/A#define TIFFGetR(abgr) ((abgr) & 0xff)
10139N/A#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
10139N/A#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
10139N/A#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
10139N/Aint TIFFReadRGBATile(TIFF* tif, uint32 x, uint32 y, uint32 * raster )</
programlisting>
10139N/A<
refsect1 id="TIFFReadRGBATile-3tiff-desc"><
title>&desc-tt;</
title>
10139N/A<
para><
literal>TIFFReadRGBATile</
literal> reads a single tile of a tile-based
10139N/Aimage into memory, storing the result in the user-supplied RGBA raster. The
10139N/Araster is assumed to be an array of <
replaceable>width</
replaceable> times <
replaceable>
10139N/Alength</
replaceable> 32-bit entries, where <
replaceable>width</
replaceable>
10139N/Ais the width of a tile (<
literal>TIFFTAG_TILEWIDTH</
literal>), and <
replaceable>
10139N/Aheight</
replaceable> is the height of a tile (<
literal>TIFFTAG_TILELENGTH<?
Pub Caret>
10139N/A<
para>The <
replaceable>x</
replaceable> and <
replaceable>y</
replaceable> values
10139N/Aare the offsets from the top-left corner to the top-left corner of the
10139N/Atile to be read. These values must be an exact multiple of the tile width
10139N/A<
para>Note that the raster is assumed to be organized such that the pixel
10139N/Aat location (<
replaceable>x,y</
replaceable>) is <
replaceable>raster[y*width+x]
10139N/A</
replaceable>, with the raster origin in the bottom-left corner of the tile.
10139N/AThat is, bottom-to-top organization. Edge tiles that partly fall off the image
10139N/Aare filled out with appropriate zeroed areas.</
para>
10139N/A<
refsect1 id="TIFFReadRGBATile-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>See <
literal>TIFFRGBAImage(3tiff)</
literal> for more information about how
10139N/Avarious image types are converted to RGBA values.</
para>
10139N/A<
refsect2 id="TIFFReadRGBATile-3tiff-exde-diags">
10139N/A<
para>All error messages are directed to the <
literal>TIFFError(3tiff)</
literal>
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/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/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/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/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/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/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<
varlistentry><
term>No space for tile buffer.</
term><
listitem><
para>There
10139N/Ais insufficient memory to allocate an i/o buffer.</
para>
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<
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/ATIFFReadRGBAStrip</
literal> cannot process.</
para>
10139N/A<
varlistentry><
term>No space for B&W mapping table.</
term><
listitem><
para>
10139N/AThere is insufficient memory to allocate a table needed to map grayscale data
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/A<
refsect1 id="TIFFReadRGBATile-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.</
para>
12294N/A<
refsect1 id="TIFFReadRGBATile-3tiff-attr"><
title>&attr-tt;</
title>
12288N/A<
para>See <
olink targetdocent="REFMAN5" localinfo="attributes-5"><
citerefentry>
12288N/A<
refentrytitle>attributes</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry></
olink>
12288N/Afor descriptions of the following attributes:</
para>
12231N/A<
tgroup cols="2" colsep="1" rowsep="1"><
colspec colname="COLSPEC0" colwidth="1*">
12231N/A<
colspec colname="COLSPEC1" colwidth="1*">
12229N/A<
row><
entry align="center" valign="middle">ATTRIBUTE TYPE</
entry><
entry align="center" 12229N/Avalign="middle">ATTRIBUTE VALUE</
entry></
row>
12219N/A<
row><
entry colname="COLSPEC0"><
para>Interface stability</
para></
entry><
entry 12147N/Acolname="COLSPEC1"><
para>Uncommitted</
para></
entry></
row>
12147N/A<
refsect1 id="TIFFReadRGBATile-3tiff-also"><
title>&also-tt;</
title>
12071N/A<!--Reference to another man page--> 12071N/A<!--Reference to a Help manual--> 11989N/A<
para><
citerefentry><
refentrytitle>libtiff</
refentrytitle><
manvolnum>3</
manvolnum>
11989N/A</
citerefentry>, <
citerefentry><
refentrytitle>TIFFOpen</
refentrytitle><
manvolnum>
11989N/A3tiff</
manvolnum></
citerefentry>, <
citerefentry><
refentrytitle>TIFFRGBAImage
11416N/A</
refentrytitle><
manvolnum>3tiff</
manvolnum></
citerefentry>, <
citerefentry>
11417N/A<
refentrytitle>TIFFReadRGBAImage</
refentrytitle><
manvolnum>3tiff</
manvolnum>
11416N/A</
citerefentry>, <
citerefentry><
refentrytitle>TIFFReadRGBAStrip</
refentrytitle>
11257N/A<
manvolnum>3tiff</
manvolnum></
citerefentry></
para>
11257N/A<
refsect1 id="TIFFReadRGBATile-3tiff-note"><
title>¬e-tt;</
title>
11234N/A<
para>Orientations other than bottom-left or top-left are not processed correctly.
11257N/Amust be either 1, 3, or 4 (that is, <
literal>SamplesPerPixel</
literal> minus <
literal>
11191N/A<
para>Palette image colormaps that appear to be incorrectly written as 8-bit
11191N/Avalues are automatically scaled to 16-bits.</
para>
11191N/A<
para><
literal>TIFFReadRGBATile</
literal> is just a wrapper around the more
11191N/Ageneral <
literal>TIFFRGBAImage(3tiff)</
literal> facilities. The main advantage
11085N/Aof <
literal>TIFFReadRGBATile</
literal> over the similar <
literal>TIFFReadRGBAImage()
11085N/A</
literal> function is that for large images, it is not necessary to allocate
11085N/Aa single buffer capable of holding the whole image. The buffer only needs
11066N/Ato hold one tile. The <
literal>TIFFReadRGBAStrip()</
literal> function performs
11066N/Aa similar operation for stripped images.</
para>
11066N/A<
para>This man page was originally written by Sam Leffler. Updated by Breda McColgan, Sun Microsystems Inc., 2004.</
para>