| 1 |
TIFFbuffer |
| 2 |
========== |
| 3 |
|
| 4 |
Synopsis |
| 5 |
-------- |
| 6 |
|
| 7 |
.. highlight:: c |
| 8 |
|
| 9 |
:: |
| 10 |
|
| 11 |
#include <tiffio.h> |
| 12 |
|
| 13 |
|
| 14 |
.. c:function:: int TIFFReadBufferSetup(TIFF* tif, tdata_t buffer, tsize_t size) |
| 15 |
.. c:function:: int TIFFWriteBufferSetup(TIFF* tif, tdata_t buffer, tsize_t size) |
| 16 |
|
| 17 |
Description |
| 18 |
----------- |
| 19 |
|
| 20 |
The following routines are provided for client-control of the I/O buffers |
| 21 |
used by the library. Applications need never use these routines; they are |
| 22 |
provided only for "intelligent clients" that wish to optimize memory usage |
| 23 |
and/or eliminate potential copy operations that can occur when working with |
| 24 |
images that have data stored without compression. |
| 25 |
|
| 26 |
:c:func:`TIFFReadBufferSetup` sets up the data buffer used to read raw (encoded) |
| 27 |
data from a file. If the specified pointer is :c:macro:`NULL` (zero), then a |
| 28 |
buffer of the appropriate size is allocated. Otherwise the caller must guarantee |
| 29 |
that the buffer is large enough to hold any individual strip of raw data. |
| 30 |
:c:func:`TIFFReadBufferSetup` returns a non-zero value if the setup was successful |
| 31 |
and zero otherwise. |
| 32 |
|
| 33 |
:c:func:`TIFFWriteBufferSetup` sets up the data buffer used to write raw (encoded) |
| 34 |
data to a file. If the specified *size* is -1, then the buffer size is selected to |
| 35 |
hold a complete tile or strip, or at least 8 kilobytes, whichever is greater. If |
| 36 |
the specified *buffer* is :c:macro:`NULL` (zero), then a buffer of the appropriate |
| 37 |
size is dynamically allocated. |
| 38 |
:c:func:`TIFFWriteBufferSetup` returns a non-zero value if the setup was successful |
| 39 |
and zero otherwise. |
| 40 |
|
| 41 |
Diagnostics |
| 42 |
----------- |
| 43 |
|
| 44 |
``%s: No space for data buffer at scanline %ld``: |
| 45 |
|
| 46 |
:c:func:`TIFFReadBufferSetup` was unable to dynamically allocate space |
| 47 |
for a data buffer. |
| 48 |
|
| 49 |
``%s: No space for output buffer``: |
| 50 |
|
| 51 |
:c:func:`TIFFWriteBufferSetup` was unable to dynamically allocate space |
| 52 |
for a data buffer. |
| 53 |
|
| 54 |
See also |
| 55 |
-------- |
| 56 |
|
| 57 |
:doc:`libtiff` (3tiff) |