TIFFReadRGBAStrip.3tiff.html 7.3 KB

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