|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Query registered descriptors and extend image-directory schemas. More...
Typedefs | |
| typedef void(* | TIFFExtendProc) (TIFF *tif) |
| Extend the image-directory field table during default initialisation. | |
Functions | |
| int | TIFFGetTagListCount (TIFF *tif) |
| Count values stored in the current custom-tag list. | |
| uint32_t | TIFFGetTagListEntry (TIFF *tif, int tag_index) |
| Look up a tag number by its custom-value list index. | |
| const TIFFField * | TIFFFindField (TIFF *tif, uint32_t tag, TIFFDataType dt) |
| Find a registered field by tag number and file data type. | |
| const TIFFField * | TIFFFieldWithTag (TIFF *tif, uint32_t tag) |
| Find a registered field by tag number. | |
| const TIFFField * | TIFFFieldWithName (TIFF *tif, const char *field_name) |
| Find a registered field by name. | |
| uint32_t | TIFFFieldTag (const TIFFField *fip) |
| Read a field descriptor's tag number. | |
| const char * | TIFFFieldName (const TIFFField *fip) |
| Read a field descriptor's name. | |
| TIFFDataType | TIFFFieldDataType (const TIFFField *fip) |
| Read a field descriptor's on-disk data type. | |
| int | TIFFFieldPassCount (const TIFFField *fip) |
| Test whether a field passes an explicit count argument. | |
| int | TIFFFieldReadCount (const TIFFField *fip) |
| Read a field descriptor's getter count rule. | |
| int | TIFFFieldWriteCount (const TIFFField *fip) |
| Read a field descriptor's setter count rule. | |
| int | TIFFFieldSetGetSize (const TIFFField *fip) |
| Report the internal element storage width of a field. | |
| int | TIFFFieldSetGetCountSize (const TIFFField *fip) |
| Report the count width encoded by a field's set/get representation. | |
| int | TIFFFieldIsAnonymous (const TIFFField *fip) |
| Test whether a field was registered as an unknown tag. | |
| TIFFTagMethods * | TIFFAccessTagMethods (TIFF *tif) |
| Expose a handle's mutable tag-method table. | |
| TIFFExtendProc | TIFFSetTagExtender (TIFFExtendProc extender) |
| Replace the process-wide image-directory extension callback. | |
| int | TIFFDataWidth (TIFFDataType type) |
| Report the on-disk byte width of a TIFF data type. | |
| int | TIFFMergeFieldInfo (TIFF *tif, const TIFFFieldInfo info[], uint32_t n) |
| Register legacy application field definitions on a handle. | |
Query registered descriptors and extend image-directory schemas.
| typedef void(* TIFFExtendProc) (TIFF *tif) |
Extend the image-directory field table during default initialisation.
Called synchronously by TIFFDefaultDirectory(), including repeated directory setup on an existing handle. Register application fields and optionally chain the previously installed extender. It has no status channel; registration errors must be checked/reported within the callback. Custom/EXIF/GPS setup subsequently replaces the field table, so this hook does not extend their schemas. Keep callback code and borrowed field names live for their use, and synchronise global registration externally.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
|
extern |
Expose a handle's mutable tag-method table.
Returns inline borrowed storage valid until handle cleanup. Changes take effect immediately and may be overwritten by codec/directory setup. Save and delegate to the previous methods for unhandled tags. Keep installed callback code live until removed and all calls finish. No allocation, validation, or locking occurs; do not free the table.
| [in] | tif | Non-NULL live TIFF handle; not modified here, but the returned pointer gives write access to its method table. Accessed without internal locking. |
Definition at line 63 of file tif_extension.c.
References tiff::tif_tagmethods.
|
extern |
Report the on-disk byte width of a TIFF data type.
RATIONAL and SRATIONAL occupy eight bytes even when represented internally by float. TIFF_NOTYPE (zero) returns one for historical compatibility. No diagnostic or allocation occurs.
| [in] | type | File data type; no state is accessed. |
Definition at line 793 of file tif_dirinfo.c.
References TIFF_ASCII, TIFF_BYTE, TIFF_DOUBLE, TIFF_FLOAT, TIFF_IFD, TIFF_IFD8, TIFF_LONG, TIFF_LONG8, TIFF_RATIONAL, TIFF_SBYTE, TIFF_SHORT, TIFF_SLONG, TIFF_SLONG8, TIFF_SRATIONAL, TIFF_SSHORT, and TIFF_UNDEFINED.
Referenced by _TIFFRewriteField(), EstimateStripByteCounts(), EvaluateIFDdatasizeReading(), and TIFFReadDirEntryArrayWithLimit().
|
extern |
Read a field descriptor's on-disk data type.
Reads descriptor metadata without changing it or transferring ownership. No allocation or diagnostic occurs.
| [in] | fip | Non-NULL live borrowed field descriptor. |
Definition at line 1079 of file tif_dirinfo.c.
References _TIFFField::field_type.
|
extern |
Test whether a field was registered as an unknown tag.
Reads descriptor metadata without changing it or transferring ownership. No allocation or diagnostic occurs.
| [in] | fip | Non-NULL live borrowed field descriptor. |
Definition at line 1087 of file tif_dirinfo.c.
References _TIFFField::field_anonymous.
Referenced by _TIFFPrettyPrintField(), _TIFFPrintField(), _TIFFSetupFields(), TIFFCleanup(), and TIFFReadCustomDirectory().
|
extern |
Read a field descriptor's name.
Reads descriptor metadata without changing it or transferring ownership. No allocation or diagnostic occurs.
| [in] | fip | Non-NULL live borrowed field descriptor. |
Definition at line 1077 of file tif_dirinfo.c.
References _TIFFField::field_name.
|
extern |
Test whether a field passes an explicit count argument.
Reads descriptor metadata without changing it or transferring ownership. No allocation or diagnostic occurs.
| [in] | fip | Non-NULL live borrowed field descriptor. |
Definition at line 1081 of file tif_dirinfo.c.
References _TIFFField::field_passcount.
|
extern |
Read a field descriptor's getter count rule.
Reads descriptor metadata without changing it or transferring ownership. No allocation or diagnostic occurs.
| [in] | fip | Non-NULL live borrowed field descriptor. |
Definition at line 1083 of file tif_dirinfo.c.
References _TIFFField::field_readcount.
|
extern |
Report the count width encoded by a field's set/get representation.
Inspects the C16/C32 representation; it does not validate special built- in calling conventions or the consistency of legacy metadata. No allocation or diagnostic occurs.
| [in] | fip | Borrowed descriptor, or NULL. |
Definition at line 913 of file tif_dirinfo.c.
References _TIFFField::set_get_field_type, TIFF_SETGET_ASCII, TIFF_SETGET_C0_ASCII, TIFF_SETGET_C0_DOUBLE, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_C0_IFD8, TIFF_SETGET_C0_SINT16, TIFF_SETGET_C0_SINT32, TIFF_SETGET_C0_SINT64, TIFF_SETGET_C0_SINT8, TIFF_SETGET_C0_UINT16, TIFF_SETGET_C0_UINT32, TIFF_SETGET_C0_UINT64, TIFF_SETGET_C0_UINT8, TIFF_SETGET_C16_ASCII, TIFF_SETGET_C16_DOUBLE, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_C16_IFD8, TIFF_SETGET_C16_SINT16, TIFF_SETGET_C16_SINT32, TIFF_SETGET_C16_SINT64, TIFF_SETGET_C16_SINT8, TIFF_SETGET_C16_UINT16, TIFF_SETGET_C16_UINT32, TIFF_SETGET_C16_UINT64, TIFF_SETGET_C16_UINT8, TIFF_SETGET_C32_ASCII, TIFF_SETGET_C32_DOUBLE, TIFF_SETGET_C32_FLOAT, TIFF_SETGET_C32_IFD8, TIFF_SETGET_C32_SINT16, TIFF_SETGET_C32_SINT32, TIFF_SETGET_C32_SINT64, TIFF_SETGET_C32_SINT8, TIFF_SETGET_C32_UINT16, TIFF_SETGET_C32_UINT32, TIFF_SETGET_C32_UINT64, TIFF_SETGET_C32_UINT8, TIFF_SETGET_DOUBLE, TIFF_SETGET_FLOAT, TIFF_SETGET_IFD8, TIFF_SETGET_INT, TIFF_SETGET_OTHER, TIFF_SETGET_SINT16, TIFF_SETGET_SINT32, TIFF_SETGET_SINT64, TIFF_SETGET_SINT8, TIFF_SETGET_UINT16, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UINT32, TIFF_SETGET_UINT64, TIFF_SETGET_UINT8, and TIFF_SETGET_UNDEFINED.
|
extern |
Report the internal element storage width of a field.
Returns the width selected by the set/get representation, including float versus double rationals. UINT16_PAIR returns four. UNDEFINED, ASCII, and OTHER representations return one. This is neither the file data width nor a complete variadic signature: promotions, count arguments, and pointer indirection still apply. No allocation or diagnostic occurs.
| [in] | fip | Borrowed descriptor, or NULL. |
Definition at line 829 of file tif_dirinfo.c.
References _TIFFField::set_get_field_type, TIFF_SETGET_ASCII, TIFF_SETGET_C0_ASCII, TIFF_SETGET_C0_DOUBLE, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_C0_IFD8, TIFF_SETGET_C0_SINT16, TIFF_SETGET_C0_SINT32, TIFF_SETGET_C0_SINT64, TIFF_SETGET_C0_SINT8, TIFF_SETGET_C0_UINT16, TIFF_SETGET_C0_UINT32, TIFF_SETGET_C0_UINT64, TIFF_SETGET_C0_UINT8, TIFF_SETGET_C16_ASCII, TIFF_SETGET_C16_DOUBLE, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_C16_IFD8, TIFF_SETGET_C16_SINT16, TIFF_SETGET_C16_SINT32, TIFF_SETGET_C16_SINT64, TIFF_SETGET_C16_SINT8, TIFF_SETGET_C16_UINT16, TIFF_SETGET_C16_UINT32, TIFF_SETGET_C16_UINT64, TIFF_SETGET_C16_UINT8, TIFF_SETGET_C32_ASCII, TIFF_SETGET_C32_DOUBLE, TIFF_SETGET_C32_FLOAT, TIFF_SETGET_C32_IFD8, TIFF_SETGET_C32_SINT16, TIFF_SETGET_C32_SINT32, TIFF_SETGET_C32_SINT64, TIFF_SETGET_C32_SINT8, TIFF_SETGET_C32_UINT16, TIFF_SETGET_C32_UINT32, TIFF_SETGET_C32_UINT64, TIFF_SETGET_C32_UINT8, TIFF_SETGET_DOUBLE, TIFF_SETGET_FLOAT, TIFF_SETGET_IFD8, TIFF_SETGET_INT, TIFF_SETGET_OTHER, TIFF_SETGET_SINT16, TIFF_SETGET_SINT32, TIFF_SETGET_SINT64, TIFF_SETGET_SINT8, TIFF_SETGET_UINT16, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UINT32, TIFF_SETGET_UINT64, TIFF_SETGET_UINT8, and TIFF_SETGET_UNDEFINED.
Referenced by _TIFFPrintField(), _TIFFVGetField(), _TIFFVSetField(), TIFFPrintDirectory(), and TIFFWriteDirectorySec().
|
extern |
Read a field descriptor's tag number.
Reads descriptor metadata without changing it or transferring ownership. No allocation or diagnostic occurs.
| [in] | fip | Non-NULL live borrowed field descriptor. |
Definition at line 1075 of file tif_dirinfo.c.
References _TIFFField::field_tag.
Referenced by TIFFWriteDirectorySec().
Find a registered field by name.
The result is borrowed; do not free or modify it. Directory field-table replacement or handle cleanup can invalidate it, particularly for anonymous and legacy descriptors. Lookup updates the handle's field cache but does not register a missing tag. Absence dispatches a warning only when unknown-tag warnings are enabled for this handle.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | field_name | Non-NULL null-terminated, case-sensitive field name. |
Definition at line 1061 of file tif_dirinfo.c.
References _TIFFFindFieldByName(), tiff::tif_warn_about_unknown_tags, TIFF_ANY, and TIFFWarningExtR().
Find a registered field by tag number.
The result is borrowed; do not free or modify it. Directory field-table replacement or handle cleanup can invalidate it, particularly for anonymous and legacy descriptors. Lookup updates the handle's field cache but does not register a missing tag. Absence dispatches a warning only when unknown-tag warnings are enabled for this handle.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number in the current namespace. |
Definition at line 1047 of file tif_dirinfo.c.
References tiff::tif_warn_about_unknown_tags, TIFF_ANY, TIFFFindField(), and TIFFWarningExtR().
Referenced by _TIFFVSetField(), CheckDirCount(), JPEGVSetField(), OJPEGVSetField(), TIFFFetchStripThing(), TIFFPrintDirectory(), TIFFReadDirectory(), TIFFReadDirEntryPersampleShort(), and TIFFUnsetField().
|
extern |
Read a field descriptor's setter count rule.
Reads descriptor metadata without changing it or transferring ownership. No allocation or diagnostic occurs.
| [in] | fip | Non-NULL live borrowed field descriptor. |
Definition at line 1085 of file tif_dirinfo.c.
References _TIFFField::field_writecount.
|
extern |
Find a registered field by tag number and file data type.
The result is borrowed; do not free or modify it. Directory field-table replacement or handle cleanup can invalidate it, particularly for anonymous and legacy descriptors. Lookup updates the handle's field cache but does not register a missing tag. No diagnostic is emitted on absence.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | tag | Tag number in the current directory namespace. |
| [in] | dt | Required file type, or TIFF_ANY to accept any registered type. |
Definition at line 979 of file tif_dirinfo.c.
References _TIFFField::field_tag, _TIFFField::field_type, tagCompare(), tiff::tif_fields, tiff::tif_foundfield, tiff::tif_nfields, TIFF_ANY, TIFF_NOTYPE, and TIFF_SETGET_UNDEFINED.
Referenced by _TIFFFindOrRegisterField(), _TIFFMergeFields(), _TIFFRewriteField(), _TIFFVGetField(), _TIFFVSetField(), OkToChangeTag(), TIFFFieldWithTag(), and TIFFVGetField().
|
extern |
Count values stored in the current custom-tag list.
Counts FIELD_CUSTOM values, not all present baseline or codec tags. No allocation, diagnostic, or ownership change occurs.
| [in] | tif | Non-NULL live handle. |
Definition at line 39 of file tif_extension.c.
References TIFFDirectory::td_customValueCount, and tiff::tif_dir.
Referenced by TIFFPrintDirectory().
|
extern |
Look up a tag number by its custom-value list index.
The unsorted list changes after custom setters, unsetting, and directory replacement. No diagnostic is emitted for an invalid index.
| [in] | tif | Non-NULL live handle. |
| [in] | tag_index | Zero-based index below TIFFGetTagListCount(). |
Definition at line 47 of file tif_extension.c.
References _TIFFField::field_tag, TIFFTagValue::info, TIFFDirectory::td_customValueCount, TIFFDirectory::td_customValues, and tiff::tif_dir.
Referenced by TIFFPrintDirectory().
|
extern |
Register legacy application field definitions on a handle.
Converts descriptors into handle-owned compatibility storage, but borrows each non-NULL field_name until field-table/handle cleanup; keep names live and unchanged. Input records may be released after the call. Existing tag definitions win; this does not replace a definition or install tag values. Count validation/allocation/merge failures dispatch diagnostics and may leave partial compatibility storage or altered field- table state; there is no rollback. Zero-length input is not a successful no-op. Call during image-directory extension before values are read. This legacy interface cannot express every private set/get representation; see Tag arguments.
| [in,out] | tif | Non-NULL live TIFF handle; accessed without internal locking. |
| [in] | info | Readable array of n definitions, with valid count rules and long-lived names. |
| [in] | n | Positive number of records, with allocation sizes representable by tmsize_t. |
Definition at line 1380 of file tif_dirinfo.c.
References _TIFFCheckMalloc(), _TIFFCheckRealloc(), _TIFFMergeFields(), _TIFFSetGetType(), _TIFFFieldArray::allocated_size, _TIFFFieldArray::count, _TIFFField::field_anonymous, _TIFFField::field_bit, TIFFFieldInfo::field_bit, FIELD_IGNORE, _TIFFField::field_name, TIFFFieldInfo::field_name, _TIFFField::field_oktochange, TIFFFieldInfo::field_oktochange, _TIFFField::field_passcount, TIFFFieldInfo::field_passcount, _TIFFField::field_readcount, TIFFFieldInfo::field_readcount, _TIFFField::field_subfields, _TIFFField::field_tag, TIFFFieldInfo::field_tag, _TIFFField::field_type, TIFFFieldInfo::field_type, _TIFFField::field_writecount, TIFFFieldInfo::field_writecount, _TIFFFieldArray::fields, _TIFFField::set_get_field_type, tfiatOther, tiff::tif_fieldscompat, tiff::tif_nfieldscompat, TIFF_VARIABLE2, TIFFErrorExtR(), and _TIFFFieldArray::type.
|
extern |
Replace the process-wide image-directory extension callback.
Affects future default-directory initialisations, including those on existing handles, rather than invoking the hook immediately. NULL disables it. To coexist with other extenders, save and chain the returned callback. Callback code is borrowed; no allocation, validation, diagnostic, or locking occurs. Coordinate replacement with all users and in-flight initialisations.
| [in] | extender | New callback, or NULL; must remain callable while installed/in flight. |
Definition at line 2232 of file tif_dir.c.
References _TIFFextender.