|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Attach TIFF handles to caller-owned seekable C++ streams. More...
Functions | |
| TIFF * | TIFFStreamOpen (const char *name, std::ostream *os) |
| Open a TIFF writer over a caller-owned C++ stream. | |
| TIFF * | TIFFStreamOpen (const char *name, std::istream *is) |
| Open a TIFF reader over a caller-owned C++ stream. | |
Attach TIFF handles to caller-owned seekable C++ streams.
|
extern |
Open a TIFF reader over a caller-owned C++ stream.
Creates a library-owned adapter around a borrowed seekable stream. The stream must outlive the TIFF handle and any explicit adapter-release call. Use a binary stream positioned at zero for supported operation; nonzero- origin adapter limitations are described in Current implementation limits.
Opens in rm mode and reads the first TIFF directory. Mapping is disabled, and the write callback does not write. Reads and seeks change position and stream status. TIFFClose() deletes the adapter but leaves the stream open.
A normal NULL return releases the adapter without destroying the stream, but does not restore the stream position or flags. Library diagnostics report TIFF errors. C++ allocation/stream exceptions propagate; this implementation supplies no exception cleanup/rollback guarantee. Use streams with exceptions disabled when relying on status- based failure handling. TIFFCleanup() alone does not invoke the adapter close callback; save and invoke it explicitly if bypassing TIFFClose().
| [in] | name | Non-NULL diagnostic name; copied into the handle. |
| [in,out] | is | Non-NULL caller-owned, seekable binary input stream. |
Definition at line 673 of file tif_stream.cxx.
References _tiffStreamOpen().
|
extern |
Open a TIFF writer over a caller-owned C++ stream.
Creates a library-owned adapter around a borrowed seekable stream. The stream must outlive the TIFF handle and any explicit adapter-release call. Use a binary stream positioned at zero for supported operation; nonzero- origin adapter limitations are described in Current implementation limits.
Opens in wm mode, initialising a classic TIFF header at the stream origin. Output callbacks cannot read; operations requiring readback are unsupported. For an initially empty string stream with a failing tellp(), the wrapper may write a dummy null byte and seek to zero before opening. Opening and later operations can change bytes, position, and stream status. TIFFClose() deletes the adapter but neither closes the stream nor explicitly calls ostream::flush(); flush or close the caller-owned stream as needed after TIFFFlush()/TIFFClose().
A normal NULL return releases the adapter without destroying the stream, but does not roll back stream bytes, position, or flags. Library diagnostics report TIFF errors. C++ allocation/stream exceptions propagate; this implementation supplies no exception cleanup/rollback guarantee. Use streams with exceptions disabled when relying on status- based failure handling. TIFFCleanup() alone does not invoke the adapter close callback; save and invoke it explicitly if bypassing TIFFClose().
| [in] | name | Non-NULL diagnostic name; copied into the handle. |
| [in,out] | os | Non-NULL caller-owned, seekable binary output stream. |
Definition at line 657 of file tif_stream.cxx.
References _tiffStreamOpen().