1 <!-- Creator : groff version 1.18.1 -->
2 <!-- CreationDate: Mon Mar 13 18:03:10 2006 -->
5 <meta name=
"generator" content=
"groff -Thtml, see www.gnu.org">
6 <meta name=
"Content-Style" content=
"text/css">
7 <title>TIFFReadRGBATile
</title>
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>
24 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
25 cols=
"2" cellspacing=
"0" cellpadding=
"0">
26 <tr valign=
"top" align=
"left">
29 <p>TIFFReadRGBATile
− read and decode an image tile
30 into a fixed-format raster
</p>
33 <a name=
"SYNOPSIS"></a>
36 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
37 cols=
"2" cellspacing=
"0" cellpadding=
"0">
38 <tr valign=
"top" align=
"left">
41 <p><b>#include
<tiffio.h
></b></p>
45 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
46 cols=
"5" cellspacing=
"0" cellpadding=
"0">
47 <tr valign=
"top" align=
"left">
51 <p><b>#define TIFFGetR(abgr)
</b></p>
57 <p><b>((abgr)
& 0xff)
</b></p>
59 <tr valign=
"top" align=
"left">
63 <p><b>#define TIFFGetG(abgr)
</b></p>
69 <p><b>(((abgr)
>> 8)
& 0xff)
</b></p>
71 <tr valign=
"top" align=
"left">
75 <p><b>#define TIFFGetB(abgr)
</b></p>
81 <p><b>(((abgr)
>> 16)
& 0xff)
</b></p>
83 <tr valign=
"top" align=
"left">
87 <p><b>#define TIFFGetA(abgr)
</b></p>
93 <p><b>(((abgr)
>> 24)
& 0xff)
</b></p>
97 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
98 cols=
"2" cellspacing=
"0" cellpadding=
"0">
99 <tr valign=
"top" align=
"left">
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>
107 <a name=
"DESCRIPTION"></a>
110 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
111 cols=
"2" cellspacing=
"0" cellpadding=
"0">
112 <tr valign=
"top" align=
"left">
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>
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
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>
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>
141 <p>See the
<i>TIFFRGBAImage
</i>(
3TIFF) page for more details
142 on how various image types are converted to RGBA values.
</p>
148 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
149 cols=
"2" cellspacing=
"0" cellpadding=
"0">
150 <tr valign=
"top" align=
"left">
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>
157 <p>Palette image colormaps that appear to be incorrectly
158 written as
8-bit values are automatically scaled to
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>
170 <a name=
"RETURN VALUES"></a>
171 <h2>RETURN VALUES
</h2>
173 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
174 cols=
"2" cellspacing=
"0" cellpadding=
"0">
175 <tr valign=
"top" align=
"left">
178 <p>1 is returned if the image was successfully read and
179 converted. Otherwise,
0 is returned if an error was
183 <a name=
"DIAGNOSTICS"></a>
186 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
187 cols=
"2" cellspacing=
"0" cellpadding=
"0">
188 <tr valign=
"top" align=
"left">
191 <p>All error messages are directed to the
192 <i>TIFFError
</i>(
3TIFF) routine.
</p>
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>
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>
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>
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>
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>
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>
218 <p><b>Missing required
"Colormap
" tag
</b>. A
219 Palette image did not have a required
<i>Colormap
</i>
222 <p><b>No space for tile buffer
</b>. There was insufficient
223 memory to allocate an i/o buffer.
</p>
225 <p><b>No space for strip buffer
</b>. There was insufficient
226 memory to allocate an i/o buffer.
</p>
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>
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>
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>
243 <a name=
"SEE ALSO"></a>
246 <table width=
"100%" border=
0 rules=
"none" frame=
"void"
247 cols=
"2" cellspacing=
"0" cellpadding=
"0">
248 <tr valign=
"top" align=
"left">
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>
255 <p>Libtiff library home page:
256 <b>http://www.remotesensing.org/libtiff/
</b></p>