TIFFReadRGBATile.3tiff.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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>TIFFReadRGBATile</title>
  8. </head>
  9. <body>
  10. <h1 align=center>TIFFReadRGBATile</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>TIFFReadRGBATile &minus; read and decode an image tile
  28. 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. </td>
  41. </table>
  42. <!-- TABS -->
  43. <table width="100%" border=0 rules="none" frame="void"
  44. cols="5" cellspacing="0" cellpadding="0">
  45. <tr valign="top" align="left">
  46. <td width="8%"></td>
  47. <td width="-2%">
  48. <p><b>#define TIFFGetR(abgr)</b></p>
  49. </td>
  50. <td width="25%"></td>
  51. <td width="6%"></td>
  52. <td width="61%">
  53. <p><b>((abgr) &amp; 0xff)</b></p>
  54. </td>
  55. <tr valign="top" align="left">
  56. <td width="8%"></td>
  57. <td width="-2%">
  58. <p><b>#define TIFFGetG(abgr)</b></p>
  59. </td>
  60. <td width="25%"></td>
  61. <td width="6%"></td>
  62. <td width="61%">
  63. <p><b>(((abgr) &gt;&gt; 8) &amp; 0xff)</b></p>
  64. </td>
  65. <tr valign="top" align="left">
  66. <td width="8%"></td>
  67. <td width="-2%">
  68. <p><b>#define TIFFGetB(abgr)</b></p>
  69. </td>
  70. <td width="25%"></td>
  71. <td width="6%"></td>
  72. <td width="61%">
  73. <p><b>(((abgr) &gt;&gt; 16) &amp; 0xff)</b></p>
  74. </td>
  75. <tr valign="top" align="left">
  76. <td width="8%"></td>
  77. <td width="-2%">
  78. <p><b>#define TIFFGetA(abgr)</b></p>
  79. </td>
  80. <td width="25%"></td>
  81. <td width="6%"></td>
  82. <td width="61%">
  83. <p><b>(((abgr) &gt;&gt; 24) &amp; 0xff)</b></p>
  84. </td>
  85. </table>
  86. <!-- INDENTATION -->
  87. <table width="100%" border=0 rules="none" frame="void"
  88. cols="2" cellspacing="0" cellpadding="0">
  89. <tr valign="top" align="left">
  90. <td width="8%"></td>
  91. <td width="91%">
  92. <p><b>int TIFFReadRGBATile(TIFF *</b><i>tif</i><b>,
  93. uint32_t</b> <i>x</i><b>, uint32_t</b> <i>y</i><b>, uint32_t
  94. *</b><i>raster</i><b>)</b></p>
  95. </td>
  96. </table>
  97. <a name="DESCRIPTION"></a>
  98. <h2>DESCRIPTION</h2>
  99. <!-- INDENTATION -->
  100. <table width="100%" border=0 rules="none" frame="void"
  101. cols="2" cellspacing="0" cellpadding="0">
  102. <tr valign="top" align="left">
  103. <td width="8%"></td>
  104. <td width="91%">
  105. <p><i>TIFFReadRGBATile</i> reads a single tile of a
  106. tile-based image into memory, storing the result in the user
  107. supplied RGBA <i>raster</i>. The raster is assumed to be an
  108. array of width times length 32-bit entries, where width is
  109. the width of a tile (TIFFTAG_TILEWIDTH) and length is the
  110. height of a tile (TIFFTAG_TILELENGTH).</p>
  111. <!-- INDENTATION -->
  112. <p>The <i>x</i> and <i>y</i> values are the offsets from the
  113. top left corner to the top left corner of the tile to be
  114. read. They must be an exact multiple of the tile width and
  115. length.</p>
  116. <!-- INDENTATION -->
  117. <p>Note that the raster is assume to be organized such that
  118. the pixel at location (<i>x</i>,<i>y</i>) is
  119. <i>raster</i>[<i>y</i>*<i>width</i>+<i>x</i>]; with the
  120. raster origin in the <i>lower-left hand corner</i> of the
  121. tile. That is bottom to top organization. Edge tiles which
  122. partly fall off the image will be filled out with
  123. appropriate zeroed areas.</p>
  124. <!-- INDENTATION -->
  125. <p>Raster pixels are 8-bit packed red, green, blue, alpha
  126. samples. The macros <i>TIFFGetR</i>, <i>TIFFGetG</i>,
  127. <i>TIFFGetB</i>, and <i>TIFFGetA</i> should be used to
  128. access individual samples. Images without Associated Alpha
  129. matting information have a constant Alpha of 1.0 (255).</p>
  130. <!-- INDENTATION -->
  131. <p>See the <i>TIFFRGBAImage</i>(3TIFF) page for more details
  132. on how various image types are converted to RGBA values.</p>
  133. </td>
  134. </table>
  135. <a name="NOTES"></a>
  136. <h2>NOTES</h2>
  137. <!-- INDENTATION -->
  138. <table width="100%" border=0 rules="none" frame="void"
  139. cols="2" cellspacing="0" cellpadding="0">
  140. <tr valign="top" align="left">
  141. <td width="8%"></td>
  142. <td width="91%">
  143. <p>Samples must be either 1, 2, 4, 8, or 16 bits.
  144. Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
  145. <i>SamplesPerPixel</i> minus <i>ExtraSamples</i>).</p>
  146. <!-- INDENTATION -->
  147. <p>Palette image colormaps that appear to be incorrectly
  148. written as 8-bit values are automatically scaled to
  149. 16-bits.</p>
  150. <!-- INDENTATION -->
  151. <p><i>TIFFReadRGBATile</i> is just a wrapper around the more
  152. general <i>TIFFRGBAImage</i>(3TIFF) facilities. It&rsquo;s
  153. main advantage over the similar <i>TIFFReadRGBAImage()</i>
  154. function is that for large images a single buffer capable of
  155. holding the whole image doesn&rsquo;t need to be allocated,
  156. only enough for one tile. The <i>TIFFReadRGBAStrip()</i>
  157. function does a similar operation for stripped images.</p>
  158. </td>
  159. </table>
  160. <a name="RETURN VALUES"></a>
  161. <h2>RETURN VALUES</h2>
  162. <!-- INDENTATION -->
  163. <table width="100%" border=0 rules="none" frame="void"
  164. cols="2" cellspacing="0" cellpadding="0">
  165. <tr valign="top" align="left">
  166. <td width="8%"></td>
  167. <td width="91%">
  168. <p>1 is returned if the image was successfully read and
  169. converted. Otherwise, 0 is returned if an error was
  170. encountered.</p>
  171. </td>
  172. </table>
  173. <a name="DIAGNOSTICS"></a>
  174. <h2>DIAGNOSTICS</h2>
  175. <!-- INDENTATION -->
  176. <table width="100%" border=0 rules="none" frame="void"
  177. cols="2" cellspacing="0" cellpadding="0">
  178. <tr valign="top" align="left">
  179. <td width="8%"></td>
  180. <td width="91%">
  181. <p>All error messages are directed to the
  182. <i>TIFFError</i>(3TIFF) routine.</p>
  183. <!-- INDENTATION -->
  184. <p><b>Sorry, can not handle %d-bit pictures</b>. The image
  185. had <i>BitsPerSample</i> other than 1, 2, 4, 8, or 16.</p>
  186. <!-- INDENTATION -->
  187. <p><b>Sorry, can not handle %d-channel images</b>. The image
  188. had <i>SamplesPerPixel</i> other than 1, 3, or 4.</p>
  189. <!-- INDENTATION -->
  190. <p><b>Missing needed &quot;PhotometricInterpretation&quot;
  191. tag</b>. The image did not have a tag that describes how to
  192. display the data.</p>
  193. <!-- INDENTATION -->
  194. <p><b>No &quot;PhotometricInterpretation&quot; tag, assuming
  195. RGB</b>. The image was missing a tag that describes how to
  196. display it, but because it has 3 or 4 samples/pixel, it is
  197. assumed to be <small>RGB.</small></p>
  198. <!-- INDENTATION -->
  199. <p><b>No &quot;PhotometricInterpretation&quot; tag, assuming
  200. min-is-black</b>. The image was missing a tag that describes
  201. how to display it, but because it has 1 sample/pixel, it is
  202. assumed to be a grayscale or bilevel image.</p>
  203. <!-- INDENTATION -->
  204. <p><b>No space for photometric conversion table</b>. There
  205. was insufficient memory for a table used to convert image
  206. samples to 8-bit <small>RGB.</small></p>
  207. <!-- INDENTATION -->
  208. <p><b>Missing required &quot;Colormap&quot; tag</b>. A
  209. Palette image did not have a required <i>Colormap</i>
  210. tag.</p>
  211. <!-- INDENTATION -->
  212. <p><b>No space for tile buffer</b>. There was insufficient
  213. memory to allocate an i/o buffer.</p>
  214. <!-- INDENTATION -->
  215. <p><b>No space for strip buffer</b>. There was insufficient
  216. memory to allocate an i/o buffer.</p>
  217. <!-- INDENTATION -->
  218. <p><b>Can not handle format</b>. The image has a format
  219. (combination of <i>BitsPerSample</i>,
  220. <i>SamplesPerPixel</i>, and
  221. <i>PhotometricInterpretation</i>) that
  222. <i>TIFFReadRGBAImage</i> can not handle.</p>
  223. <!-- INDENTATION -->
  224. <p><b>No space for B&amp;W mapping table</b>. There was
  225. insufficient memory to allocate a table used to map
  226. grayscale data to <small>RGB.</small></p>
  227. <!-- INDENTATION -->
  228. <p><b>No space for Palette mapping table</b>. There was
  229. insufficient memory to allocate a table used to map data to
  230. 8-bit <small>RGB.</small></p>
  231. </td>
  232. </table>
  233. <a name="SEE ALSO"></a>
  234. <h2>SEE ALSO</h2>
  235. <!-- INDENTATION -->
  236. <table width="100%" border=0 rules="none" frame="void"
  237. cols="2" cellspacing="0" cellpadding="0">
  238. <tr valign="top" align="left">
  239. <td width="8%"></td>
  240. <td width="91%">
  241. <p><b>TIFFOpen</b>(3TIFF), <b>TIFFRGBAImage</b>(3TIFF),
  242. <b>TIFFReadRGBAImage</b>(3TIFF),
  243. <b>TIFFReadRGBAStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
  244. <!-- INDENTATION -->
  245. <p>Libtiff library home page:
  246. <b>http://www.simplesystems.org/libtiff/</b></p>
  247. </td>
  248. </table>
  249. <hr>
  250. </body>
  251. </html>