TIFFWriteScanline.3tiff.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!-- Creator : groff version 1.18.1 -->
  2. <!-- CreationDate: Sat Feb 24 18:37:18 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>TIFFWriteScanline</title>
  8. </head>
  9. <body>
  10. <h1 align=center>TIFFWriteScanline</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="#BUGS">BUGS</a><br>
  18. <a href="#SEE ALSO">SEE ALSO</a><br>
  19. <hr>
  20. <a name="NAME"></a>
  21. <h2>NAME</h2>
  22. <!-- INDENTATION -->
  23. <table width="100%" border=0 rules="none" frame="void"
  24. cols="2" cellspacing="0" cellpadding="0">
  25. <tr valign="top" align="left">
  26. <td width="8%"></td>
  27. <td width="91%">
  28. <p>TIFFWriteScanline &minus; write a scanline to an open
  29. <small>TIFF</small> file</p>
  30. </td>
  31. </table>
  32. <a name="SYNOPSIS"></a>
  33. <h2>SYNOPSIS</h2>
  34. <!-- INDENTATION -->
  35. <table width="100%" border=0 rules="none" frame="void"
  36. cols="2" cellspacing="0" cellpadding="0">
  37. <tr valign="top" align="left">
  38. <td width="8%"></td>
  39. <td width="91%">
  40. <p><b>#include &lt;tiffio.h&gt;</b></p>
  41. <!-- INDENTATION -->
  42. <p><b>int TIFFWriteScanline(TIFF *</b><i>tif</i><b>,
  43. tdata_t</b> <i>buf</i><b>, uint32_t</b> <i>row</i><b>,
  44. tsample_t</b> <i>sample</i><b>)</b></p>
  45. </td>
  46. </table>
  47. <a name="DESCRIPTION"></a>
  48. <h2>DESCRIPTION</h2>
  49. <!-- INDENTATION -->
  50. <table width="100%" border=0 rules="none" frame="void"
  51. cols="2" cellspacing="0" cellpadding="0">
  52. <tr valign="top" align="left">
  53. <td width="8%"></td>
  54. <td width="91%">
  55. <p>Write data to a file at the specified row. The
  56. <i>sample</i> parameter is used only if data are organized
  57. in separate planes (<i>PlanarConfiguration</i>=2). The data
  58. are assumed to be uncompressed and in the native bit- and
  59. byte-order of the host machine. The data written to the file
  60. is compressed according to the compression scheme of the
  61. current <small>TIFF</small> directory (see further below).
  62. If the current scanline is past the end of the current
  63. subfile, the <i>ImageLength</i> field is automatically
  64. increased to include the scanline (except for
  65. <i>PlanarConfiguration</i>=2, where the <i>ImageLength</i>
  66. cannot be changed once the first data are written). If the
  67. <i>ImageLength</i> is increased, the <i>StripOffsets</i> and
  68. <i>StripByteCounts</i> fields are similarly enlarged to
  69. reflect data written past the previous end of image.</p>
  70. </td>
  71. </table>
  72. <a name="NOTES"></a>
  73. <h2>NOTES</h2>
  74. <!-- INDENTATION -->
  75. <table width="100%" border=0 rules="none" frame="void"
  76. cols="2" cellspacing="0" cellpadding="0">
  77. <tr valign="top" align="left">
  78. <td width="8%"></td>
  79. <td width="91%">
  80. <p>The library writes encoded data using the native machine
  81. byte order. Correctly implemented <small>TIFF</small>
  82. readers are expected to do any necessary byte-swapping to
  83. correctly process image data with BitsPerSample greater than
  84. 8. The library attempts to hide bit-ordering differences
  85. between the image and the native machine by converting data
  86. from the native machine order.</p>
  87. <!-- INDENTATION -->
  88. <p>In C++ the <i>sample</i> parameter defaults to 0.</p>
  89. <!-- INDENTATION -->
  90. <p>Once data are written to a file for the current
  91. directory, the values of certain tags may not be altered;
  92. see <i>TIFFSetField</i>(3TIFF) for more information.</p>
  93. <!-- INDENTATION -->
  94. <p>It is not possible to write scanlines to a file that uses
  95. a tiled organization. The routine <i>TIFFIsTiled</i> can be
  96. used to determine if the file is organized as tiles or
  97. strips.</p>
  98. </td>
  99. </table>
  100. <a name="RETURN VALUES"></a>
  101. <h2>RETURN VALUES</h2>
  102. <!-- INDENTATION -->
  103. <table width="100%" border=0 rules="none" frame="void"
  104. cols="2" cellspacing="0" cellpadding="0">
  105. <tr valign="top" align="left">
  106. <td width="8%"></td>
  107. <td width="91%">
  108. <p><i>TIFFWriteScanline</i> returns &minus;1 if it
  109. immediately detects an error and 1 for a successful
  110. write.</p>
  111. </td>
  112. </table>
  113. <a name="DIAGNOSTICS"></a>
  114. <h2>DIAGNOSTICS</h2>
  115. <!-- INDENTATION -->
  116. <table width="100%" border=0 rules="none" frame="void"
  117. cols="2" cellspacing="0" cellpadding="0">
  118. <tr valign="top" align="left">
  119. <td width="8%"></td>
  120. <td width="91%">
  121. <p>All error messages are directed to the
  122. <i>TIFFError</i>(3TIFF) routine.</p>
  123. <!-- INDENTATION -->
  124. <p><b>%s: File not open for writing .</b> The file was
  125. opened for reading, not writing.</p>
  126. <!-- INDENTATION -->
  127. <p><b>Can not write scanlines to a tiled image</b>. An
  128. attempt was made to write a scanline to a tiled image. The
  129. image is assumed to be organized in tiles because the
  130. <i>TileWidth</i> and <i>TileLength</i> tags have been set
  131. with <i>TIFFSetField</i>(3TIFF).</p>
  132. <!-- INDENTATION -->
  133. <p><b>Compression algorithm does not support random
  134. access</b>. Data was written in a non-sequential order to a
  135. file that uses a compression algorithm and that has
  136. <i>RowsPerStrip</i> greater than one. That is, data in the
  137. image is to be stored in a compressed form, and with
  138. multiple rows packed into a strip. In this case, the library
  139. does not support random access to the data. The data should
  140. either be written as entire strips, sequentially by rows, or
  141. the value of <i>RowsPerStrip</i> should be set to one.</p>
  142. <!-- INDENTATION -->
  143. <p><b>%s: Must set &quot;ImageWidth&quot; before writing
  144. data</b>. The image&rsquo;s width has not be set before the
  145. first write. See <b>TIFFSetField</b>(3TIFF) for information
  146. on how to do this.</p>
  147. <!-- INDENTATION -->
  148. <p><b>%s: Must set &quot;PlanarConfiguration&quot; before
  149. writing data</b>. The organization of data has not be
  150. defined before the first write. See
  151. <b>TIFFSetField</b>(3TIFF) for information on how to do
  152. this.</p>
  153. <!-- INDENTATION -->
  154. <p><b>Can not change &quot;ImageLength&quot; when using
  155. separate planes</b>. Separate image planes are being used
  156. (<i>PlanarConfiguration</i>=2), but the number of rows has
  157. not been specified before the first write. The library
  158. supports the dynamic growth of an image only when data are
  159. organized in a contiguous manner
  160. (<i>PlanarConfiguration</i>=1).</p>
  161. <!-- INDENTATION -->
  162. <p><b>%d: Sample out of range, max %d</b>. The <i>sample</i>
  163. parameter was greater than the value of the SamplesPerPixel
  164. tag.</p>
  165. <!-- INDENTATION -->
  166. <p><b>%s: No space for strip arrays .</b> There was not
  167. enough space for the arrays that hold strip offsets and byte
  168. counts.</p>
  169. </td>
  170. </table>
  171. <a name="BUGS"></a>
  172. <h2>BUGS</h2>
  173. <!-- INDENTATION -->
  174. <table width="100%" border=0 rules="none" frame="void"
  175. cols="2" cellspacing="0" cellpadding="0">
  176. <tr valign="top" align="left">
  177. <td width="8%"></td>
  178. <td width="91%">
  179. <p>Writing subsampled YCbCR data does not work correctly
  180. because, for <i>PlanarConfiguration</i>=2 the size of a
  181. scanline is not calculated on a per-sample basis, and for
  182. <i>PlanarConfiguration</i>=1 the library does not pack the
  183. block-interleaved samples.</p>
  184. </td>
  185. </table>
  186. <a name="SEE ALSO"></a>
  187. <h2>SEE ALSO</h2>
  188. <!-- INDENTATION -->
  189. <table width="100%" border=0 rules="none" frame="void"
  190. cols="2" cellspacing="0" cellpadding="0">
  191. <tr valign="top" align="left">
  192. <td width="8%"></td>
  193. <td width="91%">
  194. <p><b>TIFFOpen</b>(3TIFF),
  195. <b>TIFFWriteEncodedStrip</b>(3TIFF),
  196. <b>TIFFWriteRawStrip</b>(3TIFF), <b>libtiff</b>(3TIFF)</p>
  197. <!-- INDENTATION -->
  198. <p>Libtiff library home page:
  199. <b>http://www.simplesystems.org/libtiff/</b></p>
  200. </td>
  201. </table>
  202. <hr>
  203. </body>
  204. </html>