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