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>TIFFReadRGBAImage
</title> 
  11 <h1 align=center
>TIFFReadRGBAImage
</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>TIFFReadRGBAImage, TIFFReadRGBAImageOriented 
− read
 
  30 and decode an image 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 TIFFReadRGBAImage(TIFF *
</b><i>tif
</i><b>,
 
  50 uint32
</b> <i>width
</i><b>, uint32
</b> <i>height
</i><b>,
 
  51 uint32 *
</b><i>raster
</i><b>, int
</b> 
  52 <i>stopOnError
</i><b>)
<br> 
  53 int TIFFReadRGBAImageOriented(TIFF *
</b><i>tif
</i><b>,
 
  54 uint32
</b> <i>width
</i><b>, uint32
</b> <i>height
</i><b>,
 
  55 uint32 *
</b><i>raster
</i><b>, int
</b> <i>orientation
</i><b>,
 
  56 int
</b> <i>stopOnError
</i><b>)
</b></p> 
  59 <a name=
"DESCRIPTION"></a> 
  62 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
  63        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
  64 <tr valign=
"top" align=
"left"> 
  67 <p><i>TIFFReadRGBAImage
</i> reads a strip- or tile-based
 
  68 image into memory, storing the result in the user supplied
 
  69 <i>raster
</i>. The raster is assumed to be an array of
 
  70 <i>width
</i> times 
<i>height
</i> 32-bit entries, where
 
  71 <i>width
</i> must be less than or equal to the width of the
 
  72 image (
<i>height
</i> may be any non-zero size). If the
 
  73 raster dimensions are smaller than the image, the image data
 
  74 is cropped to the raster bounds. If the raster height is
 
  75 greater than that of the image, then the image data are
 
  76 placed in the lower part of the raster. (Note that the
 
  77 raster is assume to be organized such that the pixel at
 
  78 location (
<i>x
</i>,
<i>y
</i>) is
 
  79 <i>raster
</i>[
<i>y
</i>*
<i>width
</i>+
<i>x
</i>]; with the
 
  80 raster origin in the lower-left hand corner.)
</p> 
  82 <p><i>TIFFReadRGBAImageOriented
</i> works like
 
  83 <i>TIFFReadRGBAImage
</i> with except of that user can
 
  84 specify the raster origin position with the
 
  85 <i>orientation
</i> parameter. Four orientations
 
  90 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
  91        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
  92 <tr valign=
"top" align=
"left"> 
  95 <p><b>ORIENTATION_TOPLEFT
</b></p></td> 
  98 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
  99        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 100 <tr valign=
"top" align=
"left"> 
 101 <td width=
"19%"></td> 
 103 <p>origin in top-left corner,
</p> 
 107 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 108        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 109 <tr valign=
"top" align=
"left"> 
 112 <p><b>ORIENTATION_TOPRIGHT
</b></p></td> 
 115 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 116        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 117 <tr valign=
"top" align=
"left"> 
 118 <td width=
"19%"></td> 
 120 <p>origin in top-right corner,
</p> 
 124 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 125        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 126 <tr valign=
"top" align=
"left"> 
 129 <p><b>ORIENTATION_BOTLEFT
</b></p></td> 
 132 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 133        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 134 <tr valign=
"top" align=
"left"> 
 135 <td width=
"19%"></td> 
 137 <p>origin in bottom-left corner and
</p> 
 141 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 142        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 143 <tr valign=
"top" align=
"left"> 
 146 <p><b>ORIENTATION_BOTRIGHT
</b></p></td> 
 149 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 150        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 151 <tr valign=
"top" align=
"left"> 
 152 <td width=
"19%"></td> 
 154 <p>origin in bottom-right corner.
</p> 
 158 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 159        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 160 <tr valign=
"top" align=
"left"> 
 163 <p>If you choose 
<b>ORIENTATION_BOTLEFT
</b> result will be
 
 164 the same as returned by the 
<i>TIFFReadRGBAImage.
</i></p> 
 166 <p>Raster pixels are 
8-bit packed red, green, blue, alpha
 
 167 samples. The macros 
<i>TIFFGetR
</i>, 
<i>TIFFGetG
</i>,
 
 168 <i>TIFFGetB
</i>, and 
<i>TIFFGetA
</i> should be used to
 
 169 access individual samples. Images without Associated Alpha
 
 170 matting information have a constant Alpha of 
1.0 (
255).
</p> 
 172 <p><i>TIFFReadRGBAImage
</i> converts non-
8-bit images by
 
 173 scaling sample values. Palette, grayscale, bilevel,
 
 174 <small>CMYK
</small> , and YCbCr images are converted to
 
 175 <small>RGB
</small> transparently. Raster pixels are returned
 
 176 uncorrected by any colorimetry information present in the
 
 179 <p>The paramater 
<i>stopOnError
</i> specifies how to act if
 
 180 an error is encountered while reading the image. If
 
 181 <i>stopOnError
</i> is non-zero, then an error will terminate
 
 182 the operation; otherwise 
<i>TIFFReadRGBAImage
</i> will
 
 183 continue processing data until all the possible data in the
 
 184 image have been requested.
</p> 
 190 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 191        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 192 <tr valign=
"top" align=
"left"> 
 195 <p>In C++ the 
<i>stopOnError
</i> parameter defaults to
 
 198 <p>Samples must be either 
1, 
2, 
4, 
8, or 
16 bits.
 
 199 Colorimetric samples/pixel must be either 
1, 
3, or 
4 (i.e.
 
 200 <i>SamplesPerPixel
</i> minus 
<i>ExtraSamples
</i>).
</p> 
 202 <p>Palettte image colormaps that appear to be incorrectly
 
 203 written as 
8-bit values are automatically scaled to
 
 206 <p><i>TIFFReadRGBAImage
</i> is just a wrapper around the
 
 207 more general 
<i>TIFFRGBAImage
</i>(
3TIFF) facilities.
</p> 
 210 <a name=
"RETURN VALUES"></a> 
 211 <h2>RETURN VALUES
</h2> 
 213 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 214        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 215 <tr valign=
"top" align=
"left"> 
 218 <p>1 is returned if the image was successfully read and
 
 219 converted. Otherwise, 
0 is returned if an error was
 
 220 encountered and 
<i>stopOnError
</i> is zero.
</p> 
 223 <a name=
"DIAGNOSTICS"></a> 
 226 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 227        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 228 <tr valign=
"top" align=
"left"> 
 231 <p>All error messages are directed to the
 
 232 <i>TIFFError
</i>(
3TIFF) routine.
</p> 
 234 <p><b>Sorry, can not handle %d-bit pictures
</b>. The image
 
 235 had 
<i>BitsPerSample
</i> other than 
1, 
2, 
4, 
8, or 
16.
</p> 
 237 <p><b>Sorry, can not handle %d-channel images
</b>. The image
 
 238 had 
<i>SamplesPerPixel
</i> other than 
1, 
3, or 
4.
</p> 
 240 <p><b>Missing needed 
"PhotometricInterpretation
" 
 241 tag
</b>. The image did not have a tag that describes how to
 
 242 display the data.
</p> 
 244 <p><b>No 
"PhotometricInterpretation
" tag, assuming
 
 245 RGB
</b>. The image was missing a tag that describes how to
 
 246 display it, but because it has 
3 or 
4 samples/pixel, it is
 
 247 assumed to be 
<small>RGB.
</small></p> 
 249 <p><b>No 
"PhotometricInterpretation
" tag, assuming
 
 250 min-is-black
</b>. The image was missing a tag that describes
 
 251 how to display it, but because it has 
1 sample/pixel, it is
 
 252 assumed to be a grayscale or bilevel image.
</p> 
 254 <p><b>No space for photometric conversion table
</b>. There
 
 255 was insufficient memory for a table used to convert image
 
 256 samples to 
8-bit 
<small>RGB.
</small></p> 
 258 <p><b>Missing required 
"Colormap
" tag
</b>. A
 
 259 Palette image did not have a required 
<i>Colormap
</i> 
 262 <p><b>No space for tile buffer
</b>. There was insufficient
 
 263 memory to allocate an i/o buffer.
</p> 
 265 <p><b>No space for strip buffer
</b>. There was insufficient
 
 266 memory to allocate an i/o buffer.
</p> 
 268 <p><b>Can not handle format
</b>. The image has a format
 
 269 (combination of 
<i>BitsPerSample
</i>,
 
 270 <i>SamplesPerPixel
</i>, and
 
 271 <i>PhotometricInterpretation
</i>) that
 
 272 <i>TIFFReadRGBAImage
</i> can not handle.
</p> 
 274 <p><b>No space for B
&W mapping table
</b>. There was
 
 275 insufficient memory to allocate a table used to map
 
 276 grayscale data to 
<small>RGB.
</small></p> 
 278 <p><b>No space for Palette mapping table
</b>. There was
 
 279 insufficient memory to allocate a table used to map data to
 
 280 8-bit 
<small>RGB.
</small></p> 
 283 <a name=
"SEE ALSO"></a> 
 286 <table width=
"100%" border=
0 rules=
"none" frame=
"void" 
 287        cols=
"2" cellspacing=
"0" cellpadding=
"0"> 
 288 <tr valign=
"top" align=
"left"> 
 291 <p><b>TIFFOpen
</b>(
3TIFF), 
<b>TIFFRGBAImage
</b>(
3TIFF),
 
 292 <b>TIFFReadRGBAStrip
</b>(
3TIFF),
 
 293 <b>TIFFReadRGBATile
</b>(
3TIFF), 
<b>libtiff
</b>(
3TIFF)
</p> 
 295 <p>Libtiff library home page:
 
 296 <b>http://www.remotesensing.org/libtiff/
</b></p>