| 1 |
TIFFWriteEncodedStrip |
| 2 |
===================== |
| 3 |
|
| 4 |
Synopsis |
| 5 |
-------- |
| 6 |
|
| 7 |
.. highlight:: c |
| 8 |
|
| 9 |
:: |
| 10 |
|
| 11 |
#include <tiffio.h> |
| 12 |
|
| 13 |
.. c:function:: tsize_t TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) |
| 14 |
|
| 15 |
Description |
| 16 |
----------- |
| 17 |
|
| 18 |
Compress *size* bytes of raw data from *buf* and write the result to the |
| 19 |
specified strip; replacing any previously written data. Note that the |
| 20 |
value of *strip* is a "raw strip number". That is, the caller must take |
| 21 |
into account whether or not the data are organized in separate planes |
| 22 |
(``PlanarConfiguration`` = 2). |
| 23 |
|
| 24 |
Notes |
| 25 |
----- |
| 26 |
|
| 27 |
The library writes encoded data using the native machine byte order. |
| 28 |
Correctly implemented TIFF readers are expected to do any necessary |
| 29 |
byte-swapping to correctly process image data with ``BitsPerSample`` |
| 30 |
greater than 8. |
| 31 |
|
| 32 |
The strip number must be valid according to the current settings of the |
| 33 |
``ImageLength`` and ``RowsPerStrip`` tags. |
| 34 |
An image may be dynamically grown by increasing the value of |
| 35 |
``ImageLength`` prior to each call to ``TIFFWriteEncodedStrip``. |
| 36 |
|
| 37 |
Return values |
| 38 |
------------- |
| 39 |
|
| 40 |
-1 is returned if an error was encountered. Otherwise, the value of |
| 41 |
*size* is returned. |
| 42 |
|
| 43 |
Diagnostics |
| 44 |
----------- |
| 45 |
|
| 46 |
All error messages are directed to the :c:func:`TIFFErrorExtR` routine. |
| 47 |
|
| 48 |
``%s: File not open for writing``: |
| 49 |
|
| 50 |
The file was opened for reading, not writing. |
| 51 |
|
| 52 |
``Can not write scanlines to a tiled image``: |
| 53 |
|
| 54 |
The image is assumed to be organized in tiles because the |
| 55 |
``TileWidth`` and ``TileLength`` tags have been set with |
| 56 |
:c:func:`TIFFSetField`. |
| 57 |
|
| 58 |
``%s: Must set "ImageWidth" before writing data\fP``: |
| 59 |
|
| 60 |
The image's width has not be set before the first write. See |
| 61 |
:c:func:`TIFFSetField` for information on how to do this. |
| 62 |
|
| 63 |
``%s: Must set "PlanarConfiguration" before writing data``: |
| 64 |
|
| 65 |
The organization of data has not be defined before the first |
| 66 |
write. See :c:func:`TIFFSetField` for information on how to do |
| 67 |
this. |
| 68 |
|
| 69 |
``%s: No space for strip arrays"``: |
| 70 |
|
| 71 |
There was not enough space for the arrays that hold strip offsets and |
| 72 |
byte counts. |
| 73 |
|
| 74 |
See also |
| 75 |
-------- |
| 76 |
|
| 77 |
:doc:`TIFFOpen` (3tiff), |
| 78 |
:doc:`TIFFWriteScanline` (3tiff), |
| 79 |
:doc:`TIFFWriteRawStrip` (3tiff), |
| 80 |
:doc:`libtiff` (3tiff) |