2
0

TIFFReadRGBAImage.3tiff.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <!-- Creator : groff version 1.18.1 -->
  2. <!-- CreationDate: Sat Feb 24 18:37:17 2007 -->
  3. <html>
  4. <head>
  5. <meta name="generator" content="groff -Thtml, see www.gnu.org">
  6. <meta name="Content-Style" content="text/css">
  7. <title>TIFFReadRGBAImage</title>
  8. </head>
  9. <body>
  10. <h1 align=center>TIFFReadRGBAImage</h1>
  11. <a href="#NAME">NAME</a><br>
  12. <a href="#SYNOPSIS">SYNOPSIS</a><br>
  13. <a href="#DESCRIPTION">DESCRIPTION</a><br>
  14. <a href="#NOTES">NOTES</a><br>
  15. <a href="#RETURN VALUES">RETURN VALUES</a><br>
  16. <a href="#DIAGNOSTICS">DIAGNOSTICS</a><br>
  17. <a href="#SEE ALSO">SEE ALSO</a><br>
  18. <hr>
  19. <a name="NAME"></a>
  20. <h2>NAME</h2>
  21. <!-- INDENTATION -->
  22. <table width="100%" border=0 rules="none" frame="void"
  23. cols="2" cellspacing="0" cellpadding="0">
  24. <tr valign="top" align="left">
  25. <td width="8%"></td>
  26. <td width="91%">
  27. <p>TIFFReadRGBAImage, TIFFReadRGBAImageOriented &minus; read
  28. and decode an image into a fixed-format raster</p>
  29. </td>
  30. </table>
  31. <a name="SYNOPSIS"></a>
  32. <h2>SYNOPSIS</h2>
  33. <!-- INDENTATION -->
  34. <table width="100%" border=0 rules="none" frame="void"
  35. cols="2" cellspacing="0" cellpadding="0">
  36. <tr valign="top" align="left">
  37. <td width="8%"></td>
  38. <td width="91%">
  39. <p><b>#include &lt;tiffio.h&gt;</b></p>
  40. <!-- INDENTATION -->
  41. <p><b>#define TIFFGetR(abgr) ((abgr) &amp; 0xff)<br>
  42. #define TIFFGetG(abgr) (((abgr) &gt;&gt; 8) &amp; 0xff)<br>
  43. #define TIFFGetB(abgr) (((abgr) &gt;&gt; 16) &amp; 0xff)<br>
  44. #define TIFFGetA(abgr) (((abgr) &gt;&gt; 24) &amp;
  45. 0xff)</b></p>
  46. <!-- INDENTATION -->
  47. <p><b>int TIFFReadRGBAImage(TIFF *</b><i>tif</i><b>,
  48. uint32</b> <i>width</i><b>, uint32</b> <i>height</i><b>,
  49. uint32 *</b><i>raster</i><b>, int</b>
  50. <i>stopOnError</i><b>)<br>
  51. int TIFFReadRGBAImageOriented(TIFF *</b><i>tif</i><b>,
  52. uint32</b> <i>width</i><b>, uint32</b> <i>height</i><b>,
  53. uint32 *</b><i>raster</i><b>, int</b> <i>orientation</i><b>,
  54. int</b> <i>stopOnError</i><b>)</b></p>
  55. </td>
  56. </table>
  57. <a name="DESCRIPTION"></a>
  58. <h2>DESCRIPTION</h2>
  59. <!-- INDENTATION -->
  60. <table width="100%" border=0 rules="none" frame="void"
  61. cols="2" cellspacing="0" cellpadding="0">
  62. <tr valign="top" align="left">
  63. <td width="8%"></td>
  64. <td width="91%">
  65. <p><i>TIFFReadRGBAImage</i> reads a strip- or tile-based
  66. image into memory, storing the result in the user supplied
  67. <i>raster</i>. The raster is assumed to be an array of
  68. <i>width</i> times <i>height</i> 32-bit entries, where
  69. <i>width</i> must be less than or equal to the width of the
  70. image (<i>height</i> may be any non-zero size). If the
  71. raster dimensions are smaller than the image, the image data
  72. is cropped to the raster bounds. If the raster height is
  73. greater than that of the image, then the image data are
  74. placed in the lower part of the raster. (Note that the
  75. raster is assume to be organized such that the pixel at
  76. location (<i>x</i>,<i>y</i>) is
  77. <i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the
  78. raster origin in the lower-left hand corner.)</p>
  79. <!-- INDENTATION -->
  80. <p><i>TIFFReadRGBAImageOriented</i> works like
  81. <i>TIFFReadRGBAImage</i> with except of that user can
  82. specify the raster origin position with the
  83. <i>orientation</i> parameter. Four orientations
  84. supported:</p>
  85. </td>
  86. </table>
  87. <!-- INDENTATION -->
  88. <table width="100%" border=0 rules="none" frame="void"
  89. cols="2" cellspacing="0" cellpadding="0">
  90. <tr valign="top" align="left">
  91. <td width="8%"></td>
  92. <td width="91%">
  93. <p><b>ORIENTATION_TOPLEFT</b></p></td>
  94. </table>
  95. <!-- INDENTATION -->
  96. <table width="100%" border=0 rules="none" frame="void"
  97. cols="2" cellspacing="0" cellpadding="0">
  98. <tr valign="top" align="left">
  99. <td width="19%"></td>
  100. <td width="80%">
  101. <p>origin in top-left corner,</p>
  102. </td>
  103. </table>
  104. <!-- INDENTATION -->
  105. <table width="100%" border=0 rules="none" frame="void"
  106. cols="2" cellspacing="0" cellpadding="0">
  107. <tr valign="top" align="left">
  108. <td width="8%"></td>
  109. <td width="91%">
  110. <p><b>ORIENTATION_TOPRIGHT</b></p></td>
  111. </table>
  112. <!-- INDENTATION -->
  113. <table width="100%" border=0 rules="none" frame="void"
  114. cols="2" cellspacing="0" cellpadding="0">
  115. <tr valign="top" align="left">
  116. <td width="19%"></td>
  117. <td width="80%">
  118. <p>origin in top-right corner,</p>
  119. </td>
  120. </table>
  121. <!-- INDENTATION -->
  122. <table width="100%" border=0 rules="none" frame="void"
  123. cols="2" cellspacing="0" cellpadding="0">
  124. <tr valign="top" align="left">
  125. <td width="8%"></td>
  126. <td width="91%">
  127. <p><b>ORIENTATION_BOTLEFT</b></p></td>
  128. </table>
  129. <!-- INDENTATION -->
  130. <table width="100%" border=0 rules="none" frame="void"
  131. cols="2" cellspacing="0" cellpadding="0">
  132. <tr valign="top" align="left">
  133. <td width="19%"></td>
  134. <td width="80%">
  135. <p>origin in bottom-left corner and</p>
  136. </td>
  137. </table>
  138. <!-- INDENTATION -->
  139. <table width="100%" border=0 rules="none" frame="void"
  140. cols="2" cellspacing="0" cellpadding="0">
  141. <tr valign="top" align="left">
  142. <td width="8%"></td>
  143. <td width="91%">
  144. <p><b>ORIENTATION_BOTRIGHT</b></p></td>
  145. </table>
  146. <!-- INDENTATION -->
  147. <table width="100%" border=0 rules="none" frame="void"
  148. cols="2" cellspacing="0" cellpadding="0">
  149. <tr valign="top" align="left">
  150. <td width="19%"></td>
  151. <td width="80%">
  152. <p>origin in bottom-right corner.</p>
  153. </td>
  154. </table>
  155. <!-- INDENTATION -->
  156. <table width="100%" border=0 rules="none" frame="void"
  157. cols="2" cellspacing="0" cellpadding="0">
  158. <tr valign="top" align="left">
  159. <td width="8%"></td>
  160. <td width="91%">
  161. <p>If you choose <b>ORIENTATION_BOTLEFT</b> result will be
  162. the same as returned by the <i>TIFFReadRGBAImage.</i></p>
  163. <!-- INDENTATION -->
  164. <p>Raster pixels are 8-bit packed red, green, blue, alpha
  165. samples. The macros <i>TIFFGetR</i>, <i>TIFFGetG</i>,
  166. <i>TIFFGetB</i>, and <i>TIFFGetA</i> should be used to
  167. access individual samples. Images without Associated Alpha
  168. matting information have a constant Alpha of 1.0 (255).</p>
  169. <!-- INDENTATION -->
  170. <p><i>TIFFReadRGBAImage</i> converts non-8-bit images by
  171. scaling sample values. Palette, grayscale, bilevel,
  172. <small>CMYK</small> , and YCbCr images are converted to
  173. <small>RGB</small> transparently. Raster pixels are returned
  174. uncorrected by any colorimetry information present in the
  175. directory.</p>
  176. <!-- INDENTATION -->
  177. <p>The paramater <i>stopOnError</i> specifies how to act if
  178. an error is encountered while reading the image. If
  179. <i>stopOnError</i> is non-zero, then an error will terminate
  180. the operation; otherwise <i>TIFFReadRGBAImage</i> will
  181. continue processing data until all the possible data in the
  182. image have been requested.</p>
  183. </td>
  184. </table>
  185. <a name="NOTES"></a>
  186. <h2>NOTES</h2>
  187. <!-- INDENTATION -->
  188. <table width="100%" border=0 rules="none" frame="void"
  189. cols="2" cellspacing="0" cellpadding="0">
  190. <tr valign="top" align="left">
  191. <td width="8%"></td>
  192. <td width="91%">
  193. <p>In C++ the <i>stopOnError</i> parameter defaults to
  194. 0.</p>
  195. <!-- INDENTATION -->
  196. <p>Samples must be either 1, 2, 4, 8, or 16 bits.
  197. Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
  198. <i>SamplesPerPixel</i> minus <i>ExtraSamples</i>).</p>
  199. <!-- INDENTATION -->
  200. <p>Palettte image colormaps that appear to be incorrectly
  201. written as 8-bit values are automatically scaled to
  202. 16-bits.</p>
  203. <!-- INDENTATION -->
  204. <p><i>TIFFReadRGBAImage</i> is just a wrapper around the
  205. more general <i>TIFFRGBAImage</i>(3TIFF) facilities.</p>
  206. </td>
  207. </table>
  208. <a name="RETURN VALUES"></a>
  209. <h2>RETURN VALUES</h2>
  210. <!-- INDENTATION -->
  211. <table width="100%" border=0 rules="none" frame="void"
  212. cols="2" cellspacing="0" cellpadding="0">
  213. <tr valign="top" align="left">
  214. <td width="8%"></td>
  215. <td width="91%">
  216. <p>1 is returned if the image was successfully read and
  217. converted. Otherwise, 0 is returned if an error was
  218. encountered and <i>stopOnError</i> is zero.</p>
  219. </td>
  220. </table>
  221. <a name="DIAGNOSTICS"></a>
  222. <h2>DIAGNOSTICS</h2>
  223. <!-- INDENTATION -->
  224. <table width="100%" border=0 rules="none" frame="void"
  225. cols="2" cellspacing="0" cellpadding="0">
  226. <tr valign="top" align="left">
  227. <td width="8%"></td>
  228. <td width="91%">
  229. <p>All error messages are directed to the
  230. <i>TIFFError</i>(3TIFF) routine.</p>
  231. <!-- INDENTATION -->
  232. <p><b>Sorry, can not handle %d-bit pictures</b>. The image
  233. had <i>BitsPerSample</i> other than 1, 2, 4, 8, or 16.</p>
  234. <!-- INDENTATION -->
  235. <p><b>Sorry, can not handle %d-channel images</b>. The image
  236. had <i>SamplesPerPixel</i> other than 1, 3, or 4.</p>
  237. <!-- INDENTATION -->
  238. <p><b>Missing needed &quot;PhotometricInterpretation&quot;
  239. tag</b>. The image did not have a tag that describes how to
  240. display the data.</p>
  241. <!-- INDENTATION -->
  242. <p><b>No &quot;PhotometricInterpretation&quot; tag, assuming
  243. RGB</b>. The image was missing a tag that describes how to
  244. display it, but because it has 3 or 4 samples/pixel, it is
  245. assumed to be <small>RGB.</small></p>
  246. <!-- INDENTATION -->
  247. <p><b>No &quot;PhotometricInterpretation&quot; tag, assuming
  248. min-is-black</b>. The image was missing a tag that describes
  249. how to display it, but because it has 1 sample/pixel, it is
  250. assumed to be a grayscale or bilevel image.</p>
  251. <!-- INDENTATION -->
  252. <p><b>No space for photometric conversion table</b>. There
  253. was insufficient memory for a table used to convert image
  254. samples to 8-bit <small>RGB.</small></p>
  255. <!-- INDENTATION -->
  256. <p><b>Missing required &quot;Colormap&quot; tag</b>. A
  257. Palette image did not have a required <i>Colormap</i>
  258. tag.</p>
  259. <!-- INDENTATION -->
  260. <p><b>No space for tile buffer</b>. There was insufficient
  261. memory to allocate an i/o buffer.</p>
  262. <!-- INDENTATION -->
  263. <p><b>No space for strip buffer</b>. There was insufficient
  264. memory to allocate an i/o buffer.</p>
  265. <!-- INDENTATION -->
  266. <p><b>Can not handle format</b>. The image has a format
  267. (combination of <i>BitsPerSample</i>,
  268. <i>SamplesPerPixel</i>, and
  269. <i>PhotometricInterpretation</i>) that
  270. <i>TIFFReadRGBAImage</i> can not handle.</p>
  271. <!-- INDENTATION -->
  272. <p><b>No space for B&amp;W mapping table</b>. There was
  273. insufficient memory to allocate a table used to map
  274. grayscale data to <small>RGB.</small></p>
  275. <!-- INDENTATION -->
  276. <p><b>No space for Palette mapping table</b>. There was
  277. insufficient memory to allocate a table used to map data to
  278. 8-bit <small>RGB.</small></p>
  279. </td>
  280. </table>
  281. <a name="SEE ALSO"></a>
  282. <h2>SEE ALSO</h2>
  283. <!-- INDENTATION -->
  284. <table width="100%" border=0 rules="none" frame="void"
  285. cols="2" cellspacing="0" cellpadding="0">
  286. <tr valign="top" align="left">
  287. <td width="8%"></td>
  288. <td width="91%">
  289. <p><b>TIFFOpen</b>(3TIFF), <b>TIFFRGBAImage</b>(3TIFF),
  290. <b>TIFFReadRGBAStrip</b>(3TIFF),
  291. <b>TIFFReadRGBATile</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
  292. <!-- INDENTATION -->
  293. <p>Libtiff library home page:
  294. <b>http://www.remotesensing.org/libtiff/</b></p>
  295. </td>
  296. </table>
  297. <hr>
  298. </body>
  299. </html>