1<!-- Creator : groff version 1.18.1 --> 2<!-- CreationDate: Sat Feb 24 18:37:17 2007 --> 3<html> 4<head> 5<meta name="generator" content="groff -Thtml, see www.gnu.org"> 6<meta name="Content-Style" content="text/css"> 7<title>TIFFReadRGBAImage</title> 8</head> 9<body> 10 11<h1 align=center>TIFFReadRGBAImage</h1> 12<a href="#NAME">NAME</a><br> 13<a href="#SYNOPSIS">SYNOPSIS</a><br> 14<a href="#DESCRIPTION">DESCRIPTION</a><br> 15<a href="#NOTES">NOTES</a><br> 16<a href="#RETURN VALUES">RETURN VALUES</a><br> 17<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br> 18<a href="#SEE ALSO">SEE ALSO</a><br> 19 20<hr> 21<a name="NAME"></a> 22<h2>NAME</h2> 23<!-- INDENTATION --> 24<table width="100%" border=0 rules="none" frame="void" 25 cols="2" cellspacing="0" cellpadding="0"> 26<tr valign="top" align="left"> 27<td width="8%"></td> 28<td width="91%"> 29<p>TIFFReadRGBAImage, TIFFReadRGBAImageOriented − read 30and decode an image into a fixed-format raster</p> 31</td> 32</table> 33<a name="SYNOPSIS"></a> 34<h2>SYNOPSIS</h2> 35<!-- INDENTATION --> 36<table width="100%" border=0 rules="none" frame="void" 37 cols="2" cellspacing="0" cellpadding="0"> 38<tr valign="top" align="left"> 39<td width="8%"></td> 40<td width="91%"> 41<p><b>#include <tiffio.h></b></p> 42<!-- INDENTATION --> 43<p><b>#define TIFFGetR(abgr) ((abgr) & 0xff)<br> 44#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)<br> 45#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)<br> 46#define TIFFGetA(abgr) (((abgr) >> 24) & 470xff)</b></p> 48<!-- INDENTATION --> 49<p><b>int TIFFReadRGBAImage(TIFF *</b><i>tif</i><b>, 50uint32</b> <i>width</i><b>, uint32</b> <i>height</i><b>, 51uint32 *</b><i>raster</i><b>, int</b> 52<i>stopOnError</i><b>)<br> 53int TIFFReadRGBAImageOriented(TIFF *</b><i>tif</i><b>, 54uint32</b> <i>width</i><b>, uint32</b> <i>height</i><b>, 55uint32 *</b><i>raster</i><b>, int</b> <i>orientation</i><b>, 56int</b> <i>stopOnError</i><b>)</b></p> 57</td> 58</table> 59<a name="DESCRIPTION"></a> 60<h2>DESCRIPTION</h2> 61<!-- INDENTATION --> 62<table width="100%" border=0 rules="none" frame="void" 63 cols="2" cellspacing="0" cellpadding="0"> 64<tr valign="top" align="left"> 65<td width="8%"></td> 66<td width="91%"> 67<p><i>TIFFReadRGBAImage</i> reads a strip- or tile-based 68image into memory, storing the result in the user supplied 69<i>raster</i>. The raster is assumed to be an array of 70<i>width</i> times <i>height</i> 32-bit entries, where 71<i>width</i> must be less than or equal to the width of the 72image (<i>height</i> may be any non-zero size). If the 73raster dimensions are smaller than the image, the image data 74is cropped to the raster bounds. If the raster height is 75greater than that of the image, then the image data are 76placed in the lower part of the raster. (Note that the 77raster is assume to be organized such that the pixel at 78location (<i>x</i>,<i>y</i>) is 79<i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the 80raster origin in the lower-left hand corner.)</p> 81<!-- INDENTATION --> 82<p><i>TIFFReadRGBAImageOriented</i> works like 83<i>TIFFReadRGBAImage</i> with except of that user can 84specify the raster origin position with the 85<i>orientation</i> parameter. Four orientations 86supported:</p> 87</td> 88</table> 89<!-- INDENTATION --> 90<table width="100%" border=0 rules="none" frame="void" 91 cols="2" cellspacing="0" cellpadding="0"> 92<tr valign="top" align="left"> 93<td width="8%"></td> 94<td width="91%"> 95<p><b>ORIENTATION_TOPLEFT</b></p></td> 96</table> 97<!-- INDENTATION --> 98<table width="100%" border=0 rules="none" frame="void" 99 cols="2" cellspacing="0" cellpadding="0"> 100<tr valign="top" align="left"> 101<td width="19%"></td> 102<td width="80%"> 103<p>origin in top-left corner,</p> 104</td> 105</table> 106<!-- INDENTATION --> 107<table width="100%" border=0 rules="none" frame="void" 108 cols="2" cellspacing="0" cellpadding="0"> 109<tr valign="top" align="left"> 110<td width="8%"></td> 111<td width="91%"> 112<p><b>ORIENTATION_TOPRIGHT</b></p></td> 113</table> 114<!-- INDENTATION --> 115<table width="100%" border=0 rules="none" frame="void" 116 cols="2" cellspacing="0" cellpadding="0"> 117<tr valign="top" align="left"> 118<td width="19%"></td> 119<td width="80%"> 120<p>origin in top-right corner,</p> 121</td> 122</table> 123<!-- INDENTATION --> 124<table width="100%" border=0 rules="none" frame="void" 125 cols="2" cellspacing="0" cellpadding="0"> 126<tr valign="top" align="left"> 127<td width="8%"></td> 128<td width="91%"> 129<p><b>ORIENTATION_BOTLEFT</b></p></td> 130</table> 131<!-- INDENTATION --> 132<table width="100%" border=0 rules="none" frame="void" 133 cols="2" cellspacing="0" cellpadding="0"> 134<tr valign="top" align="left"> 135<td width="19%"></td> 136<td width="80%"> 137<p>origin in bottom-left corner and</p> 138</td> 139</table> 140<!-- INDENTATION --> 141<table width="100%" border=0 rules="none" frame="void" 142 cols="2" cellspacing="0" cellpadding="0"> 143<tr valign="top" align="left"> 144<td width="8%"></td> 145<td width="91%"> 146<p><b>ORIENTATION_BOTRIGHT</b></p></td> 147</table> 148<!-- INDENTATION --> 149<table width="100%" border=0 rules="none" frame="void" 150 cols="2" cellspacing="0" cellpadding="0"> 151<tr valign="top" align="left"> 152<td width="19%"></td> 153<td width="80%"> 154<p>origin in bottom-right corner.</p> 155</td> 156</table> 157<!-- INDENTATION --> 158<table width="100%" border=0 rules="none" frame="void" 159 cols="2" cellspacing="0" cellpadding="0"> 160<tr valign="top" align="left"> 161<td width="8%"></td> 162<td width="91%"> 163<p>If you choose <b>ORIENTATION_BOTLEFT</b> result will be 164the same as returned by the <i>TIFFReadRGBAImage.</i></p> 165<!-- INDENTATION --> 166<p>Raster pixels are 8-bit packed red, green, blue, alpha 167samples. The macros <i>TIFFGetR</i>, <i>TIFFGetG</i>, 168<i>TIFFGetB</i>, and <i>TIFFGetA</i> should be used to 169access individual samples. Images without Associated Alpha 170matting information have a constant Alpha of 1.0 (255).</p> 171<!-- INDENTATION --> 172<p><i>TIFFReadRGBAImage</i> converts non-8-bit images by 173scaling sample values. Palette, grayscale, bilevel, 174<small>CMYK</small> , and YCbCr images are converted to 175<small>RGB</small> transparently. Raster pixels are returned 176uncorrected by any colorimetry information present in the 177directory.</p> 178<!-- INDENTATION --> 179<p>The paramater <i>stopOnError</i> specifies how to act if 180an error is encountered while reading the image. If 181<i>stopOnError</i> is non-zero, then an error will terminate 182the operation; otherwise <i>TIFFReadRGBAImage</i> will 183continue processing data until all the possible data in the 184image have been requested.</p> 185</td> 186</table> 187<a name="NOTES"></a> 188<h2>NOTES</h2> 189<!-- INDENTATION --> 190<table width="100%" border=0 rules="none" frame="void" 191 cols="2" cellspacing="0" cellpadding="0"> 192<tr valign="top" align="left"> 193<td width="8%"></td> 194<td width="91%"> 195<p>In C++ the <i>stopOnError</i> parameter defaults to 1960.</p> 197<!-- INDENTATION --> 198<p>Samples must be either 1, 2, 4, 8, or 16 bits. 199Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. 200<i>SamplesPerPixel</i> minus <i>ExtraSamples</i>).</p> 201<!-- INDENTATION --> 202<p>Palettte image colormaps that appear to be incorrectly 203written as 8-bit values are automatically scaled to 20416-bits.</p> 205<!-- INDENTATION --> 206<p><i>TIFFReadRGBAImage</i> is just a wrapper around the 207more general <i>TIFFRGBAImage</i>(3TIFF) facilities.</p> 208</td> 209</table> 210<a name="RETURN VALUES"></a> 211<h2>RETURN VALUES</h2> 212<!-- INDENTATION --> 213<table width="100%" border=0 rules="none" frame="void" 214 cols="2" cellspacing="0" cellpadding="0"> 215<tr valign="top" align="left"> 216<td width="8%"></td> 217<td width="91%"> 218<p>1 is returned if the image was successfully read and 219converted. Otherwise, 0 is returned if an error was 220encountered and <i>stopOnError</i> is zero.</p> 221</td> 222</table> 223<a name="DIAGNOSTICS"></a> 224<h2>DIAGNOSTICS</h2> 225<!-- INDENTATION --> 226<table width="100%" border=0 rules="none" frame="void" 227 cols="2" cellspacing="0" cellpadding="0"> 228<tr valign="top" align="left"> 229<td width="8%"></td> 230<td width="91%"> 231<p>All error messages are directed to the 232<i>TIFFError</i>(3TIFF) routine.</p> 233<!-- INDENTATION --> 234<p><b>Sorry, can not handle %d-bit pictures</b>. The image 235had <i>BitsPerSample</i> other than 1, 2, 4, 8, or 16.</p> 236<!-- INDENTATION --> 237<p><b>Sorry, can not handle %d-channel images</b>. The image 238had <i>SamplesPerPixel</i> other than 1, 3, or 4.</p> 239<!-- INDENTATION --> 240<p><b>Missing needed "PhotometricInterpretation" 241tag</b>. The image did not have a tag that describes how to 242display the data.</p> 243<!-- INDENTATION --> 244<p><b>No "PhotometricInterpretation" tag, assuming 245RGB</b>. The image was missing a tag that describes how to 246display it, but because it has 3 or 4 samples/pixel, it is 247assumed to be <small>RGB.</small></p> 248<!-- INDENTATION --> 249<p><b>No "PhotometricInterpretation" tag, assuming 250min-is-black</b>. The image was missing a tag that describes 251how to display it, but because it has 1 sample/pixel, it is 252assumed to be a grayscale or bilevel image.</p> 253<!-- INDENTATION --> 254<p><b>No space for photometric conversion table</b>. There 255was insufficient memory for a table used to convert image 256samples to 8-bit <small>RGB.</small></p> 257<!-- INDENTATION --> 258<p><b>Missing required "Colormap" tag</b>. A 259Palette image did not have a required <i>Colormap</i> 260tag.</p> 261<!-- INDENTATION --> 262<p><b>No space for tile buffer</b>. There was insufficient 263memory to allocate an i/o buffer.</p> 264<!-- INDENTATION --> 265<p><b>No space for strip buffer</b>. There was insufficient 266memory to allocate an i/o buffer.</p> 267<!-- INDENTATION --> 268<p><b>Can not handle format</b>. The image has a format 269(combination of <i>BitsPerSample</i>, 270<i>SamplesPerPixel</i>, and 271<i>PhotometricInterpretation</i>) that 272<i>TIFFReadRGBAImage</i> can not handle.</p> 273<!-- INDENTATION --> 274<p><b>No space for B&W mapping table</b>. There was 275insufficient memory to allocate a table used to map 276grayscale data to <small>RGB.</small></p> 277<!-- INDENTATION --> 278<p><b>No space for Palette mapping table</b>. There was 279insufficient memory to allocate a table used to map data to 2808-bit <small>RGB.</small></p> 281</td> 282</table> 283<a name="SEE ALSO"></a> 284<h2>SEE ALSO</h2> 285<!-- INDENTATION --> 286<table width="100%" border=0 rules="none" frame="void" 287 cols="2" cellspacing="0" cellpadding="0"> 288<tr valign="top" align="left"> 289<td width="8%"></td> 290<td width="91%"> 291<p><b>TIFFOpen</b>(3TIFF), <b>TIFFRGBAImage</b>(3TIFF), 292<b>TIFFReadRGBAStrip</b>(3TIFF), 293<b>TIFFReadRGBATile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p> 294<!-- INDENTATION --> 295<p>Libtiff library home page: 296<b>http://www.simplesystems.org/libtiff/</b></p> 297</td> 298</table> 299<hr> 300</body> 301</html> 302