Debian Codegraph @

texk/xdvipsk/thirdparty/libtiff/doc/functions/TIFFFieldQuery.rst

raw
1 TIFFFieldQuery
2 ==============
3
4 Synopsis
5 --------
6
7 .. highlight:: c
8
9 ::
10
11 #include <tiffio.h>
12
13 .. c:function:: const TIFFField* TIFFFieldWithName(TIFF* tif, const char *field_name)
14
15 .. c:function:: const TIFFField* TIFFFieldWithTag(TIFF* tif, uint32_t tag)
16
17 .. c:function:: const TIFFField* TIFFFindField(TIFF* tif, uint32_t tag, TIFFDataType dt)
18
19 .. c:function:: int TIFFFieldIsAnonymous(const TIFFField *fip)
20
21 .. c:function:: int TIFFFieldSetGetSize(const TIFFField *fip)
22
23 .. c:function:: int TIFFFieldSetGetCountSize(const TIFFField* fip)
24
25 Description
26 -----------
27
28 .. TODO: Check explanation and intended use of functions.
29
30 :c:func:`TIFFFieldWithName` and :c:func:`TIFFFieldWithTag`
31 return a pointer to TIFF field information structure `fip` by the tag's
32 *field_name* or its *tag* number.
33
34 :c:func:`TIFFFindField` searches for the TIFF field information structure
35 `fip` of a given *tag* number and a specific `TIFFDataType dt`.
36 With dt== :c:macro:`TIFF_ANY` the behaviour is the same than for
37 *TIFFFieldWithTag()*.
38
39 All three functions return :c:var:`NULL`, when the tag is not
40 registered within ``libtiff`` (see also :ref:`Tag_Auto_registration` ).
41
42 .. TODO: Check if ``libtiff`` is able to handle tag definitions with two different
43 definitions. From the code point of view, I don't believe that.
44
45 Such a `TIFFDataType` dependent search could be useful when the same
46 tag is defined twice but with different data types, which is true for
47 rare cases like TIFFTAG_XCLIPPATHUNITS. However, the ``libtiff`` does
48 currently not support multiple definitions of the same tag.
49
50
51 The following routines return status information about TIFF fields.
52
53 :c:var:`fip` is a field information pointer previously returned by
54 `TIFFFindField()`, `TIFFFieldWithTag()`, `TIFFFieldWithName()`.
55
56 :c:func:`TIFFFieldIsAnonymous` returns true (nonzero) if the field,
57 read from file, is unknown to ``libtiff`` and an anonymous field has
58 been auto-registered. Return is zero "0" if field is known to ``libtiff``.
59 See :ref:`Tag_Auto_registration` for more information.
60
61 :c:func:`TIFFFieldSetGetSize` returns the data size in bytes of
62 the field data type used for ``libtiff`` internal storage.
63 This is also the data size of the parameter to be provided to
64 :c:func:`TIFFSetField` and :c:func:`TIFFGetField`. Custom
65 :c:macro:`TIFF_RATIONAL` values can be stored internally either
66 as ``float`` or ``double``. :c:func:`TIFFFieldSetGetSize` would
67 then return "4" or "8", respectively.
68
69 :c:func:`TIFFFieldSetGetCountSize` returns size of ``count`` parameter
70 of :c:func:`TIFFSetField` and :c:func:`TIFFGetField` and also if it is
71 required: 0=none, 2= :c:type:`uint16_t`, 4= :c:type:`uint32_t`.
72 See also description of :c:func:`TIFFFieldReadCount`.
73
74 Diagnostics
75 -----------
76
77 None.
78
79 See also
80 --------
81
82 :doc:`TIFFFieldDataType` (3tiff),
83 :doc:`TIFFFieldName` (3tiff),
84 :doc:`TIFFFieldPassCount` (3tiff),
85 :doc:`TIFFFieldReadCount` (3tiff),
86 :doc:`TIFFFieldTag` (3tiff),
87 :doc:`TIFFFieldWriteCount` (3tiff),
88 :doc:`libtiff` (3tiff)