1<!-- Creator     : groff version 1.18.1 -->
2<!-- CreationDate: Sun Mar  6 13:59:53 2005 -->
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>TIFFReadRGBAStrip</title>
8</head>
9<body>
10
11<h1 align=center>TIFFReadRGBAStrip</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>TIFFReadRGBAStrip &minus; read and decode an image strip
30into 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 &lt;tiffio.h&gt;</b></p>
42</td>
43</table>
44<!-- TABS -->
45<table width="100%" border=0 rules="none" frame="void"
46       cols="5" cellspacing="0" cellpadding="0">
47<tr valign="top" align="left">
48<td width="8%"></td>
49<td width="-2%">
50
51<p><b>#define TIFFGetR(abgr)</b></p>
52</td>
53<td width="25%"></td>
54<td width="6%"></td>
55<td width="61%">
56
57<p><b>((abgr) &amp; 0xff)</b></p>
58</td>
59<tr valign="top" align="left">
60<td width="8%"></td>
61<td width="-2%">
62
63<p><b>#define TIFFGetG(abgr)</b></p>
64</td>
65<td width="25%"></td>
66<td width="6%"></td>
67<td width="61%">
68
69<p><b>(((abgr) &gt;&gt; 8) &amp; 0xff)</b></p>
70</td>
71<tr valign="top" align="left">
72<td width="8%"></td>
73<td width="-2%">
74
75<p><b>#define TIFFGetB(abgr)</b></p>
76</td>
77<td width="25%"></td>
78<td width="6%"></td>
79<td width="61%">
80
81<p><b>(((abgr) &gt;&gt; 16) &amp; 0xff)</b></p>
82</td>
83<tr valign="top" align="left">
84<td width="8%"></td>
85<td width="-2%">
86
87<p><b>#define TIFFGetA(abgr)</b></p>
88</td>
89<td width="25%"></td>
90<td width="6%"></td>
91<td width="61%">
92
93<p><b>(((abgr) &gt;&gt; 24) &amp; 0xff)</b></p>
94</td>
95</table>
96<!-- INDENTATION -->
97<table width="100%" border=0 rules="none" frame="void"
98       cols="2" cellspacing="0" cellpadding="0">
99<tr valign="top" align="left">
100<td width="8%"></td>
101<td width="91%">
102<p><b>int TIFFReadRGBAStrip(TIFF *</b><i>tif</i><b>,
103uint32</b> <i>row</i><b>, uint32
104*</b><i>raster</i><b>)</b></p>
105</td>
106</table>
107<a name="DESCRIPTION"></a>
108<h2>DESCRIPTION</h2>
109<!-- INDENTATION -->
110<table width="100%" border=0 rules="none" frame="void"
111       cols="2" cellspacing="0" cellpadding="0">
112<tr valign="top" align="left">
113<td width="8%"></td>
114<td width="91%">
115<p><i>TIFFReadRGBAStrip</i> reads a single strip of a
116strip-based image into memory, storing the result in the
117user supplied RGBA <i>raster</i>. The raster is assumed to
118be an array of width times rowsperstrip 32-bit entries,
119where width is the width of the image (TIFFTAG_IMAGEWIDTH)
120and rowsperstrip is the maximum lines in a strip
121(TIFFTAG_ROWSPERSTRIP).</p>
122<!-- INDENTATION -->
123<p>The <i>row</i> value should be the row of the first row
124in the strip (strip * rowsperstrip, zero based).</p>
125<!-- INDENTATION -->
126<p>Note that the raster is assume to be organized such that
127the pixel at location (<i>x</i>,<i>y</i>) is
128<i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the
129raster origin in the <i>lower-left hand corner</i> of the
130strip. That is bottom to top organization. When reading a
131partial last strip in the file the last line of the image
132will begin at the beginning of the buffer.</p>
133<!-- INDENTATION -->
134<p>Raster pixels are 8-bit packed red, green, blue, alpha
135samples. The macros <i>TIFFGetR</i>, <i>TIFFGetG</i>,
136<i>TIFFGetB</i>, and <i>TIFFGetA</i> should be used to
137access individual samples. Images without Associated Alpha
138matting information have a constant Alpha of 1.0 (255).</p>
139<!-- INDENTATION -->
140<p>See the <i>TIFFRGBAImage</i>(3TIFF) page for more details
141on how various image types are converted to RGBA values.</p>
142</td>
143</table>
144<a name="NOTES"></a>
145<h2>NOTES</h2>
146<!-- INDENTATION -->
147<table width="100%" border=0 rules="none" frame="void"
148       cols="2" cellspacing="0" cellpadding="0">
149<tr valign="top" align="left">
150<td width="8%"></td>
151<td width="91%">
152<p>Samples must be either 1, 2, 4, 8, or 16 bits.
153Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
154<i>SamplesPerPixel</i> minus <i>ExtraSamples</i>).</p>
155<!-- INDENTATION -->
156<p>Palette image colormaps that appear to be incorrectly
157written as 8-bit values are automatically scaled to
15816-bits.</p>
159<!-- INDENTATION -->
160<p><i>TIFFReadRGBAStrip</i> is just a wrapper around the
161more general <i>TIFFRGBAImage</i>(3TIFF) facilities.
162It&rsquo;s main advantage over the similar
163<i>TIFFReadRGBAImage()</i> function is that for large images
164a single buffer capable of holding the whole image
165doesn&rsquo;t need to be allocated, only enough for one
166strip. The <i>TIFFReadRGBATile()</i> function does a similar
167operation for tiled images.</p>
168</td>
169</table>
170<a name="RETURN VALUES"></a>
171<h2>RETURN VALUES</h2>
172<!-- INDENTATION -->
173<table width="100%" border=0 rules="none" frame="void"
174       cols="2" cellspacing="0" cellpadding="0">
175<tr valign="top" align="left">
176<td width="8%"></td>
177<td width="91%">
178<p>1 is returned if the image was successfully read and
179converted. Otherwise, 0 is returned if an error was
180encountered.</p>
181</td>
182</table>
183<a name="DIAGNOSTICS"></a>
184<h2>DIAGNOSTICS</h2>
185<!-- INDENTATION -->
186<table width="100%" border=0 rules="none" frame="void"
187       cols="2" cellspacing="0" cellpadding="0">
188<tr valign="top" align="left">
189<td width="8%"></td>
190<td width="91%">
191<p>All error messages are directed to the
192<i>TIFFError</i>(3TIFF) routine.</p>
193<!-- INDENTATION -->
194<p><b>Sorry, can not handle %d-bit pictures</b>. The image
195had <i>BitsPerSample</i> other than 1, 2, 4, 8, or 16.</p>
196<!-- INDENTATION -->
197<p><b>Sorry, can not handle %d-channel images</b>. The image
198had <i>SamplesPerPixel</i> other than 1, 3, or 4.</p>
199<!-- INDENTATION -->
200<p><b>Missing needed &quot;PhotometricInterpretation&quot;
201tag</b>. The image did not have a tag that describes how to
202display the data.</p>
203<!-- INDENTATION -->
204<p><b>No &quot;PhotometricInterpretation&quot; tag, assuming
205RGB</b>. The image was missing a tag that describes how to
206display it, but because it has 3 or 4 samples/pixel, it is
207assumed to be <small>RGB.</small></p>
208<!-- INDENTATION -->
209<p><b>No &quot;PhotometricInterpretation&quot; tag, assuming
210min-is-black</b>. The image was missing a tag that describes
211how to display it, but because it has 1 sample/pixel, it is
212assumed to be a grayscale or bilevel image.</p>
213<!-- INDENTATION -->
214<p><b>No space for photometric conversion table</b>. There
215was insufficient memory for a table used to convert image
216samples to 8-bit <small>RGB.</small></p>
217<!-- INDENTATION -->
218<p><b>Missing required &quot;Colormap&quot; tag</b>. A
219Palette image did not have a required <i>Colormap</i>
220tag.</p>
221<!-- INDENTATION -->
222<p><b>No space for tile buffer</b>. There was insufficient
223memory to allocate an i/o buffer.</p>
224<!-- INDENTATION -->
225<p><b>No space for strip buffer</b>. There was insufficient
226memory to allocate an i/o buffer.</p>
227<!-- INDENTATION -->
228<p><b>Can not handle format</b>. The image has a format
229(combination of <i>BitsPerSample</i>,
230<i>SamplesPerPixel</i>, and
231<i>PhotometricInterpretation</i>) that
232<i>TIFFReadRGBAImage</i> can not handle.</p>
233<!-- INDENTATION -->
234<p><b>No space for B&amp;W mapping table</b>. There was
235insufficient memory to allocate a table used to map
236grayscale data to <small>RGB.</small></p>
237<!-- INDENTATION -->
238<p><b>No space for Palette mapping table</b>. There was
239insufficient memory to allocate a table used to map data to
2408-bit <small>RGB.</small></p>
241</td>
242</table>
243<a name="SEE ALSO"></a>
244<h2>SEE ALSO</h2>
245<!-- INDENTATION -->
246<table width="100%" border=0 rules="none" frame="void"
247       cols="2" cellspacing="0" cellpadding="0">
248<tr valign="top" align="left">
249<td width="8%"></td>
250<td width="91%">
251<p><i>libtiff</i>(3TIFF), <i>TIFFOpen</i>(3TIFF),
252<i>TIFFRGBAImage</i>(3TIFF),
253<i>TIFFReadRGBAImage</i>(3TIFF),
254<i>TIFFReadRGBATile</i>(3TIFF)</p>
255</td>
256</table>
257<hr>
258</body>
259</html>
260