]> git.saurik.com Git - wxWidgets.git/blob - src/tiff/man/TIFFReadRGBATile.3tiff
Don't document wxSortedArrayString as deriving from wxArrayString.
[wxWidgets.git] / src / tiff / man / TIFFReadRGBATile.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 TIFFReadRGBATile 3TIFF "December 10, 1998" "libtiff"
26 .SH NAME
27 TIFFReadRGBATile \- read and decode an image tile 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 TIFFReadRGBATile(TIFF *" tif ", uint32 " x ", uint32 " y ", uint32 *" raster ")"
40 .SH DESCRIPTION
41 .IR TIFFReadRGBATile
42 reads a single tile of a tile-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 length 32-bit entries,
46 where width is the width of a tile (TIFFTAG_TILEWIDTH) and length is the
47 height of a tile (TIFFTAG_TILELENGTH).
48
49 .PP
50 The
51 .IR x
52 and
53 .IR y
54 values are the offsets from the top left corner to the top left corner of the
55 tile to be read. They must be an exact multiple of the tile width and length.
56
57 .PP
58 Note that the raster is assume to be organized such that the pixel at location
59 (\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP]; with the
60 raster origin in the
61 .I lower-left hand corner
62 of the tile. That is bottom to top organization. Edge tiles which partly fall
63 off the image will be filled out with appropriate zeroed areas.
64
65 .PP
66 Raster pixels are 8-bit packed red, green, blue, alpha samples. The macros
67 .IR TIFFGetR ,
68 .IR TIFFGetG ,
69 .IR TIFFGetB ,
70 and
71 .I TIFFGetA
72 should be used to access individual samples. Images without Associated Alpha
73 matting information have a constant Alpha of 1.0 (255).
74 .PP
75 See the
76 .IR TIFFRGBAImage (3TIFF)
77 page for more details on how various image types are converted to RGBA values.
78 .SH NOTES
79 Samples must be either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel must
80 be either 1, 3, or 4 (i.e.
81 .I SamplesPerPixel
82 minus
83 .IR ExtraSamples ).
84 .PP
85 Palette image colormaps that appear to be incorrectly written as 8-bit values
86 are automatically scaled to 16-bits.
87 .PP
88 .I TIFFReadRGBATile
89 is just a wrapper around the more general
90 .IR TIFFRGBAImage (3TIFF)
91 facilities. It's main advantage over the similar
92 .IR TIFFReadRGBAImage()
93 function is that for large images a single buffer capable of holding the whole
94 image doesn't need to be allocated, only enough for one tile. The
95 .IR TIFFReadRGBAStrip()
96 function does a similar operation for stripped images.
97 .SH "RETURN VALUES"
98 1 is returned if the image was successfully read and converted.
99 Otherwise, 0 is returned if an error was encountered.
100 .SH DIAGNOSTICS
101 All error messages are directed to the
102 .IR TIFFError (3TIFF)
103 routine.
104 .PP
105 .BR "Sorry, can not handle %d-bit pictures" .
106 The image had
107 .I BitsPerSample
108 other than 1, 2, 4, 8, or 16.
109 .PP
110 .BR "Sorry, can not handle %d-channel images" .
111 The image had
112 .I SamplesPerPixel
113 other than 1, 3, or 4.
114 .PP
115 \fBMissing needed "PhotometricInterpretation" tag\fP.
116 The image did not have a tag that describes how to display the data.
117 .PP
118 \fBNo "PhotometricInterpretation" tag, assuming RGB\fP.
119 The image was missing a tag that describes how to display it, but because it
120 has 3 or 4 samples/pixel, it is assumed to be
121 .SM RGB.
122 .PP
123 \fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP.
124 The image was missing a tag that describes how to display it,
125 but because it has 1 sample/pixel, it is assumed to be a grayscale
126 or bilevel image.
127 .PP
128 .BR "No space for photometric conversion table" .
129 There was insufficient memory for a table used to convert
130 image samples to 8-bit
131 .SM RGB.
132 .PP
133 \fBMissing required "Colormap" tag\fP.
134 A Palette image did not have a required
135 .I Colormap
136 tag.
137 .PP
138 .BR "No space for tile buffer" .
139 There was insufficient memory to allocate an i/o buffer.
140 .PP
141 .BR "No space for strip buffer" .
142 There was insufficient memory to allocate an i/o buffer.
143 .PP
144 .BR "Can not handle format" .
145 The image has a format (combination of
146 .IR BitsPerSample ,
147 .IR SamplesPerPixel ,
148 and
149 .IR PhotometricInterpretation )
150 that
151 .I TIFFReadRGBAImage
152 can not handle.
153 .PP
154 .BR "No space for B&W mapping table" .
155 There was insufficient memory to allocate a table used to map
156 grayscale data to
157 .SM RGB.
158 .PP
159 .BR "No space for Palette mapping table" .
160 There was insufficient memory to allocate a table used to map data to 8-bit
161 .SM RGB.
162 .SH "SEE ALSO"
163 .BR TIFFOpen (3TIFF),
164 .BR TIFFRGBAImage (3TIFF),
165 .BR TIFFReadRGBAImage (3TIFF),
166 .BR TIFFReadRGBAStrip (3TIFF),
167 .BR libtiff (3TIFF)
168 .PP
169 Libtiff library home page:
170 .BR http://www.remotesensing.org/libtiff/