]> git.saurik.com Git - wxWidgets.git/blob - src/tiff/man/TIFFReadRGBAStrip.3tiff
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / src / tiff / man / TIFFReadRGBAStrip.3tiff
1 .\"
2 .\" Copyright (c) 1991-1997 Sam Leffler
3 .\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
4 .\"
5 .\" Permission to use, copy, modify, distribute, and sell this software and
6 .\" its documentation for any purpose is hereby granted without fee, provided
7 .\" that (i) the above copyright notices and this permission notice appear in
8 .\" all copies of the software and related documentation, and (ii) the names of
9 .\" Sam Leffler and Silicon Graphics may not be used in any advertising or
10 .\" publicity relating to the software without the specific, prior written
11 .\" permission of Sam Leffler and Silicon Graphics.
12 .\"
13 .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14 .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15 .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16 .\"
17 .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18 .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19 .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21 .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22 .\" OF THIS SOFTWARE.
23 .\"
24 .if n .po 0
25 .TH TIFFReadRGBAStrip 3TIFF "December 10, 1998" "libtiff"
26 .SH NAME
27 TIFFReadRGBAStrip \- read and decode an image strip into a fixed-format raster
28 .SH SYNOPSIS
29 .B "#include <tiffio.h>"
30 .sp
31 .B "#define TIFFGetR(abgr) ((abgr) & 0xff)"
32 .br
33 .B "#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)"
34 .br
35 .B "#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)"
36 .br
37 .B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)"
38 .sp
39 .BI "int TIFFReadRGBAStrip(TIFF *" tif ", uint32 " row ", uint32 *" raster ")"
40 .SH DESCRIPTION
41 .IR TIFFReadRGBAStrip
42 reads a single strip of a strip-based image into memory, storing the result in
43 the user supplied RGBA
44 .IR raster .
45 The raster is assumed to be an array of width times rowsperstrip 32-bit
46 entries, where width is the width of the image (TIFFTAG_IMAGEWIDTH) and
47 rowsperstrip is the maximum lines in a strip (TIFFTAG_ROWSPERSTRIP).
48
49 .PP
50 The
51 .IR row
52 value should be the row of the first row in the strip (strip * rowsperstrip,
53 zero based).
54
55 .PP
56 Note that the raster is assume to be organized such that the pixel at location
57 (\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP]; with the
58 raster origin in the
59 .I lower-left hand corner
60 of the strip. That is bottom to top organization. When reading a partial last
61 strip in the file the last line of the image will begin at the beginning of
62 the buffer.
63
64 .PP
65 Raster pixels are 8-bit packed red, green, blue, alpha samples. The macros
66 .IR TIFFGetR ,
67 .IR TIFFGetG ,
68 .IR TIFFGetB ,
69 and
70 .I TIFFGetA
71 should be used to access individual samples. Images without Associated Alpha
72 matting information have a constant Alpha of 1.0 (255).
73 .PP
74 See the
75 .IR TIFFRGBAImage (3TIFF)
76 page for more details on how various image types are converted to RGBA values.
77 .SH NOTES
78 Samples must be either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel must
79 be either 1, 3, or 4 (i.e.
80 .I SamplesPerPixel
81 minus
82 .IR ExtraSamples ).
83 .PP
84 Palette image colormaps that appear to be incorrectly written as 8-bit values
85 are automatically scaled to 16-bits.
86 .PP
87 .I TIFFReadRGBAStrip
88 is just a wrapper around the more general
89 .IR TIFFRGBAImage (3TIFF)
90 facilities. It's main advantage over the similar
91 .IR TIFFReadRGBAImage()
92 function is that for large images a single buffer capable of holding the whole
93 image doesn't need to be allocated, only enough for one strip. The
94 .IR TIFFReadRGBATile()
95 function does a similar operation for tiled images.
96 .SH "RETURN VALUES"
97 1 is returned if the image was successfully read and converted.
98 Otherwise, 0 is returned if an error was encountered.
99 .SH DIAGNOSTICS
100 All error messages are directed to the
101 .IR TIFFError (3TIFF)
102 routine.
103 .PP
104 .BR "Sorry, can not handle %d-bit pictures" .
105 The image had
106 .I BitsPerSample
107 other than 1, 2, 4, 8, or 16.
108 .PP
109 .BR "Sorry, can not handle %d-channel images" .
110 The image had
111 .I SamplesPerPixel
112 other than 1, 3, or 4.
113 .PP
114 \fBMissing needed "PhotometricInterpretation" tag\fP.
115 The image did not have a tag that describes how to display the data.
116 .PP
117 \fBNo "PhotometricInterpretation" tag, assuming RGB\fP.
118 The image was missing a tag that describes how to display it, but because it
119 has 3 or 4 samples/pixel, it is assumed to be
120 .SM RGB.
121 .PP
122 \fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP. The image was
123 missing a tag that describes how to display it, but because it has 1
124 sample/pixel, it is assumed to be a grayscale or bilevel image.
125 .PP
126 .BR "No space for photometric conversion table" .
127 There was insufficient memory for a table used to convert image samples to
128 8-bit
129 .SM RGB.
130 .PP
131 \fBMissing required "Colormap" tag\fP.
132 A Palette image did not have a required
133 .I Colormap
134 tag.
135 .PP
136 .BR "No space for tile buffer" .
137 There was insufficient memory to allocate an i/o buffer.
138 .PP
139 .BR "No space for strip buffer" .
140 There was insufficient memory to allocate an i/o buffer.
141 .PP
142 .BR "Can not handle format" .
143 The image has a format (combination of
144 .IR BitsPerSample ,
145 .IR SamplesPerPixel ,
146 and
147 .IR PhotometricInterpretation )
148 that
149 .I TIFFReadRGBAImage
150 can not handle.
151 .PP
152 .BR "No space for B&W mapping table" .
153 There was insufficient memory to allocate a table used to map grayscale data
154 to
155 .SM RGB.
156 .PP
157 .BR "No space for Palette mapping table" .
158 There was insufficient memory to allocate a table used to map data to 8-bit
159 .SM RGB.
160 .SH "SEE ALSO"
161 .BR TIFFOpen (3TIFF),
162 .BR TIFFRGBAImage (3TIFF),
163 .BR TIFFReadRGBAImage (3TIFF),
164 .BR TIFFReadRGBATile (3TIFF),
165 .BR libtiff (3TIFF)
166 .PP
167 Libtiff library home page:
168 .BR http://www.remotesensing.org/libtiff/
169