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>TIFFReadRGBAStrip</title> 16 17</head> 18<body> 19 20<h1 align=center>TIFFReadRGBAStrip</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">TIFFReadRGBAStrip 39− read and decode an image strip 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<p style="margin-left:11%; margin-top: 1em"><b>#define 50TIFFGetR(abgr) ((abgr) & 0xff) <br> 51#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff) <br> 52#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff) 53<br> 54#define TIFFGetA(abgr) (((abgr) >> 24) & 550xff)</b></p> 56 57<p style="margin-left:11%; margin-top: 1em"><b>int 58TIFFReadRGBAStrip(TIFF *</b><i>tif</i><b>, uint32</b> 59<i>row</i><b>, uint32 *</b><i>raster</i><b>)</b></p> 60 61<a name="DESCRIPTION"></a> 62<h2>DESCRIPTION</h2> 63 64 65 66<p style="margin-left:11%; margin-top: 1em"><i>TIFFReadRGBAStrip</i> 67reads a single strip of a strip-based image into memory, 68storing the result in the user supplied RGBA <i>raster</i>. 69The raster is assumed to be an array of width times 70rowsperstrip 32-bit entries, where width is the width of the 71image (TIFFTAG_IMAGEWIDTH) and rowsperstrip is the maximum 72lines in a strip (TIFFTAG_ROWSPERSTRIP).</p> 73 74<p style="margin-left:11%; margin-top: 1em">The <i>row</i> 75value should be the row of the first row in the strip (strip 76* rowsperstrip, zero based).</p> 77 78<p style="margin-left:11%; margin-top: 1em">Note that the 79raster is assume to be organized such that the pixel at 80location (<i>x</i>,<i>y</i>) is 81<i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the 82raster origin in the <i>lower-left hand corner</i> of the 83strip. That is bottom to top organization. When reading a 84partial last strip in the file the last line of the image 85will begin at the beginning of the buffer.</p> 86 87<p style="margin-left:11%; margin-top: 1em">Raster pixels 88are 8-bit packed red, green, blue, alpha samples. The macros 89<i>TIFFGetR</i>, <i>TIFFGetG</i>, <i>TIFFGetB</i>, and 90<i>TIFFGetA</i> should be used to access individual samples. 91Images without Associated Alpha matting information have a 92constant Alpha of 1.0 (255).</p> 93 94<p style="margin-left:11%; margin-top: 1em">See the 95<i>TIFFRGBAImage</i>(3TIFF) page for more details on how 96various image types are converted to RGBA values.</p> 97 98<a name="NOTES"></a> 99<h2>NOTES</h2> 100 101 102<p style="margin-left:11%; margin-top: 1em">Samples must be 103either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel 104must be either 1, 3, or 4 (i.e. <i>SamplesPerPixel</i> minus 105<i>ExtraSamples</i>).</p> 106 107<p style="margin-left:11%; margin-top: 1em">Palette image 108colormaps that appear to be incorrectly written as 8-bit 109values are automatically scaled to 16-bits.</p> 110 111 112<p style="margin-left:11%; margin-top: 1em"><i>TIFFReadRGBAStrip</i> 113is just a wrapper around the more general 114<i>TIFFRGBAImage</i>(3TIFF) facilities. It’s main 115advantage over the similar <i>TIFFReadRGBAImage()</i> 116function is that for large images a single buffer capable of 117holding the whole image doesn’t need to be allocated, 118only enough for one strip. The <i>TIFFReadRGBATile()</i> 119function does a similar operation for tiled images.</p> 120 121<a name="RETURN VALUES"></a> 122<h2>RETURN VALUES</h2> 123 124 125<p style="margin-left:11%; margin-top: 1em">1 is returned 126if the image was successfully read and converted. Otherwise, 1270 is returned if an error was encountered.</p> 128 129<a name="DIAGNOSTICS"></a> 130<h2>DIAGNOSTICS</h2> 131 132 133<p style="margin-left:11%; margin-top: 1em">All error 134messages are directed to the <i>TIFFError</i>(3TIFF) 135routine.</p> 136 137<p style="margin-left:11%; margin-top: 1em"><b>Sorry, can 138not handle %d-bit pictures</b>. The image had 139<i>BitsPerSample</i> other than 1, 2, 4, 8, or 16.</p> 140 141<p style="margin-left:11%; margin-top: 1em"><b>Sorry, can 142not handle %d-channel images</b>. The image had 143<i>SamplesPerPixel</i> other than 1, 3, or 4.</p> 144 145<p style="margin-left:11%; margin-top: 1em"><b>Missing 146needed "PhotometricInterpretation" tag</b>. The 147image did not have a tag that describes how to display the 148data.</p> 149 150<p style="margin-left:11%; margin-top: 1em"><b>No 151"PhotometricInterpretation" tag, assuming RGB</b>. 152The image was missing a tag that describes how to display 153it, but because it has 3 or 4 samples/pixel, it is assumed 154to be <small>RGB.</small></p> 155 156<p style="margin-left:11%; margin-top: 1em"><b>No 157"PhotometricInterpretation" tag, assuming 158min-is-black</b>. The image was missing a tag that describes 159how to display it, but because it has 1 sample/pixel, it is 160assumed to be a grayscale or bilevel image.</p> 161 162<p style="margin-left:11%; margin-top: 1em"><b>No space for 163photometric conversion table</b>. There was insufficient 164memory for a table used to convert image samples to 8-bit 165<small>RGB.</small></p> 166 167<p style="margin-left:11%; margin-top: 1em"><b>Missing 168required "Colormap" tag</b>. A Palette image did 169not have a required <i>Colormap</i> tag.</p> 170 171<p style="margin-left:11%; margin-top: 1em"><b>No space for 172tile buffer</b>. There was insufficient memory to allocate 173an i/o buffer.</p> 174 175<p style="margin-left:11%; margin-top: 1em"><b>No space for 176strip buffer</b>. There was insufficient memory to allocate 177an i/o buffer.</p> 178 179<p style="margin-left:11%; margin-top: 1em"><b>Can not 180handle format</b>. The image has a format (combination of 181<i>BitsPerSample</i>, <i>SamplesPerPixel</i>, and 182<i>PhotometricInterpretation</i>) that 183<i>TIFFReadRGBAImage</i> can not handle.</p> 184 185<p style="margin-left:11%; margin-top: 1em"><b>No space for 186B&W mapping table</b>. There was insufficient memory to 187allocate a table used to map grayscale data to 188<small>RGB.</small></p> 189 190<p style="margin-left:11%; margin-top: 1em"><b>No space for 191Palette mapping table</b>. There was insufficient memory to 192allocate a table used to map data to 8-bit 193<small>RGB.</small></p> 194 195<a name="SEE ALSO"></a> 196<h2>SEE ALSO</h2> 197 198 199 200<p style="margin-left:11%; margin-top: 1em"><b>TIFFOpen</b>(3TIFF), 201<b>TIFFRGBAImage</b>(3TIFF), 202<b>TIFFReadRGBAImage</b>(3TIFF), 203<b>TIFFReadRGBATile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p> 204 205<p style="margin-left:11%; margin-top: 1em">Libtiff library 206home page: <b>http://www.remotesensing.org/libtiff/</b></p> 207<hr> 208</body> 209</html> 210