| 1 |
TIFFDeferStrileArrayWriting |
| 2 |
=========================== |
| 3 |
|
| 4 |
Synopsis |
| 5 |
-------- |
| 6 |
|
| 7 |
.. highlight:: c |
| 8 |
|
| 9 |
:: |
| 10 |
|
| 11 |
#include <tiffio.h> |
| 12 |
|
| 13 |
.. c:function:: int TIFFDeferStrileArrayWriting(TIFF* tif) |
| 14 |
|
| 15 |
.. c:function:: int TIFFForceStrileArrayWriting(TIFF* tif) |
| 16 |
|
| 17 |
Description |
| 18 |
----------- |
| 19 |
|
| 20 |
:c:func:`TIFFDeferStrileArrayWriting` is an advanced writing function |
| 21 |
that must be used in a particular sequence, and generally together |
| 22 |
with :c:func:`TIFFForceStrileArrayWriting`, to achieve its intended |
| 23 |
effect. Their aim is to control when and where the |
| 24 |
``StripOffsets`` / ``StripByteCounts`` or ``TileOffsets`` / ``TileByteCounts`` |
| 25 |
arrays are written into the file. |
| 26 |
|
| 27 |
The purpose of this is to generate 'cloud-optimized geotiff' files where |
| 28 |
the first KB of the file only contain the IFD entries without the potentially |
| 29 |
large strile arrays. Those are written afterwards. |
| 30 |
|
| 31 |
More precisely, when :c:func:`TIFFWriteCheck` is called, the tag entries for |
| 32 |
those arrays will be written with type = count = offset = 0 as a temporary value. |
| 33 |
|
| 34 |
Its effect is only valid for the current directory, and before |
| 35 |
:c:func:`TIFFWriteDirectory` is first called, and will be reset |
| 36 |
when changing directory. |
| 37 |
|
| 38 |
The typical sequence of calls is: |
| 39 |
|
| 40 |
.. highlight:: c |
| 41 |
|
| 42 |
:: |
| 43 |
|
| 44 |
TIFFOpen() |
| 45 |
/* or TIFFCreateDirectory(tif) */ |
| 46 |
/* Set fields with calls to TIFFSetField(tif, ...) */ |
| 47 |
TIFFDeferStrileArrayWriting(tif) |
| 48 |
TIFFWriteCheck(tif, ...) |
| 49 |
TIFFWriteDirectory(tif) |
| 50 |
/* ... potentially create other directories and come back to the above directory */ |
| 51 |
TIFFForceStrileArrayWriting(tif) /* emit the arrays at the end of file */ |
| 52 |
|
| 53 |
Returns |
| 54 |
------- |
| 55 |
|
| 56 |
1 in case of success, 0 otherwise. |
| 57 |
|
| 58 |
Diagnostics |
| 59 |
----------- |
| 60 |
|
| 61 |
All error messages are directed to the :c:func:`TIFFErrorExtR` routine. |
| 62 |
Likewise, warning messages are directed to the :c:func:`TIFFWarningExtR` routine. |
| 63 |
|
| 64 |
Note |
| 65 |
---- |
| 66 |
|
| 67 |
This functionality was introduced with libtiff 4.1. |
| 68 |
|
| 69 |
See also |
| 70 |
-------- |
| 71 |
|
| 72 |
:doc:`libtiff` (3tiff) |