1<!-- Creator : groff version 1.19.2 --> 2<!-- CreationDate: Mon Jan 2 17:41:42 2006 --> 3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 4"http://www.w3.org/TR/html4/loose.dtd"> 5<html> 6<head> 7<meta name="generator" content="groff -Thtml, see www.gnu.org"> 8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 9<meta name="Content-Style" content="text/css"> 10<style type="text/css"> 11 p { margin-top: 0; margin-bottom: 0; } 12 pre { margin-top: 0; margin-bottom: 0; } 13 table { margin-top: 0; margin-bottom: 0; } 14</style> 15<title>TIFFReadRGBATile</title> 16 17</head> 18<body> 19 20<h1 align=center>TIFFReadRGBATile</h1> 21 22<a href="#NAME">NAME</a><br> 23<a href="#SYNOPSIS">SYNOPSIS</a><br> 24<a href="#DESCRIPTION">DESCRIPTION</a><br> 25<a href="#NOTES">NOTES</a><br> 26<a href="#RETURN VALUES">RETURN VALUES</a><br> 27<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br> 28<a href="#SEE ALSO">SEE ALSO</a><br> 29 30<hr> 31 32 33<a name="NAME"></a> 34<h2>NAME</h2> 35 36 37 38<p style="margin-left:11%; margin-top: 1em">TIFFReadRGBATile 39− read and decode an image tile into a fixed-format 40raster</p> 41 42<a name="SYNOPSIS"></a> 43<h2>SYNOPSIS</h2> 44 45 46<p style="margin-left:11%; margin-top: 1em"><b>#include 47<tiffio.h></b></p> 48 49<table width="100%" border=0 rules="none" frame="void" 50 cellspacing="0" cellpadding="0"> 51<tr valign="top" align="left"> 52<td width="11%"></td> 53<td width="-3%"> 54 55 56<p valign="top"><b>#define TIFFGetR(abgr)</b></p></td> 57<td width="30%"></td> 58<td width="8%"></td> 59<td width="54%"> 60 61 62<p valign="top"><b>((abgr) & 0xff)</b></p></td> 63<tr valign="top" align="left"> 64<td width="11%"></td> 65<td width="-3%"> 66 67 68<p valign="top"><b>#define TIFFGetG(abgr)</b></p></td> 69<td width="30%"></td> 70<td width="8%"></td> 71<td width="54%"> 72 73 74<p valign="top"><b>(((abgr) >> 8) & 0xff)</b></p></td> 75<tr valign="top" align="left"> 76<td width="11%"></td> 77<td width="-3%"> 78 79 80<p valign="top"><b>#define TIFFGetB(abgr)</b></p></td> 81<td width="30%"></td> 82<td width="8%"></td> 83<td width="54%"> 84 85 86<p valign="top"><b>(((abgr) >> 16) & 870xff)</b></p> </td> 88<tr valign="top" align="left"> 89<td width="11%"></td> 90<td width="-3%"> 91 92 93<p valign="top"><b>#define TIFFGetA(abgr)</b></p></td> 94<td width="30%"></td> 95<td width="8%"></td> 96<td width="54%"> 97 98 99<p valign="top"><b>(((abgr) >> 24) & 1000xff)</b></p> </td> 101</table> 102 103<p style="margin-left:11%; margin-top: 1em"><b>int 104TIFFReadRGBATile(TIFF *</b><i>tif</i><b>, uint32</b> 105<i>x</i><b>, uint32</b> <i>y</i><b>, uint32 106*</b><i>raster</i><b>)</b></p> 107 108<a name="DESCRIPTION"></a> 109<h2>DESCRIPTION</h2> 110 111 112 113<p style="margin-left:11%; margin-top: 1em"><i>TIFFReadRGBATile</i> 114reads a single tile of a tile-based image into memory, 115storing the result in the user supplied RGBA <i>raster</i>. 116The raster is assumed to be an array of width times length 11732-bit entries, where width is the width of a tile 118(TIFFTAG_TILEWIDTH) and length is the height of a tile 119(TIFFTAG_TILELENGTH).</p> 120 121<p style="margin-left:11%; margin-top: 1em">The <i>x</i> 122and <i>y</i> values are the offsets from the top left corner 123to the top left corner of the tile to be read. They must be 124an exact multiple of the tile width and length.</p> 125 126<p style="margin-left:11%; margin-top: 1em">Note that the 127raster is assume to be organized such that the pixel at 128location (<i>x</i>,<i>y</i>) is 129<i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the 130raster origin in the <i>lower-left hand corner</i> of the 131tile. That is bottom to top organization. Edge tiles which 132partly fall off the image will be filled out with 133appropriate zeroed areas.</p> 134 135<p style="margin-left:11%; margin-top: 1em">Raster pixels 136are 8-bit packed red, green, blue, alpha samples. The macros 137<i>TIFFGetR</i>, <i>TIFFGetG</i>, <i>TIFFGetB</i>, and 138<i>TIFFGetA</i> should be used to access individual samples. 139Images without Associated Alpha matting information have a 140constant Alpha of 1.0 (255).</p> 141 142<p style="margin-left:11%; margin-top: 1em">See the 143<i>TIFFRGBAImage</i>(3TIFF) page for more details on how 144various image types are converted to RGBA values.</p> 145 146<a name="NOTES"></a> 147<h2>NOTES</h2> 148 149 150<p style="margin-left:11%; margin-top: 1em">Samples must be 151either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel 152must be either 1, 3, or 4 (i.e. <i>SamplesPerPixel</i> minus 153<i>ExtraSamples</i>).</p> 154 155<p style="margin-left:11%; margin-top: 1em">Palette image 156colormaps that appear to be incorrectly written as 8-bit 157values are automatically scaled to 16-bits.</p> 158 159 160<p style="margin-left:11%; margin-top: 1em"><i>TIFFReadRGBATile</i> 161is just a wrapper around the more general 162<i>TIFFRGBAImage</i>(3TIFF) facilities. It’s main 163advantage over the similar <i>TIFFReadRGBAImage()</i> 164function is that for large images a single buffer capable of 165holding the whole image doesn’t need to be allocated, 166only enough for one tile. The <i>TIFFReadRGBAStrip()</i> 167function does a similar operation for stripped images.</p> 168 169<a name="RETURN VALUES"></a> 170<h2>RETURN VALUES</h2> 171 172 173<p style="margin-left:11%; margin-top: 1em">1 is returned 174if the image was successfully read and converted. Otherwise, 1750 is returned if an error was encountered.</p> 176 177<a name="DIAGNOSTICS"></a> 178<h2>DIAGNOSTICS</h2> 179 180 181<p style="margin-left:11%; margin-top: 1em">All error 182messages are directed to the <i>TIFFError</i>(3TIFF) 183routine.</p> 184 185<p style="margin-left:11%; margin-top: 1em"><b>Sorry, can 186not handle %d-bit pictures</b>. The image had 187<i>BitsPerSample</i> other than 1, 2, 4, 8, or 16.</p> 188 189<p style="margin-left:11%; margin-top: 1em"><b>Sorry, can 190not handle %d-channel images</b>. The image had 191<i>SamplesPerPixel</i> other than 1, 3, or 4.</p> 192 193<p style="margin-left:11%; margin-top: 1em"><b>Missing 194needed "PhotometricInterpretation" tag</b>. The 195image did not have a tag that describes how to display the 196data.</p> 197 198<p style="margin-left:11%; margin-top: 1em"><b>No 199"PhotometricInterpretation" tag, assuming RGB</b>. 200The image was missing a tag that describes how to display 201it, but because it has 3 or 4 samples/pixel, it is assumed 202to be <small>RGB.</small></p> 203 204<p style="margin-left:11%; margin-top: 1em"><b>No 205"PhotometricInterpretation" tag, assuming 206min-is-black</b>. The image was missing a tag that describes 207how to display it, but because it has 1 sample/pixel, it is 208assumed to be a grayscale or bilevel image.</p> 209 210<p style="margin-left:11%; margin-top: 1em"><b>No space for 211photometric conversion table</b>. There was insufficient 212memory for a table used to convert image samples to 8-bit 213<small>RGB.</small></p> 214 215<p style="margin-left:11%; margin-top: 1em"><b>Missing 216required "Colormap" tag</b>. A Palette image did 217not have a required <i>Colormap</i> tag.</p> 218 219<p style="margin-left:11%; margin-top: 1em"><b>No space for 220tile buffer</b>. There was insufficient memory to allocate 221an i/o buffer.</p> 222 223<p style="margin-left:11%; margin-top: 1em"><b>No space for 224strip buffer</b>. There was insufficient memory to allocate 225an i/o buffer.</p> 226 227<p style="margin-left:11%; margin-top: 1em"><b>Can not 228handle format</b>. The image has a format (combination of 229<i>BitsPerSample</i>, <i>SamplesPerPixel</i>, and 230<i>PhotometricInterpretation</i>) that 231<i>TIFFReadRGBAImage</i> can not handle.</p> 232 233<p style="margin-left:11%; margin-top: 1em"><b>No space for 234B&W mapping table</b>. There was insufficient memory to 235allocate a table used to map grayscale data to 236<small>RGB.</small></p> 237 238<p style="margin-left:11%; margin-top: 1em"><b>No space for 239Palette mapping table</b>. There was insufficient memory to 240allocate a table used to map data to 8-bit 241<small>RGB.</small></p> 242 243<a name="SEE ALSO"></a> 244<h2>SEE ALSO</h2> 245 246 247 248<p style="margin-left:11%; margin-top: 1em"><b>TIFFOpen</b>(3TIFF), 249<b>TIFFRGBAImage</b>(3TIFF), 250<b>TIFFReadRGBAImage</b>(3TIFF), 251<b>TIFFReadRGBAStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p> 252 253<p style="margin-left:11%; margin-top: 1em">Libtiff library 254home page: <b>http://www.remotesensing.org/libtiff/</b></p> 255<hr> 256</body> 257</html> 258