1 <!-- Creator : groff version 1.18.1 -->
2 <!-- CreationDate: Sat Feb 24 18:37:17 2007 -->
5 <meta name="generator" content="groff -Thtml, see www.gnu.org">
6 <meta name="Content-Style" content="text/css">
7 <title>TIFFReadRGBAStrip</title>
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>
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>TIFFReadRGBAStrip − read and decode an image strip
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>
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) &
49 <p><b>int TIFFReadRGBAStrip(TIFF *</b><i>tif</i><b>,
50 uint32</b> <i>row</i><b>, uint32
51 *</b><i>raster</i><b>)</b></p>
54 <a name="DESCRIPTION"></a>
57 <table width="100%" border=0 rules="none" frame="void"
58 cols="2" cellspacing="0" cellpadding="0">
59 <tr valign="top" align="left">
62 <p><i>TIFFReadRGBAStrip</i> reads a single strip of a
63 strip-based image into memory, storing the result in the
64 user supplied RGBA <i>raster</i>. The raster is assumed to
65 be an array of width times rowsperstrip 32-bit entries,
66 where width is the width of the image (TIFFTAG_IMAGEWIDTH)
67 and rowsperstrip is the maximum lines in a strip
68 (TIFFTAG_ROWSPERSTRIP).</p>
70 <p>The <i>row</i> value should be the row of the first row
71 in the strip (strip * rowsperstrip, zero based).</p>
73 <p>Note that the raster is assume to be organized such that
74 the pixel at location (<i>x</i>,<i>y</i>) is
75 <i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the
76 raster origin in the <i>lower-left hand corner</i> of the
77 strip. That is bottom to top organization. When reading a
78 partial last strip in the file the last line of the image
79 will begin at the beginning of the buffer.</p>
81 <p>Raster pixels are 8-bit packed red, green, blue, alpha
82 samples. The macros <i>TIFFGetR</i>, <i>TIFFGetG</i>,
83 <i>TIFFGetB</i>, and <i>TIFFGetA</i> should be used to
84 access individual samples. Images without Associated Alpha
85 matting information have a constant Alpha of 1.0 (255).</p>
87 <p>See the <i>TIFFRGBAImage</i>(3TIFF) page for more details
88 on how various image types are converted to RGBA values.</p>
94 <table width="100%" border=0 rules="none" frame="void"
95 cols="2" cellspacing="0" cellpadding="0">
96 <tr valign="top" align="left">
99 <p>Samples must be either 1, 2, 4, 8, or 16 bits.
100 Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
101 <i>SamplesPerPixel</i> minus <i>ExtraSamples</i>).</p>
103 <p>Palette image colormaps that appear to be incorrectly
104 written as 8-bit values are automatically scaled to
107 <p><i>TIFFReadRGBAStrip</i> is just a wrapper around the
108 more general <i>TIFFRGBAImage</i>(3TIFF) facilities.
109 It’s main advantage over the similar
110 <i>TIFFReadRGBAImage()</i> function is that for large images
111 a single buffer capable of holding the whole image
112 doesn’t need to be allocated, only enough for one
113 strip. The <i>TIFFReadRGBATile()</i> function does a similar
114 operation for tiled images.</p>
117 <a name="RETURN VALUES"></a>
118 <h2>RETURN VALUES</h2>
120 <table width="100%" border=0 rules="none" frame="void"
121 cols="2" cellspacing="0" cellpadding="0">
122 <tr valign="top" align="left">
125 <p>1 is returned if the image was successfully read and
126 converted. Otherwise, 0 is returned if an error was
130 <a name="DIAGNOSTICS"></a>
133 <table width="100%" border=0 rules="none" frame="void"
134 cols="2" cellspacing="0" cellpadding="0">
135 <tr valign="top" align="left">
138 <p>All error messages are directed to the
139 <i>TIFFError</i>(3TIFF) routine.</p>
141 <p><b>Sorry, can not handle %d-bit pictures</b>. The image
142 had <i>BitsPerSample</i> other than 1, 2, 4, 8, or 16.</p>
144 <p><b>Sorry, can not handle %d-channel images</b>. The image
145 had <i>SamplesPerPixel</i> other than 1, 3, or 4.</p>
147 <p><b>Missing needed "PhotometricInterpretation"
148 tag</b>. The image did not have a tag that describes how to
149 display the data.</p>
151 <p><b>No "PhotometricInterpretation" tag, assuming
152 RGB</b>. The image was missing a tag that describes how to
153 display it, but because it has 3 or 4 samples/pixel, it is
154 assumed to be <small>RGB.</small></p>
156 <p><b>No "PhotometricInterpretation" tag, assuming
157 min-is-black</b>. The image was missing a tag that describes
158 how to display it, but because it has 1 sample/pixel, it is
159 assumed to be a grayscale or bilevel image.</p>
161 <p><b>No space for photometric conversion table</b>. There
162 was insufficient memory for a table used to convert image
163 samples to 8-bit <small>RGB.</small></p>
165 <p><b>Missing required "Colormap" tag</b>. A
166 Palette image did not have a required <i>Colormap</i>
169 <p><b>No space for tile buffer</b>. There was insufficient
170 memory to allocate an i/o buffer.</p>
172 <p><b>No space for strip buffer</b>. There was insufficient
173 memory to allocate an i/o buffer.</p>
175 <p><b>Can not handle format</b>. The image has a format
176 (combination of <i>BitsPerSample</i>,
177 <i>SamplesPerPixel</i>, and
178 <i>PhotometricInterpretation</i>) that
179 <i>TIFFReadRGBAImage</i> can not handle.</p>
181 <p><b>No space for B&W mapping table</b>. There was
182 insufficient memory to allocate a table used to map
183 grayscale data to <small>RGB.</small></p>
185 <p><b>No space for Palette mapping table</b>. There was
186 insufficient memory to allocate a table used to map data to
187 8-bit <small>RGB.</small></p>
190 <a name="SEE ALSO"></a>
193 <table width="100%" border=0 rules="none" frame="void"
194 cols="2" cellspacing="0" cellpadding="0">
195 <tr valign="top" align="left">
198 <p><b>TIFFOpen</b>(3TIFF), <b>TIFFRGBAImage</b>(3TIFF),
199 <b>TIFFReadRGBAImage</b>(3TIFF),
200 <b>TIFFReadRGBATile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
202 <p>Libtiff library home page:
203 <b>http://www.remotesensing.org/libtiff/</b></p>