|
1 <!-- Creator : groff version 1.18.1 --> |
|
2 <!-- CreationDate: Mon Mar 13 18:03:10 2006 --> |
|
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>TIFFReadRGBATile</title> |
|
8 </head> |
|
9 <body> |
|
10 |
|
11 <h1 align=center>TIFFReadRGBATile</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>TIFFReadRGBATile − read and decode an image tile |
|
30 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 </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) & 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) >> 8) & 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) >> 16) & 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) >> 24) & 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 TIFFReadRGBATile(TIFF *</b><i>tif</i><b>, |
|
103 uint32</b> <i>x</i><b>, uint32</b> <i>y</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>TIFFReadRGBATile</i> reads a single tile of a |
|
116 tile-based image into memory, storing the result in the user |
|
117 supplied RGBA <i>raster</i>. The raster is assumed to be an |
|
118 array of width times length 32-bit entries, where width is |
|
119 the width of a tile (TIFFTAG_TILEWIDTH) and length is the |
|
120 height of a tile (TIFFTAG_TILELENGTH).</p> |
|
121 <!-- INDENTATION --> |
|
122 <p>The <i>x</i> and <i>y</i> values are the offsets from the |
|
123 top left corner to the top left corner of the tile to be |
|
124 read. They must be an exact multiple of the tile width and |
|
125 length.</p> |
|
126 <!-- INDENTATION --> |
|
127 <p>Note that the raster is assume to be organized such that |
|
128 the pixel at location (<i>x</i>,<i>y</i>) is |
|
129 <i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the |
|
130 raster origin in the <i>lower-left hand corner</i> of the |
|
131 tile. That is bottom to top organization. Edge tiles which |
|
132 partly fall off the image will be filled out with |
|
133 appropriate zeroed areas.</p> |
|
134 <!-- INDENTATION --> |
|
135 <p>Raster pixels are 8-bit packed red, green, blue, alpha |
|
136 samples. The macros <i>TIFFGetR</i>, <i>TIFFGetG</i>, |
|
137 <i>TIFFGetB</i>, and <i>TIFFGetA</i> should be used to |
|
138 access individual samples. Images without Associated Alpha |
|
139 matting information have a constant Alpha of 1.0 (255).</p> |
|
140 <!-- INDENTATION --> |
|
141 <p>See the <i>TIFFRGBAImage</i>(3TIFF) page for more details |
|
142 on how various image types are converted to RGBA values.</p> |
|
143 </td> |
|
144 </table> |
|
145 <a name="NOTES"></a> |
|
146 <h2>NOTES</h2> |
|
147 <!-- INDENTATION --> |
|
148 <table width="100%" border=0 rules="none" frame="void" |
|
149 cols="2" cellspacing="0" cellpadding="0"> |
|
150 <tr valign="top" align="left"> |
|
151 <td width="8%"></td> |
|
152 <td width="91%"> |
|
153 <p>Samples must be either 1, 2, 4, 8, or 16 bits. |
|
154 Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. |
|
155 <i>SamplesPerPixel</i> minus <i>ExtraSamples</i>).</p> |
|
156 <!-- INDENTATION --> |
|
157 <p>Palette image colormaps that appear to be incorrectly |
|
158 written as 8-bit values are automatically scaled to |
|
159 16-bits.</p> |
|
160 <!-- INDENTATION --> |
|
161 <p><i>TIFFReadRGBATile</i> is just a wrapper around the more |
|
162 general <i>TIFFRGBAImage</i>(3TIFF) facilities. It’s |
|
163 main advantage over the similar <i>TIFFReadRGBAImage()</i> |
|
164 function is that for large images a single buffer capable of |
|
165 holding the whole image doesn’t need to be allocated, |
|
166 only enough for one tile. The <i>TIFFReadRGBAStrip()</i> |
|
167 function does a similar operation for stripped 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 |
|
179 converted. Otherwise, 0 is returned if an error was |
|
180 encountered.</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 |
|
195 had <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 |
|
198 had <i>SamplesPerPixel</i> other than 1, 3, or 4.</p> |
|
199 <!-- INDENTATION --> |
|
200 <p><b>Missing needed "PhotometricInterpretation" |
|
201 tag</b>. The image did not have a tag that describes how to |
|
202 display the data.</p> |
|
203 <!-- INDENTATION --> |
|
204 <p><b>No "PhotometricInterpretation" tag, assuming |
|
205 RGB</b>. The image was missing a tag that describes how to |
|
206 display it, but because it has 3 or 4 samples/pixel, it is |
|
207 assumed to be <small>RGB.</small></p> |
|
208 <!-- INDENTATION --> |
|
209 <p><b>No "PhotometricInterpretation" tag, assuming |
|
210 min-is-black</b>. The image was missing a tag that describes |
|
211 how to display it, but because it has 1 sample/pixel, it is |
|
212 assumed to be a grayscale or bilevel image.</p> |
|
213 <!-- INDENTATION --> |
|
214 <p><b>No space for photometric conversion table</b>. There |
|
215 was insufficient memory for a table used to convert image |
|
216 samples to 8-bit <small>RGB.</small></p> |
|
217 <!-- INDENTATION --> |
|
218 <p><b>Missing required "Colormap" tag</b>. A |
|
219 Palette image did not have a required <i>Colormap</i> |
|
220 tag.</p> |
|
221 <!-- INDENTATION --> |
|
222 <p><b>No space for tile buffer</b>. There was insufficient |
|
223 memory to allocate an i/o buffer.</p> |
|
224 <!-- INDENTATION --> |
|
225 <p><b>No space for strip buffer</b>. There was insufficient |
|
226 memory 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&W mapping table</b>. There was |
|
235 insufficient memory to allocate a table used to map |
|
236 grayscale data to <small>RGB.</small></p> |
|
237 <!-- INDENTATION --> |
|
238 <p><b>No space for Palette mapping table</b>. There was |
|
239 insufficient memory to allocate a table used to map data to |
|
240 8-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><b>TIFFOpen</b>(3TIFF), <b>TIFFRGBAImage</b>(3TIFF), |
|
252 <b>TIFFReadRGBAImage</b>(3TIFF), |
|
253 <b>TIFFReadRGBAStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p> |
|
254 <!-- INDENTATION --> |
|
255 <p>Libtiff library home page: |
|
256 <b>http://www.remotesensing.org/libtiff/</b></p> |
|
257 </td> |
|
258 </table> |
|
259 <hr> |
|
260 </body> |
|
261 </html> |