|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Open, inspect, flush, and release TIFF handles and their I/O resources. More...
Modules | |
| Open options and diagnostic context | |
| Configure checked allocations and per-handle diagnostics for opening. | |
| Client I/O callbacks | |
| Define the client-resource operations used by a TIFF handle. | |
| C++ stream interface | |
| Attach TIFF handles to caller-owned seekable C++ streams. | |
Functions | |
| TIFF * | TIFFOpenW (const wchar_t *name, const char *mode) |
| Open a TIFF file using a wide Windows pathname. | |
| TIFF * | TIFFOpenWExt (const wchar_t *name, const char *mode, TIFFOpenOptions *opts) |
| Open a TIFF file using a wide Windows pathname. | |
| void | TIFFCleanup (TIFF *tif) |
| Release library state without invoking the client close callback. | |
| void | TIFFClose (TIFF *tif) |
| Release a TIFF handle and invoke its client close callback. | |
| int | TIFFFlush (TIFF *tif) |
| Flush pending image data and dirty directory information. | |
| int | TIFFFlushData (TIFF *tif) |
| Flush pending encoded image data without committing directory changes. | |
| int | TIFFFileno (TIFF *tif) |
| Return the handle's file-descriptor metadata. | |
| int | TIFFSetFileno (TIFF *tif, int fd) |
| Replace descriptor metadata without changing client I/O routing. | |
| thandle_t | TIFFClientdata (TIFF *tif) |
| Return the context passed to client I/O callbacks. | |
| thandle_t | TIFFSetClientdata (TIFF *tif, thandle_t newvalue) |
| Replace the context passed to all client I/O callbacks. | |
| int | TIFFGetMode (TIFF *tif) |
| Return the stored library access mode. | |
| int | TIFFSetMode (TIFF *tif, int mode) |
| Replace the stored library access mode without reopening the resource. | |
| int | TIFFIsTiled (TIFF *tif) |
| Test whether the current image uses tiles. | |
| int | TIFFIsByteSwapped (TIFF *tif) |
| Test whether file values require byte swapping for this host. | |
| int | TIFFIsUpSampled (TIFF *tif) |
| Test whether the active codec supplies upsampled data. | |
| int | TIFFIsMSB2LSB (TIFF *tif) |
| Test the selected data bit-fill-order flag. | |
| int | TIFFIsBigEndian (TIFF *tif) |
| Test whether the stored file signature is TIFF_BIGENDIAN. | |
| int | TIFFIsBigTIFF (TIFF *tif) |
| Test whether the handle uses the BigTIFF format. | |
| TIFFReadWriteProc | TIFFGetReadProc (TIFF *tif) |
| Return the installed client read callback. | |
| TIFFReadWriteProc | TIFFGetWriteProc (TIFF *tif) |
| Return the installed client write callback. | |
| TIFFSeekProc | TIFFGetSeekProc (TIFF *tif) |
| Return the installed client seek callback. | |
| TIFFCloseProc | TIFFGetCloseProc (TIFF *tif) |
| Return the installed client close callback. | |
| TIFFSizeProc | TIFFGetSizeProc (TIFF *tif) |
| Return the installed client file-size callback. | |
| TIFFMapFileProc | TIFFGetMapFileProc (TIFF *tif) |
| Return the installed client mapping callback. | |
| TIFFUnmapFileProc | TIFFGetUnmapFileProc (TIFF *tif) |
| Return the installed client unmapping callback. | |
| const char * | TIFFFileName (TIFF *tif) |
| Return the handle's diagnostic filename. | |
| const char * | TIFFSetFileName (TIFF *tif, const char *name) |
| Replace the diagnostic filename pointer without copying it. | |
| TIFF * | TIFFOpen (const char *name, const char *mode) |
| Open a TIFF file by pathname. | |
| TIFF * | TIFFOpenExt (const char *name, const char *mode, TIFFOpenOptions *opts) |
| Open a TIFF file by pathname. | |
| TIFF * | TIFFFdOpen (int fd, const char *name, const char *mode) |
| Attach a TIFF handle to an already-open platform resource. | |
| TIFF * | TIFFFdOpenExt (int fd, const char *name, const char *mode, TIFFOpenOptions *opts) |
| Attach a TIFF handle to an already-open platform resource. | |
| TIFF * | TIFFClientOpen (const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc) |
| Initialise a TIFF handle using client-supplied I/O callbacks. | |
| TIFF * | TIFFClientOpenExt (const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc, TIFFOpenOptions *opts) |
| Initialise a TIFF handle using client-supplied I/O callbacks. | |
Open, inspect, flush, and release TIFF handles and their I/O resources.
See Lifecycle for ownership, open modes, failure postconditions, and platform/stream adapter limitations.
|
extern |
Release library state without invoking the client close callback.
For a writable handle, attempts TIFFFlush() and discards its result. Releases codec/directory state, offset maps, client-info names/nodes, owned buffers and field tables; releases mapped views through the unmapping callback, then frees the handle. Borrowed client-info payloads and diagnostic contexts are not freed.
The client I/O resource and any adapter context normally freed by closeproc remain the caller's responsibility. Save TIFFGetCloseProc() and TIFFClientdata() before cleanup if they are needed afterward. This is especially important for the C++ stream adapter. The handle and all borrowed views into its storage become invalid, even when flushing fails.
There is no status result. Error/warning callbacks may run, including during flushing and cleanup. Call TIFFFlush() first when its status is needed; cleanup is not an all-or-nothing write transaction.
| [in,out] | tif | Non-NULL live TIFF handle; invalid after the call. |
Definition at line 40 of file tif_close.c.
References _TIFFCleanupIFDOffsetAndNumberMaps(), _TIFFfreeExt(), _TIFFFieldArray::allocated_size, _TIFFField::field_bit, FIELD_CUSTOM, _TIFFField::field_name, _TIFFFieldArray::fields, isMapped, client_info::name, client_info::next, tiff::tif_base, tiff::tif_clientinfo, tiff::tif_cur_cumulated_mem_alloc, tiff::tif_fields, tiff::tif_fieldscompat, tiff::tif_flags, tiff::tif_mode, tiff::tif_nfields, tiff::tif_nfieldscompat, tiff::tif_rawdata, tiff::tif_rawdatasize, tiff::tif_size, TIFF_MYBUFFER, TIFFErrorExtR(), TIFFFieldIsAnonymous(), TIFFFlush(), TIFFFreeDirectory(), and TIFFUnmapFileContents.
Referenced by TIFFClientOpenExt(), and TIFFClose().
Return the context passed to client I/O callbacks.
Reads stored state without performing I/O, validating the underlying resource, allocating, or emitting diagnostics. Requires a live handle and has no distinct failure result. The context lifetime follows the client- open/close contract; querying it does not extend that lifetime.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 865 of file tif_open.c.
References tiff::tif_clientdata.
|
extern |
Initialise a TIFF handle using client-supplied I/O callbacks.
Initialises a handle over caller-supplied I/O without opening or truncating the underlying resource. Start with the I/O position at TIFF offset zero. Opening can invoke read/seek/size/map callbacks, read the initial directory, and write a new header for writable modes. A short initial header read in a writable mode can initialise a fresh header; do not expect file-content or position rollback on failure.
Equivalent to TIFFClientOpenExt() with opts = NULL. All five non-mapping callbacks must be supplied. Mapping/unmapping are independently optional, but a successful mapping must have a matching unmapper if its resources require release. The callbacks and their context must remain valid through the last call, including TIFFClose(). The name and mode strings need not remain alive after return.
A successful TIFFClose() path invokes closeproc after releasing library state. TIFFCleanup() alone never invokes closeproc. A NULL return does not invoke closeproc: the caller retains responsibility for the client resource/context, though a mapped view may already have been unmapped during failure cleanup. Error handlers can run before or during initialisation; early per-handle errors can receive a NULL TIFF pointer.
| [in] | name | Non-NULL diagnostic name; copied into the handle. |
| [in] | mode | Non-NULL open mode; see Open modes. |
| [in,out] | clientdata | Opaque client I/O context; passed unchanged to the callbacks. |
| [in] | readproc | Non-NULL read callback, even for a write-only application. |
| [in] | writeproc | Non-NULL write callback, even for read-only mode. |
| [in] | seekproc | Non-NULL seek callback. |
| [in] | closeproc | Non-NULL resource/adapter release callback. |
| [in] | sizeproc | Non-NULL file-size callback. |
| [in] | mapproc | Optional mapping callback; NULL installs a failing no- op mapper. |
| [in] | unmapproc | Optional unmapping callback; NULL installs a no-op unmapper. |
Definition at line 315 of file tif_open.c.
References TIFFClientOpenExt().
Referenced by _tiffStreamOpen().
|
extern |
Initialise a TIFF handle using client-supplied I/O callbacks.
Initialises a handle over caller-supplied I/O without opening or truncating the underlying resource. Start with the I/O position at TIFF offset zero. Opening can invoke read/seek/size/map callbacks, read the initial directory, and write a new header for writable modes. A short initial header read in a writable mode can initialise a fresh header; do not expect file-content or position rollback on failure.
Copies options but borrows callback context pointers. All five non-mapping callbacks must be supplied. Mapping/unmapping are independently optional, but a successful mapping must have a matching unmapper if its resources require release. The callbacks and their context must remain valid through the last call, including TIFFClose(). The name and mode strings need not remain alive after return.
A successful TIFFClose() path invokes closeproc after releasing library state. TIFFCleanup() alone never invokes closeproc. A NULL return does not invoke closeproc: the caller retains responsibility for the client resource/context, though a mapped view may already have been unmapped during failure cleanup. Error handlers can run before or during initialisation; early per-handle errors can receive a NULL TIFF pointer.
| [in] | name | Non-NULL diagnostic name; copied into the handle. |
| [in] | mode | Non-NULL open mode; see Open modes. |
| [in,out] | clientdata | Opaque client I/O context; passed unchanged to the callbacks. |
| [in] | readproc | Non-NULL read callback, even for a write-only application. |
| [in] | writeproc | Non-NULL write callback, even for read-only mode. |
| [in] | seekproc | Non-NULL seek callback. |
| [in] | closeproc | Non-NULL resource/adapter release callback. |
| [in] | sizeproc | Non-NULL file-size callback. |
| [in] | mapproc | Optional mapping callback; NULL installs a failing no- op mapper. |
| [in] | unmapproc | Optional unmapping callback; NULL installs a no-op unmapper. |
| [in] | opts | Borrowed options copied before return, or NULL for defaults. |
Definition at line 326 of file tif_open.c.
References _tiffDummyMapProc(), _tiffDummyUnmapProc(), _TIFFErrorEarly(), _TIFFfreeExt(), _TIFFgetMode(), _TIFFmallocExt(), _TIFFmemcpy(), _TIFFmemset(), _TIFFResetTifDirAndInitStrileCounters(), _TIFFSetDefaultCompressionState(), TIFFHeaderUnion::big, TIFFHeaderUnion::common, TIFFOpenOptions::errorhandler, TIFFOpenOptions::errorhandler_user_data, FALSE, FILLORDER_LSB2MSB, FILLORDER_MSB2LSB, HOST_BIGENDIAN, TIFFOpenOptions::max_cumulated_mem_alloc, TIFFOpenOptions::max_single_mem_alloc, MDI_BIGENDIAN, MDI_LITTLEENDIAN, MDI_SUPPORT, ReadOK, STRIPCHOP_DEFAULT, TIFF_BIGENDIAN, TIFF_BIGTIFF, TIFF_DEFERSTRILELOAD, TIFF_HEADERONLY, TIFF_LAZYSTRILELOAD_ASKED, TIFF_LITTLEENDIAN, TIFF_MAPPED, TIFF_MYBUFFER, TIFF_NON_EXISTENT_DIR_NUMBER, TIFFHeaderBig::tiff_offsetsize, TIFF_STRIPCHOP, TIFF_SWAB, TIFFHeaderCommon::tiff_version, TIFF_VERSION_BIG, TIFF_VERSION_CLASSIC, TIFFCleanup(), TIFFDefaultDirectory(), TIFFErrorExtR(), TIFFMapFileContents, TIFFReadDirectory(), TIFFSeekFile, TIFFSwabLong(), TIFFSwabLong8(), TIFFSwabShort(), TIFFWarningExtR(), TIFFOpenOptions::warn_about_unknown_tags, TIFFOpenOptions::warnhandler, TIFFOpenOptions::warnhandler_user_data, and WriteOK.
Referenced by TIFFClientOpen(), TIFFFdOpenExt(), and TIFFFdOpenExt().
|
extern |
Release a TIFF handle and invoke its client close callback.
Saves the close callback and client context, calls TIFFCleanup(), then invokes the saved close callback. The handle is already invalid when closeproc runs. Borrowed diagnostic and client-info contexts are not independently freed by the library. A stream adapter releases its own wrapper but leaves the caller's stream open.
There is no status result: flush failures and the close callback's return value are discarded. Error/warning callbacks may run during cleanup, but a close failure need not produce a library diagnostic. Call TIFFFlush() before closing to inspect buffered-write status; that does not certify OS durability or successful resource close. NULL is accepted.
| [in,out] | tif | Live TIFF handle to release, or NULL for a no-op. |
Definition at line 145 of file tif_close.c.
References tiff::tif_clientdata, tiff::tif_closeproc, and TIFFCleanup().
|
extern |
Attach a TIFF handle to an already-open platform resource.
Wraps an existing resource without opening it or physically truncating it. The resource must support seek/read and, for writable modes, write. Initialise its position at the beginning of the TIFF data. Mode w writes a fresh header; truncate the resource yourself if physical truncation is required.
Equivalent to TIFFFdOpenExt(fd, name, mode, NULL). On success TIFFClose() invokes the backend close callback. On a NULL return the resource stays the caller's responsibility; its position and content may already have changed. Diagnostics follow the configured handlers. The POSIX/CRT backend expects a file descriptor; the native Windows backend expects its integer representation of a Windows HANDLE, not a CRT descriptor.
| [in] | fd | Already-open resource in the backend's descriptor convention; see Client I/O and platform conventions. |
| [in] | name | Non-NULL diagnostic name; copied into the new handle. |
| [in] | mode | Non-NULL open mode consistent with the resource access permissions. |
Definition at line 351 of file tif_unix.c.
References TIFFFdOpenExt(), and TIFFFdOpenExt().
|
extern |
Attach a TIFF handle to an already-open platform resource.
Wraps an existing resource without opening it or physically truncating it. The resource must support seek/read and, for writable modes, write. Initialise its position at the beginning of the TIFF data. Mode w writes a fresh header; truncate the resource yourself if physical truncation is required.
Uses the supplied options. On success TIFFClose() invokes the backend close callback. On a NULL return the resource stays the caller's responsibility; its position and content may already have changed. Diagnostics follow the configured handlers. The POSIX/CRT backend expects a file descriptor; the native Windows backend expects its integer representation of a Windows HANDLE, not a CRT descriptor.
| [in] | fd | Already-open resource in the backend's descriptor convention; see Client I/O and platform conventions. |
| [in] | name | Non-NULL diagnostic name; copied into the new handle. |
| [in] | mode | Non-NULL open mode consistent with the resource access permissions. |
| [in] | opts | Borrowed options copied into the handle, or NULL for defaults. |
Definition at line 356 of file tif_unix.c.
References _tiffCloseProc(), _tiffCloseProc(), _tiffDummyMapProc(), _tiffDummyUnmapProc(), _tiffMapProc(), _tiffMapProc(), _tiffReadProc(), _tiffReadProc(), _tiffSeekProc(), _tiffSeekProc(), _tiffSizeProc(), _tiffSizeProc(), _tiffUnmapProc(), _tiffUnmapProc(), _tiffWriteProc(), _tiffWriteProc(), fd_as_handle_union::fd, fd_as_handle_union::h, thandle_from_int(), tiff::tif_fd, and TIFFClientOpenExt().
Referenced by TIFFFdOpen(), TIFFFdOpen(), TIFFOpenExt(), and TIFFOpenWExt().
|
extern |
Return the handle's diagnostic filename.
Reads stored state without performing I/O, validating the underlying resource, allocating, or emitting diagnostics. Requires a live handle and has no distinct failure result. Do not free or modify the returned string. The initial name survives until handle cleanup; a TIFFSetFileName() replacement has the caller-managed lifetime described there.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 835 of file tif_open.c.
References tiff::tif_name.
Referenced by _TIFFReadEncodedStripAndAllocBuffer(), _TIFFReadEncodedTileAndAllocBuffer(), buildMap(), calcCopyToRasterParameter(), checkColOffsetByteAligned(), gtStripContig(), gtStripSeparate(), gtTileContig(), gtTileSeparate(), makebwmap(), makecmap(), PickContigCase(), setorientation(), setupMap(), TIFFReadRGBAImageOriented(), TIFFReadRGBAStripExt(), TIFFReadRGBATileExt(), and TIFFRGBAImageGet().
|
extern |
Return the handle's file-descriptor metadata.
Reads stored state without performing I/O, validating the underlying resource, allocating, or emitting diagnostics. Requires a live handle and has no distinct failure result. Client I/O uses TIFFClientdata(), not this metadata. A generic TIFFClientOpen() handle starts with descriptor metadata zero unless changed.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 850 of file tif_open.c.
References tiff::tif_fd.
|
extern |
Flush pending image data and dirty directory information.
Runs codec postencoding and buffered writes as needed, then updates dirty directory or strip/tile-array information. May change file position, contents, and directory/buffer state and invoke I/O or diagnostic callbacks. A failure can leave partial file writes and changed state; no rollback is provided. Does not close the handle, call fsync(), or flush a caller-owned C++ stream to its final device. Ownership and handle lifetime are unchanged.
| [in,out] | tif | Non-NULL live TIFF handle. |
Definition at line 35 of file tif_flush.c.
References tiff::tif_flags, tiff::tif_mode, TIFF_DIRTYDIRECT, TIFF_DIRTYSTRIP, TIFFFlushData(), TIFFForceStrileArrayWriting(), and TIFFRewriteDirectory().
Referenced by TIFFCleanup().
|
extern |
Flush pending encoded image data without committing directory changes.
Finalises pending codec output and writes buffered image data. It does not by itself commit dirty directory metadata; use TIFFFlush() for that. May invoke codec, I/O, and diagnostic callbacks and alter file position, contents, and buffer flags. In particular the pending-postencode flag is cleared before the postencode callback, even if that callback fails, so failure is not a rollback/retry guarantee. Does not close or release the handle and does not ensure device durability.
| [in,out] | tif | Non-NULL live TIFF handle. |
Definition at line 151 of file tif_flush.c.
References tiff::tif_flags, tiff::tif_postencode, TIFF_BEENWRITING, TIFF_POSTENCODE, and TIFFFlushData1().
Referenced by TIFFCheckRead(), TIFFFlush(), and TIFFWriteScanline().
|
extern |
Return the installed client close callback.
Reads the callback pointer without I/O, allocation, mutation, or diagnostics. The pointer alone does not retain the client context or backing code. Invoking it manually requires the matching live TIFFClientdata() context and its callback contract; closing a resource manually while the handle still uses it can invalidate the handle.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 964 of file tif_open.c.
References tiff::tif_closeproc.
|
extern |
Return the installed client mapping callback.
Reads the callback pointer without I/O, allocation, mutation, or diagnostics. The pointer alone does not retain the client context or backing code. Invoking it manually requires the matching live TIFFClientdata() context and its callback contract; closing a resource manually while the handle still uses it can invalidate the handle.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 974 of file tif_open.c.
References tiff::tif_mapproc.
|
extern |
Return the stored library access mode.
Reads stored state without performing I/O, validating the underlying resource, allocating, or emitting diagnostics. Requires a live handle and has no distinct failure result. Changing OS access permissions or stream state outside the library is not reflected by this query.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 880 of file tif_open.c.
References tiff::tif_mode.
|
extern |
Return the installed client read callback.
Reads the callback pointer without I/O, allocation, mutation, or diagnostics. The pointer alone does not retain the client context or backing code. Invoking it manually requires the matching live TIFFClientdata() context and its callback contract; closing a resource manually while the handle still uses it can invalidate the handle.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 949 of file tif_open.c.
References tiff::tif_readproc.
|
extern |
Return the installed client seek callback.
Reads the callback pointer without I/O, allocation, mutation, or diagnostics. The pointer alone does not retain the client context or backing code. Invoking it manually requires the matching live TIFFClientdata() context and its callback contract; closing a resource manually while the handle still uses it can invalidate the handle.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 959 of file tif_open.c.
References tiff::tif_seekproc.
|
extern |
Return the installed client file-size callback.
Reads the callback pointer without I/O, allocation, mutation, or diagnostics. The pointer alone does not retain the client context or backing code. Invoking it manually requires the matching live TIFFClientdata() context and its callback contract; closing a resource manually while the handle still uses it can invalidate the handle.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 969 of file tif_open.c.
References tiff::tif_sizeproc.
|
extern |
Return the installed client unmapping callback.
Reads the callback pointer without I/O, allocation, mutation, or diagnostics. The pointer alone does not retain the client context or backing code. Invoking it manually requires the matching live TIFFClientdata() context and its callback contract; closing a resource manually while the handle still uses it can invalidate the handle.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 979 of file tif_open.c.
References tiff::tif_unmapproc.
|
extern |
Return the installed client write callback.
Reads the callback pointer without I/O, allocation, mutation, or diagnostics. The pointer alone does not retain the client context or backing code. Invoking it manually requires the matching live TIFFClientdata() context and its callback contract; closing a resource manually while the handle still uses it can invalidate the handle.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 954 of file tif_open.c.
References tiff::tif_writeproc.
|
extern |
Test whether the stored file signature is TIFF_BIGENDIAN.
Reads stored header/flag state without I/O, mutation, allocation, or diagnostic callbacks. There is no distinct error result. Directory- and codec-dependent flags describe the current handle state rather than every image in a multipage file.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 936 of file tif_open.c.
References TIFFHeaderUnion::common, tiff::tif_header, TIFF_BIGENDIAN, and TIFFHeaderCommon::tiff_magic.
|
extern |
Test whether the handle uses the BigTIFF format.
Reads stored header/flag state without I/O, mutation, allocation, or diagnostic callbacks. There is no distinct error result. Directory- and codec-dependent flags describe the current handle state rather than every image in a multipage file.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 944 of file tif_open.c.
References tiff::tif_flags, and TIFF_BIGTIFF.
|
extern |
Test whether file values require byte swapping for this host.
Reads stored header/flag state without I/O, mutation, allocation, or diagnostic callbacks. There is no distinct error result. Directory- and codec-dependent flags describe the current handle state rather than every image in a multipage file.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 921 of file tif_open.c.
References tiff::tif_flags, and TIFF_SWAB.
|
extern |
Test the selected data bit-fill-order flag.
Reads stored header/flag state without I/O, mutation, allocation, or diagnostic callbacks. There is no distinct error result. Directory- and codec-dependent flags describe the current handle state rather than every image in a multipage file.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 931 of file tif_open.c.
References FILLORDER_MSB2LSB, and isFillOrder.
|
extern |
Test whether the current image uses tiles.
Reads stored header/flag state without I/O, mutation, allocation, or diagnostic callbacks. There is no distinct error result. Directory- and codec-dependent flags describe the current handle state rather than every image in a multipage file.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 896 of file tif_open.c.
References isTiled.
Referenced by PickContigCase(), PickSeparateCase(), TIFFForceStrileArrayWriting(), TIFFReadFromUserBuffer(), TIFFReadRGBAStripExt(), and TIFFReadRGBATileExt().
|
extern |
Test whether the active codec supplies upsampled data.
Reads stored header/flag state without I/O, mutation, allocation, or diagnostic callbacks. There is no distinct error result. Directory- and codec-dependent flags describe the current handle state rather than every image in a multipage file.
| [in] | tif | Non-NULL live TIFF handle. |
Definition at line 926 of file tif_open.c.
References isUpSampled.
|
extern |
Open a TIFF file by pathname.
Opens the OS resource, then initialises a TIFF handle. Pathname mode w truncates an existing file, a may create one, and r/r+ require an existing resource. Opening may read a directory, map the file, or write a header; failures do not roll back file changes.
Equivalent to TIFFOpenExt(name, mode, NULL). Reports ordinary opening/initialisation failures through the configured error handlers. errno/GetLastError may reflect a platform failure but are not a complete library-error channel. See Lifecycle for mode and lifetime details.
| [in] | name | Non-NULL, null-terminated pathname interpreted by the selected platform backend. |
| [in] | mode | Non-NULL, null-terminated open mode; see Open modes. |
Definition at line 374 of file tif_unix.c.
References TIFFOpenExt().
|
extern |
Open a TIFF file by pathname.
Opens the OS resource, then initialises a TIFF handle. Pathname mode w truncates an existing file, a may create one, and r/r+ require an existing resource. Opening may read a directory, map the file, or write a header; failures do not roll back file changes.
Uses the supplied options. Diagnostic callbacks may run before a handle exists; per-handle callback contexts remain borrowed through close. Reports ordinary opening/initialisation failures through the configured error handlers. errno/GetLastError may reflect a platform failure but are not a complete library-error channel. See Lifecycle for mode and lifetime details.
| [in] | name | Non-NULL, null-terminated pathname interpreted by the selected platform backend. |
| [in] | mode | Non-NULL, null-terminated open mode; see Open modes. |
| [in] | opts | Borrowed open options, or NULL for defaults; copied before return. |
Definition at line 379 of file tif_unix.c.
References _TIFFErrorEarly(), _TIFFgetMode(), thandle_to_int(), TIFFFdOpenExt(), and TIFFFdOpenExt().
Referenced by TIFFOpen().
| TIFF * TIFFOpenW | ( | const wchar_t * | name, |
| const char * | mode | ||
| ) |
Open a TIFF file using a wide Windows pathname.
Opens the OS resource, then initialises a TIFF handle. Pathname mode w truncates an existing file, a may create one, and r/r+ require an existing resource. Opening may read a directory, map the file, or write a header; failures do not roll back file changes.
Equivalent to TIFFOpenWExt(name, mode, NULL). Reports ordinary opening/initialisation failures through the configured error handlers. errno/GetLastError may reflect a platform failure but are not a complete library-error channel. See Lifecycle for mode and lifetime details.
Available only on Windows. The original wide pathname opens the resource; an ANSI-code-page conversion is used for the diagnostic name, falling back to "<unknown>" if conversion sizing fails. The current filename-conversion allocation-failure path returns NULL without closing the just-opened OS resource; this implementation limitation is recorded in Current implementation limits.
| [in] | name | Non-NULL, null-terminated Windows wide-character pathname. |
| [in] | mode | Non-NULL, null-terminated open mode; see Open modes. |
Definition at line 458 of file tif_win32.c.
References TIFFOpenWExt().
| TIFF * TIFFOpenWExt | ( | const wchar_t * | name, |
| const char * | mode, | ||
| TIFFOpenOptions * | opts | ||
| ) |
Open a TIFF file using a wide Windows pathname.
Opens the OS resource, then initialises a TIFF handle. Pathname mode w truncates an existing file, a may create one, and r/r+ require an existing resource. Opening may read a directory, map the file, or write a header; failures do not roll back file changes.
Uses the supplied options. Diagnostic callbacks may run before a handle exists; per-handle callback contexts remain borrowed through close. Reports ordinary opening/initialisation failures through the configured error handlers. errno/GetLastError may reflect a platform failure but are not a complete library-error channel. See Lifecycle for mode and lifetime details.
Available only on Windows. The original wide pathname opens the resource; an ANSI-code-page conversion is used for the diagnostic name, falling back to "<unknown>" if conversion sizing fails. The current filename-conversion allocation-failure path returns NULL without closing the just-opened OS resource; this implementation limitation is recorded in Current implementation limits.
| [in] | name | Non-NULL, null-terminated Windows wide-character pathname. |
| [in] | mode | Non-NULL, null-terminated open mode; see Open modes. |
| [in] | opts | Borrowed open options, or NULL for defaults; copied before return. |
Definition at line 497 of file tif_win32.c.
References _TIFFErrorEarly(), _TIFFfree(), _TIFFgetMode(), _TIFFmalloc(), thandle_to_int(), and TIFFFdOpenExt().
Referenced by TIFFOpenW().
Replace the context passed to all client I/O callbacks.
Stores the new context without retaining, validating, or releasing either value. Subsequent callbacks, including unmapping and closing, receive the replacement. The caller must preserve compatibility with installed callbacks and existing buffers/mappings; replacing the context does not reset those. Descriptor metadata is unchanged. No diagnostic or distinct failure result occurs.
| [in,out] | tif | Non-NULL live TIFF handle. |
| [in] | newvalue | Replacement context compatible with all installed callbacks. |
Definition at line 870 of file tif_open.c.
References tiff::tif_clientdata.
|
extern |
Replace the diagnostic filename pointer without copying it.
Stores the supplied pointer without allocation, validation, or I/O. The new null-terminated name must remain valid until replaced again or the handle is released. Does not rename the OS resource. An original inline name remains valid until handle cleanup; the lifetime of a previous caller-supplied name remains the caller's responsibility. No diagnostics or distinct failure result occur.
| [in,out] | tif | Non-NULL live TIFF handle. |
| [in] | name | Non-NULL borrowed null-terminated diagnostic name. |
Definition at line 840 of file tif_open.c.
References tiff::tif_name.
|
extern |
Replace descriptor metadata without changing client I/O routing.
Stores fd without opening, closing, duplicating, or validating any resource. Does not change TIFFClientdata() or callbacks; I/O continues through the existing client context. No diagnostics or distinct failure result occur.
| [in,out] | tif | Non-NULL live TIFF handle. |
| [in] | fd | Replacement descriptor metadata. |
Definition at line 855 of file tif_open.c.
References tiff::tif_fd.
|
extern |
Replace the stored library access mode without reopening the resource.
Stores the integer without validation or changing OS permissions. Can alter library read/write/flush decisions; the caller must ensure compatibility with the actual resource and handle state. Does not close, reopen, or otherwise take ownership of a resource. No diagnostic or distinct failure result occurs.
| [in,out] | tif | Non-NULL live TIFF handle. |
| [in] | mode | Replacement O_RDONLY/O_RDWR-style mode value. |
Definition at line 885 of file tif_open.c.
References tiff::tif_mode.