summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@codelibre.net>2022-06-24 22:03:07 +0100
committerRoger Leigh <rleigh@codelibre.net>2022-07-22 16:04:59 +0100
commitac11ee0eec577dbf43d26139d135299bdf888f69 (patch)
tree1706bcac2eeb83c5299e36789b03e39c82c52a52
parent35abe378532ac78a5ddc8859be4640597d8a0a3b (diff)
downloadlibtiff-git-ac11ee0eec577dbf43d26139d135299bdf888f69.tar.gz
libtiff: Add strict sphinx error checking option
* Correct a large number of warnings
-rw-r--r--cmake/Sphinx.cmake7
-rw-r--r--doc/CMakeLists.txt2
-rw-r--r--doc/addingtags.rst165
-rw-r--r--doc/functions.rst3
-rw-r--r--doc/functions/TIFFFieldDataType.rst74
-rw-r--r--doc/functions/TIFFFieldSetGetCountSize.rst35
-rw-r--r--doc/functions/TIFFFieldSetGetSize.rst34
-rw-r--r--doc/functions/TIFFRGBAImage.rst2
-rw-r--r--doc/functions/TIFFReadDirectory.rst2
-rw-r--r--doc/functions/TIFFSetField.rst88
-rw-r--r--doc/functions/TIFFWriteRawTile.rst2
-rw-r--r--doc/functions/TIFFfield.rst2272
-rw-r--r--doc/functions/TIFFmemory.rst2
-rw-r--r--doc/functions/TIFFswab.rst17
-rw-r--r--doc/functions/libtiff.rst109
-rw-r--r--doc/internals.rst561
-rw-r--r--doc/releases/v3.7.0beta.rst4
-rw-r--r--doc/releases/v3.7.2.rst4
-rw-r--r--doc/releases/v3.7.3.rst2
-rw-r--r--doc/releases/v4.0.8.rst10
-rw-r--r--doc/releases/v4.4.0.rst2
21 files changed, 3035 insertions, 362 deletions
diff --git a/cmake/Sphinx.cmake b/cmake/Sphinx.cmake
index bef3bf55..6321260b 100644
--- a/cmake/Sphinx.cmake
+++ b/cmake/Sphinx.cmake
@@ -49,8 +49,15 @@ if(SPHINX_BUILD)
set(SPHINX_DEFAULT ON)
endif()
option(sphinx "Enable sphinx manual page and HTML documentation" ${SPHINX_DEFAULT})
+option(sphinx-strict "Enable sphinx strict error checking" OFF)
option(sphinx-linkcheck "Check sphinx documentation links by default" OFF)
+# Nitpicky, and warnings are errors. Will not stop on error, so all errors will be shown.
+set(SPHINX_STRICT_OPTIONS)
+if (sphinx-strict)
+ set(SPHINX_STRICT_OPTIONS -n --keep-going)
+endif()
+
set(BUILD_SPHINX ${sphinx})
set(SPHINX_LIST_DIR ${CMAKE_CURRENT_LIST_DIR})
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 6cc3d2e4..aad73c5a 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -54,6 +54,7 @@ if (BUILD_SPHINX AND SPHINX_BUILD)
-D "release=${LIBTIFF_VERSION_FULL}"
-D "version=${tiff_VERSION_MAJOR}.${tiff_VERSION_MINOR}"
-d "${sphinx_builddir}/cache"
+ ${SPHINX_STRICT_OPTIONS}
-b man
"${sphinx_srcdir}" "${sphinx_builddir}/man"
WORKING_DIRECTORY "${sphinx_srcdir}"
@@ -84,6 +85,7 @@ if (BUILD_SPHINX AND SPHINX_BUILD)
-D "release=${tiff_VERSION}"
-D "version=${tiff_VERSION_MAJOR}.${tiff_VERSION_MINOR}"
-d "${sphinx_builddir}/cache"
+ ${SPHINX_STRICT_OPTIONS}
-b html
"${sphinx_srcdir}" "${sphinx_builddir}/html"
WORKING_DIRECTORY "${sphinx_srcdir}"
diff --git a/doc/addingtags.rst b/doc/addingtags.rst
index d3f2d8a9..56826bfc 100644
--- a/doc/addingtags.rst
+++ b/doc/addingtags.rst
@@ -10,88 +10,101 @@ TIFFFieldInfo
-------------
How libtiff manages specific tags is primarily controlled by the
-definition for that tag value stored internally as a TIFFFieldInfo structure.
-This structure looks like this:
+definition for that tag value stored internally as a :c:struct:`TIFFFieldInfo`
+structure.
.. highlight:: c
-::
- typedef struct {
- ttag_t field_tag; /* field's tag */
- short field_readcount; /* read count / TIFF_VARIABLE / TIFF_VARIABLE2 / TIFF_SPP */
- short field_writecount; /* write count / TIFF_VARIABLE / TIFF_VARIABLE2 */
- TIFFDataType field_type; /* type of associated data */
- unsigned short field_bit; /* bit in fieldsset bit vector */
- unsigned char field_oktochange; /* if true, can change while writing */
- unsigned char field_passcount; /* if true, pass dir count on set */
- char *field_name; /* ASCII name */
- } TIFFFieldInfo;
+.. c:macro:: TIFF_VARIABLE
+ The special value :c:macro:`TIFF_VARIABLE` indicates that a variable number of
+ values may be read.
-.. c:member:: ttag_t TIFFFieldInfo.field_tag
+.. c:macro:: TIFF_VARIABLE2
- The tag number. For instance 277 for the
- SamplesPerPixel tag. Builtin tags will generally have a ``#define`` in
- :file:`tiff.h` for each known tag.
+ The special value :c:macro:`TIFF_VARIABLE2` is similar to :c:macro:`TIFF_VARIABLE`
+ but the required :c:func:`TIFFGetField` count value must be :c:expr:`uint32_t*` instead
+ of :c:expr:`uint16_t*` as for :c:macro:`TIFF_VARIABLE`.
-.. c:member:: short TIFFFieldInfo.field_readcount
+.. c:macro:: TIFF_SPP
- The number of values which should be read.
- The special value :c:macro:`TIFF_VARIABLE` (-1) indicates that a variable number of
- values may be read. The special value :c:macro:`TIFFTAG_SPP` (-2) indicates that there
+ The special value :c:macro:`TIFF_SPP` indicates that there
should be one value for each sample as defined by :c:macro:`TIFFTAG_SAMPLESPERPIXEL`.
- The special value :c:macro:`TIFF_VARIABLE2` (-3) is similar to :c:macro:`TIFF_VARIABLE`
- but the required TIFFGetField() count value must be uint32_t* instead of uint16_t* as
- for :c:macro:`TIFF_VARIABLE` (-1).
- For ASCII fields with variable length, this field is :c:macro:`TIFF_VARIABLE`.
-.. c:member:: short TIFFFieldInfo.field_writecount
+.. c:struct:: TIFFFieldInfo
+
+ .. c:member:: ttag_t field_tag
+
+ The tag number. For instance 277 for the ``SamplesPerPixel`` tag.
+ Builtin tags will generally have a ``#define`` in :file:`tiff.h`
+ for each known tag.
+
+ .. c:member:: short field_readcount
+
+ The number of values which should be read, or one one of
+ :c:macro:`TIFF_VARIABLE`, :c:macro:`TIFF_VARIABLE2`
+ or :c:macro:`TIFF_SPP`
+
+ For ASCII fields with variable length, this field is :c:macro:`TIFF_VARIABLE`.
+
+ .. c:member:: short field_writecount
+
+ The number of values which should be written, or one of
+ :c:macro:`TIFF_VARIABLE` or :c:macro:`TIFF_VARIABLE2`
+
+ Generally the same as :c:member:`field_readcount`.
+ A few built-in exceptions exist, but I haven't analysed why they differ.
+
+ .. c:member:: TIFFDataType field_type
+
+ Type of associated data. One of
+ :c:enumerator:`TIFF_BYTE`, :c:enumerator:`TIFF_ASCII`,
+ :c:enumerator:`TIFF_SHORT`, :c:enumerator:`TIFF_LONG`,
+ :c:enumerator:`TIFF_RATIONAL`, :c:enumerator:`TIFF_SBYTE`,
+ :c:enumerator:`TIFF_UNDEFINED`, :c:enumerator:`TIFF_SSHORT`,
+ :c:enumerator:`TIFF_SLONG`, :c:enumerator:`TIFF_SRATIONAL`,
+ :c:enumerator:`TIFF_FLOAT`, :c:enumerator:`TIFF_DOUBLE` or
+ :c:enumerator:`TIFF_IFD`.
+
+ .. note::
- The number of values which should be written.
- Generally the same as field_readcount. A few built-in exceptions exist, but
- I haven't analysed why they differ.
+ Some fields can support more than one type (for
+ instance short and long). These fields should have multiple TIFFFieldInfos.
-.. c:member:: TIFFDataType TIFFDataType.field_type
+ .. c:member:: unsigned short field_bit
- Type of the field. One of :c:enumerator:`TIFF_BYTE`, :c:enumerator:`TIFF_ASCII`,
- :c:enumerator:`TIFF_SHORT`, :c:enumerator:`TIFF_LONG`,
- :c:enumerator:`TIFF_RATIONAL`, :c:enumerator:`TIFF_SBYTE`,
- :c:enumerator:`TIFF_UNDEFINED`, :c:enumerator:`TIFF_SSHORT`,
- :c:enumerator:`TIFF_SLONG`, :c:enumerator:`TIFF_SRATIONAL`,
- :c:enumerator:`TIFF_FLOAT`, :c:enumerator:`TIFF_DOUBLE` or
- :c:enumerator:`TIFF_IFD`.
+ bit in fieldsset bit vector
-.. note::
+ Built-in tags stored in special fields in the
+ TIFF structure have assigned field numbers to distinguish them (e.g.
+ :c:macro:`FIELD_SAMPLESPERPIXEL`). New tags should generally just use
+ :c:macro:`FIELD_CUSTOM` indicating they are stored in the generic tag list.
- Some fields can support more than one type (for
- instance short and long). These fields should have multiple TIFFFieldInfos.
+ .. c:member:: unsigned char field_oktochange
-.. c:member:: unsigned short TIFFFieldInfo.field_bit
+ if true, can change while writing
- Built-in tags stored in special fields in the
- TIFF structure have assigned field numbers to distinguish them (e.g.
- :c:macro:`FIELD_SAMPLESPERPIXEL`). New tags should generally just use
- :c:macro:`FIELD_CUSTOM` indicating they are stored in the generic tag list.
+ TRUE if it is OK to change this tag value
+ while an image is being written. FALSE for stuff that must be set once
+ and then left unchanged (like ImageWidth, or PhotometricInterpretation for
+ instance).
-.. c:member:: unsigned char TIFFFieldInfo.field_oktochange
+ .. c:member:: unsigned char field_passcount
- TRUE if it is OK to change this tag value
- while an image is being written. FALSE for stuff that must be set once
- and then left unchanged (like ImageWidth, or PhotometricInterpretation for
- instance).
+ if true, pass dir count on set
-.. c:member:: unsigned char TIFFFieldInfo.field_passcount
+ If TRUE, then the count value must be passed
+ in :c:func:`TIFFSetField`, and :c:func:`TIFFGetField`, otherwise the count is not required.
+ This should generally be TRUE for non-ascii variable count tags unless
+ the count is implicit (such as with the colormap).
- If TRUE, then the count value must be passed
- in :c:func:`TIFFSetField`, and :c:func:`TIFFGetField`, otherwise the count is not required.
- This should generally be TRUE for non-ascii variable count tags unless
- the count is implicit (such as with the colormap).
+ .. c:member:: char *field_name
-.. c:member:: char * TIFFFieldInfo.field_name
+ ASCII name
- A name for the tag. Normally mixed case (studly caps)
- like ``StripByteCounts``, and relatively short.
+ A name for the tag. Normally mixed case (studly caps)
+ like ``StripByteCounts``, and relatively short.
A :c:struct:`TIFFFieldInfo` definition exists for each built-in tag in the
:file:`tif_dirinfo.c` file. Some tags which support multiple data types
@@ -145,18 +158,18 @@ information on the new tags:
static const TIFFFieldInfo xtiffFieldInfo[] = {
/* XXX Insert Your tags here */
- { TIFFTAG_GEOPIXELSCALE, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
- TRUE, TRUE, "GeoPixelScale" },
- { TIFFTAG_GEOTRANSMATRIX, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
- TRUE, TRUE, "GeoTransformationMatrix" },
- { TIFFTAG_GEOTIEPOINTS, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
- TRUE, TRUE, "GeoTiePoints" },
- { TIFFTAG_GEOKEYDIRECTORY, -1,-1, TIFF_SHORT, FIELD_CUSTOM,
- TRUE, TRUE, "GeoKeyDirectory" },
- { TIFFTAG_GEODOUBLEPARAMS, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
- TRUE, TRUE, "GeoDoubleParams" },
- { TIFFTAG_GEOASCIIPARAMS, -1,-1, TIFF_ASCII, FIELD_CUSTOM,
- TRUE, FALSE, "GeoASCIIParams" }
+ { TIFFTAG_GEOPIXELSCALE, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
+ TRUE, TRUE, "GeoPixelScale" },
+ { TIFFTAG_GEOTRANSMATRIX, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
+ TRUE, TRUE, "GeoTransformationMatrix" },
+ { TIFFTAG_GEOTIEPOINTS, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
+ TRUE, TRUE, "GeoTiePoints" },
+ { TIFFTAG_GEOKEYDIRECTORY, -1,-1, TIFF_SHORT, FIELD_CUSTOM,
+ TRUE, TRUE, "GeoKeyDirectory" },
+ { TIFFTAG_GEODOUBLEPARAMS, -1,-1, TIFF_DOUBLE, FIELD_CUSTOM,
+ TRUE, TRUE, "GeoDoubleParams" },
+ { TIFFTAG_GEOASCIIPARAMS, -1,-1, TIFF_ASCII, FIELD_CUSTOM,
+ TRUE, FALSE, "GeoASCIIParams" }
};
In order to define the tags, we call :c:func:`TIFFMergeFieldInfo` on the
@@ -164,7 +177,7 @@ desired TIFF handle with the list of :c:struct:`TIFFFieldInfo`.
::
- #define N(a) (sizeof (a) / sizeof (a[0]))
+ #define N(a) (sizeof (a) / sizeof (a[0]))
/* Install the extended Tag field info */
TIFFMergeFieldInfo(tif, xtiffFieldInfo, N(xtiffFieldInfo));
@@ -186,10 +199,10 @@ allowing a chain of customizations to take effect.
void _XTIFFInitialize(void)
{
static int first_time=1;
-
+
if (! first_time) return; /* Been there. Done that. */
first_time = 0;
-
+
/* Grab the inherited method and install */
_ParentExtender = TIFFSetTagExtender(_XTIFFDefaultDirectory);
}
@@ -278,10 +291,10 @@ algorithm is used* follow these steps:
::
sp->vgetparent = tif->tif_vgetfield;
- tif->tif_vgetfield = fooVGetField; /* hook for codec tags */
+ tif->tif_vgetfield = fooVGetField; /* hook for codec tags */
sp->vsetparent = tif->tif_vsetfield;
- tif->tif_vsetfield = fooVSetField; /* hook for codec tags */
- tif->tif_printdir = fooPrintDir; /* hook for codec tags */
+ tif->tif_vsetfield = fooVSetField; /* hook for codec tags */
+ tif->tif_printdir = fooPrintDir; /* hook for codec tags */
(Actually you may decide not to override the
:c:member:`tif_printdir` method, but rather just specify it).
diff --git a/doc/functions.rst b/doc/functions.rst
index f544d0e0..addbb634 100644
--- a/doc/functions.rst
+++ b/doc/functions.rst
@@ -12,10 +12,13 @@ TIFF Functions Overview
functions/TIFFcolor
functions/TIFFDataWidth
functions/TIFFError
+ functions/TIFFfield
functions/TIFFFieldDataType
functions/TIFFFieldName
functions/TIFFFieldPassCount
functions/TIFFFieldReadCount
+ functions/TIFFFieldSetGetSize
+ functions/TIFFFieldSetGetCountSize
functions/TIFFFieldTag
functions/TIFFFieldWriteCount
functions/TIFFFlush
diff --git a/doc/functions/TIFFFieldDataType.rst b/doc/functions/TIFFFieldDataType.rst
index 8f5a8b61..94b1df1f 100644
--- a/doc/functions/TIFFFieldDataType.rst
+++ b/doc/functions/TIFFFieldDataType.rst
@@ -10,6 +10,80 @@ Synopsis
#include <tiffio.h>
+.. c:enum:: TIFFDataType
+
+ .. c:enumerator:: TIFF_NOTYPE
+
+ placeholder
+
+ .. c:enumerator:: TIFF_BYTE
+
+ 8-bit unsigned integer
+
+ .. c:enumerator:: TIFF_ASCII
+
+ 8-bit bytes w/ last byte null
+
+ .. c:enumerator:: TIFF_SHORT
+
+ 16-bit unsigned integer
+
+ .. c:enumerator:: TIFF_LONG
+
+ 32-bit unsigned integer
+
+ .. c:enumerator:: TIFF_RATIONAL
+
+ 64-bit unsigned fraction
+
+ .. c:enumerator:: TIFF_SBYTE
+
+ !8-bit signed integer
+
+ .. c:enumerator:: TIFF_UNDEFINED
+
+ !8-bit untyped data
+
+ .. c:enumerator:: TIFF_SSHORT
+
+ !16-bit signed integer
+
+ .. c:enumerator:: TIFF_SLONG
+
+ !32-bit signed integer
+
+ .. c:enumerator:: TIFF_SRATIONAL
+
+ !64-bit signed fraction
+
+ .. c:enumerator:: TIFF_FLOAT
+
+ !32-bit IEEE floating point
+
+ .. c:enumerator:: TIFF_DOUBLE
+
+ !64-bit IEEE floating point
+
+ .. c:enumerator:: TIFF_IFD
+
+ %32-bit unsigned integer (offset)
+
+ .. c:enumerator:: TIFF_LONG8
+
+ BigTIFF 64-bit unsigned integer
+
+ .. c:enumerator:: TIFF_SLONG8
+
+ BigTIFF 64-bit signed integer
+
+ .. c:enumerator:: TIFF_IFD8
+
+ BigTIFF 64-bit unsigned integer (offset)
+
+.. c:macro:: TIFF_ANY
+
+ An alias for :c:macro:`TIFF_NOTYPE`.
+
.. c:function:: TIFFDataType TIFFFieldDataType(const TIFFField* fip)
Description
diff --git a/doc/functions/TIFFFieldSetGetCountSize.rst b/doc/functions/TIFFFieldSetGetCountSize.rst
new file mode 100644
index 00000000..0b4fbc8b
--- /dev/null
+++ b/doc/functions/TIFFFieldSetGetCountSize.rst
@@ -0,0 +1,35 @@
+TIFFFieldSetGetCountSize
+========================
+
+Synopsis
+--------
+
+.. highlight:: c
+
+::
+
+ #include <tiffio.h>
+
+.. c:function:: int TIFFFieldSetGetCountSize(const TIFFField* fip)
+
+Description
+-----------
+
+:c:func:`TIFFFieldGetSetSize` returns the size of the count parameter of the field.
+
+:c:var:`fip` is a field information pointer previously returned by
+:c:func:`TIFFFindField`,
+:c:func:`TIFFFieldWithTag`,
+:c:func:`TIFFFieldWithName`.
+
+Return values
+-------------
+
+:c:func:`TIFFFieldGetSizeSize` returns the datatype size of the count parameter, or zero if the
+:c:var:`fip` pointer was NULL or the type was invalid. The size will be 2 if the type is
+:c:type:`uint16_t`, or 4 is the type is :c:type:`uint32_t`.
+
+See also
+--------
+
+:doc:`libtiff`
diff --git a/doc/functions/TIFFFieldSetGetSize.rst b/doc/functions/TIFFFieldSetGetSize.rst
new file mode 100644
index 00000000..625f9592
--- /dev/null
+++ b/doc/functions/TIFFFieldSetGetSize.rst
@@ -0,0 +1,34 @@
+TIFFFieldSetGetSize
+===================
+
+Synopsis
+--------
+
+.. highlight:: c
+
+::
+
+ #include <tiffio.h>
+
+.. c:function:: int TIFFFieldSetGetSize(const TIFFField* fip)
+
+Description
+-----------
+
+:c:func:`TIFFFieldGetSetSize` returns the internal storage size of the field data type in bytes.
+
+:c:var:`fip` is a field information pointer previously returned by
+:c:func:`TIFFFindField`,
+:c:func:`TIFFFieldWithTag`,
+:c:func:`TIFFFieldWithName`.
+
+Return values
+-------------
+
+:c:func:`TIFFFieldGetSizeSize` returns the field data type size in bytes, or zero if the
+:c:var:`fip` pointer was NULL or the type was invalid.
+
+See also
+--------
+
+:doc:`libtiff`
diff --git a/doc/functions/TIFFRGBAImage.rst b/doc/functions/TIFFRGBAImage.rst
index cd4ea0b1..69bc94a6 100644
--- a/doc/functions/TIFFRGBAImage.rst
+++ b/doc/functions/TIFFRGBAImage.rst
@@ -131,7 +131,7 @@ update the display as the raster is being filled:
}
(the original routine provided by the library is saved in the
-variable :c:var:`putContig`.)
+variable :c:expr:`putContig`.)
Supporting additional TIFF formats
----------------------------------
diff --git a/doc/functions/TIFFReadDirectory.rst b/doc/functions/TIFFReadDirectory.rst
index 751b2701..ec3aebda 100644
--- a/doc/functions/TIFFReadDirectory.rst
+++ b/doc/functions/TIFFReadDirectory.rst
@@ -12,6 +12,8 @@ Synopsis
.. c:function:: int TIFFReadDirectory(TIFF* tif)
+.. c:function:: int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);
+
Description
-----------
diff --git a/doc/functions/TIFFSetField.rst b/doc/functions/TIFFSetField.rst
index b3bf1616..43746c36 100644
--- a/doc/functions/TIFFSetField.rst
+++ b/doc/functions/TIFFSetField.rst
@@ -48,9 +48,9 @@ The data types are:
* - :c:expr:`char*`
- a null-terminated string corresponding to the ``ASCII`` data type
- * - :c:expr:`uint16_t`
+ * - :c:type:`uint16_t`
- an unsigned 16-bit value
- * - :c:expr:`uint32_t`
+ * - :c:type:`uint32_t`
- an unsigned 32-bit value;
* - :c:expr:`uint16_t*`
- an array of unsigned 16-bit values.
@@ -75,15 +75,15 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_BADFAXLINES`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
-
* - :c:macro:`TIFFTAG_BITSPERSAMPLE`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_CLEANFAXDATA`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_COLORMAP`
- 3
@@ -91,11 +91,11 @@ Consult the TIFF specification for information on the meaning of each tag.
- :c:expr:`1<<BitsPerSample` arrays
* - :c:macro:`TIFFTAG_COMPRESSION`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_CONSECUTIVEBADFAXLINES`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
-
* - :c:macro:`TIFFTAG_COPYRIGHT`
- 1
@@ -111,15 +111,15 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_DOTRANGE`
- 2
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_EXTRASAMPLES`
- 2
- - :c:expr:`uint16_t`, :c:expr:`uint16_t*`
+ - :c:type:`uint16_t`, :c:expr:`uint16_t*`
- † count, types array
* - :c:macro:`TIFFTAG_FAXFILLFUNC`
- 1
- - :c:expr:`TIFFFaxFillFunc`
+ - :c:type:`TIFFFaxFillFunc`
- G3/G4 compression pseudo-tag
* - :c:macro:`TIFFTAG_FAXMODE`
- 1
@@ -127,19 +127,19 @@ Consult the TIFF specification for information on the meaning of each tag.
- † G3/G4 compression pseudo-tag
* - :c:macro:`TIFFTAG_FILLORDER`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_GROUP3OPTIONS`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- †
* - :c:macro:`TIFFTAG_GROUP4OPTIONS`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- †
* - :c:macro:`TIFFTAG_HALFTONEHINTS`
- 2
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_HOSTCOMPUTER`
- 1
@@ -147,11 +147,11 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_ICCPROFILE`
- 2
- - :c:expr:`uint32_t`, :c:expr:`void*`
+ - :c:type:`uint32_t`, :c:expr:`void*`
- count, profile data*
* - :c:macro:`TIFFTAG_IMAGEDEPTH`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- †
* - :c:macro:`TIFFTAG_IMAGEDESCRIPTION`
- 1
@@ -159,19 +159,19 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_IMAGELENGTH`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
-
* - :c:macro:`TIFFTAG_IMAGEWIDTH`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- †
* - :c:macro:`TIFFTAG_INKNAMES`
- 2
- - :c:expr:`uint16_t`, :c:expr:`char*`
+ - :c:type:`uint16_t`, :c:expr:`char*`
-
* - :c:macro:`TIFFTAG_INKSET`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_JPEGCOLORMODE`
- 1
@@ -195,15 +195,15 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_MATTEING`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_MAXSAMPLEVALUE`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_MINSAMPLEVALUE`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_MODEL`
- 1
@@ -211,7 +211,7 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_ORIENTATION`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_PAGENAME`
- 1
@@ -219,23 +219,23 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_PAGENUMBER`
- 2
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_PHOTOMETRIC`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_PHOTOSHOP`
- ?
- - :c:expr:`uint32_t`, :c:expr:`void*`
+ - :c:type:`uint32_t`, :c:expr:`void*`
- count, data
* - :c:macro:`TIFFTAG_PLANARCONFIG`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_PREDICTOR`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_PRIMARYCHROMATICITIES`
- 1
@@ -247,23 +247,23 @@ Consult the TIFF specification for information on the meaning of each tag.
- † 6-entry array
* - :c:macro:`TIFFTAG_RESOLUTIONUNIT`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_RICHTIFFIPTC`
- 2
- - :c:expr:`uint32_t`, :c:expr:`void*`
+ - :c:type:`uint32_t`, :c:expr:`void*`
- count, data
* - :c:macro:`TIFFTAG_ROWSPERSTRIP`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- † must be > 0
* - :c:macro:`TIFFTAG_SAMPLEFORMAT`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_SAMPLESPERPIXEL`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- † value must be ≤ 4
* - :c:macro:`TIFFTAG_SMAXSAMPLEVALUE`
- 1
@@ -283,11 +283,11 @@ Consult the TIFF specification for information on the meaning of each tag.
- †
* - :c:macro:`TIFFTAG_SUBFILETYPE`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
-
* - :c:macro:`TIFFTAG_SUBIFD`
- 2
- - :c:expr:`uint16_t`, :c:expr:`uint64_t*`
+ - :c:type:`uint16_t`, :c:expr:`uint64_t*`
- count, offsets array
* - :c:macro:`TIFFTAG_TARGETPRINTER`
- 1
@@ -295,19 +295,19 @@ Consult the TIFF specification for information on the meaning of each tag.
-
* - :c:macro:`TIFFTAG_THRESHHOLDING`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
-
* - :c:macro:`TIFFTAG_TILEDEPTH`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- †
* - :c:macro:`TIFFTAG_TILELENGTH`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- † must be a multiple of 8
* - :c:macro:`TIFFTAG_TILEWIDTH`
- 1
- - :c:expr:`uint32_t`
+ - :c:type:`uint32_t`
- † must be a multiple of 8
* - :c:macro:`TIFFTAG_TRANSFERFUNCTION`
- 1 or 3‡
@@ -319,7 +319,7 @@ Consult the TIFF specification for information on the meaning of each tag.
- 2-entry array
* - :c:macro:`TIFFTAG_XMLPACKET`
- 2
- - :c:expr:`uint32_t`, :c:expr:`void*`
+ - :c:type:`uint32_t`, :c:expr:`void*`
- count, data
* - :c:macro:`TIFFTAG_XPOSITION`
- 1
@@ -335,11 +335,11 @@ Consult the TIFF specification for information on the meaning of each tag.
- † 3-entry array
* - :c:macro:`TIFFTAG_YCBCRPOSITIONING`
- 1
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
- * - :c:macro:`TIFFTAG_YCBCRSAMPLING`
+ * - :c:macro:`TIFFTAG_YCBCRSUBSAMPLING`
- 2
- - :c:expr:`uint16_t`
+ - :c:type:`uint16_t`
- †
* - :c:macro:`TIFFTAG_YPOSITION`
- 1
diff --git a/doc/functions/TIFFWriteRawTile.rst b/doc/functions/TIFFWriteRawTile.rst
index c69575b4..864f1a7e 100644
--- a/doc/functions/TIFFWriteRawTile.rst
+++ b/doc/functions/TIFFWriteRawTile.rst
@@ -10,7 +10,7 @@ Synopsis
#include <tiffio.h>
-.. c:function:: tsize_t TIFFWriteRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_tsize)
+.. c:function:: tsize_t TIFFWriteRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size)
Description
-----------
diff --git a/doc/functions/TIFFfield.rst b/doc/functions/TIFFfield.rst
new file mode 100644
index 00000000..3ebf6a51
--- /dev/null
+++ b/doc/functions/TIFFfield.rst
@@ -0,0 +1,2272 @@
+TIFFfield
+=========
+
+Synopsis
+--------
+
+.. highlight:: c
+
+::
+
+ #include <tiffio.h>
+
+.. c:struct:: TIFFField
+
+.. c:function:: const TIFFField* TIFFFindField(TIFF* tif, uint32_t tag, TIFFDataType dt)
+
+.. c:function:: const TIFFField* TIFFFindFieldByName(TIFF* tif, const char* field_name, TIFFDataType dt)
+
+.. c:function:: const TIFFField* TIFFFieldWithTag(TIFF* tif, uint32_t tag)
+
+.. c:function:: TIFFField* TIFFFieldWithName(TIFF*tif, const char *field_name)
+
+Description
+-----------
+
+The specific information about TIFF tags may be queried using several functions.
+:c:func:`TIFFFindField` may be used to find a field using the tag number and a specific data type. Use
+:c:macro:`TIFF_ANY` to find any type. This is necessary because some tags support use of multiple
+datatypes. :c:func:`TIFFFieldWithTag` is a convenience wrapper function which performs the same
+task as :c:func:`TIFFFindField` but sets the datatype to :c:macro:`TIFF_ANY`.
+
+:c:func:`TIFFFindFieldByName` and :c:func:`TIFFFieldWithName` perform the same duties, but
+use the field name rather than the tag identifier.
+
+Details of the tags supported by LibTIFF are provided in the following sections.
+
+Baseline TIFF tags
+------------------
+
+.. c:macro:: TIFFTAG_SUBFILETYPE
+
+ subfile data descriptor
+
+The follwing subfile types are supported:
+
+ .. c:macro:: FILETYPE_REDUCEDIMAGE
+
+ reduced resolution version
+
+ .. c:macro:: FILETYPE_PAGE
+
+ one page of many
+
+ .. c:macro:: FILETYPE_MASK
+
+ transparency mask
+
+.. c:macro:: TIFFTAG_OSUBFILETYPE
+
+ +kind of data in subfile
+
+The following old subfile types are supported:
+
+ .. c:macro:: OFILETYPE_IMAGE
+
+ full resolution image data
+
+ .. c:macro:: OFILETYPE_REDUCEDIMAGE
+
+ reduced size image data
+
+ .. c:macro:: OFILETYPE_PAGE
+
+ one page of many
+
+.. c:macro:: TIFFTAG_IMAGEWIDTH
+
+ image width in pixels
+
+.. c:macro:: TIFFTAG_IMAGELENGTH
+
+ image height in pixels
+
+.. c:macro:: TIFFTAG_BITSPERSAMPLE
+
+ bits per channel (sample)
+
+.. c:macro:: TIFFTAG_COMPRESSION
+
+ data compression technique
+
+The following compression types are supported:
+
+ .. c:macro:: COMPRESSION_NONE
+
+ dump mode
+
+ .. c:macro:: COMPRESSION_CCITTRLE
+
+ CCITT modified Huffman RLE
+
+ .. c:macro:: COMPRESSION_CCITTFAX3
+
+ CCITT Group 3 fax encoding
+
+ .. c:macro:: COMPRESSION_CCITT_T4
+
+ CCITT T.4 (TIFF 6 name)
+
+ .. c:macro:: COMPRESSION_CCITTFAX4
+
+ CCITT Group 4 fax encoding
+
+ .. c:macro:: COMPRESSION_CCITT_T6
+
+ CCITT T.6 (TIFF 6 name)
+
+ .. c:macro:: COMPRESSION_LZW
+
+ Lempel-Ziv & Welch
+
+ .. c:macro:: COMPRESSION_OJPEG
+
+ !6.0 JPEG
+
+ .. c:macro:: COMPRESSION_JPEG
+
+ %JPEG DCT compression
+
+ .. c:macro:: COMPRESSION_T85
+
+ !TIFF/FX T.85 JBIG compression
+
+ .. c:macro:: COMPRESSION_T43
+
+ !TIFF/FX T.43 colour by layered JBIG compression
+
+ .. c:macro:: COMPRESSION_NEXT
+
+ NeXT 2-bit RLE
+
+ .. c:macro:: COMPRESSION_CCITTRLEW
+
+ #1 w/ word alignment
+
+ .. c:macro:: COMPRESSION_PACKBITS
+
+ Macintosh RLE
+
+ .. c:macro:: COMPRESSION_THUNDERSCAN
+
+ ThunderScan RLE
+
+ codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com)
+
+ .. c:macro:: COMPRESSION_IT8CTPAD
+
+ IT8 CT w/padding
+
+ .. c:macro:: COMPRESSION_IT8LW
+
+ IT8 Linework RLE
+
+ .. c:macro:: COMPRESSION_IT8MP
+
+ IT8 Monochrome picture
+
+ .. c:macro:: COMPRESSION_IT8BL
+
+ IT8 Binary line art
+
+ compression codes 32908-32911 are reserved for Pixar
+
+ .. c:macro:: COMPRESSION_PIXARFILM
+
+ Pixar companded 10bit LZW
+
+ .. c:macro:: COMPRESSION_PIXARLOG
+
+ Pixar companded 11bit ZIP
+
+ .. c:macro:: COMPRESSION_DEFLATE
+
+ Deflate compression, legacy tag
+
+ .. c:macro:: COMPRESSION_ADOBE_DEFLATE
+
+ Deflate compression, as recognized by Adobe
+
+ compression code 32947 is reserved for Oceana Matrix <dev@oceana.com>
+
+ .. c:macro:: COMPRESSION_DCS
+
+ Kodak DCS encoding
+
+ .. c:macro:: COMPRESSION_JBIG
+
+ ISO JBIG
+
+ .. c:macro:: COMPRESSION_SGILOG
+
+ SGI Log Luminance RLE
+
+ .. c:macro:: COMPRESSION_SGILOG24
+
+ SGI Log 24-bit packed
+
+ .. c:macro:: COMPRESSION_JP2000
+
+ Leadtools JPEG2000
+
+ .. c:macro:: COMPRESSION_LERC
+
+ ESRI Lerc codec: https://github.com/Esri/lerc
+
+ compression codes 34887-34889 are reserved for ESRI
+
+ .. c:macro:: COMPRESSION_LZMA
+
+ LZMA2
+
+ .. c:macro:: COMPRESSION_ZSTD
+
+ ZSTD: WARNING not registered in Adobe-maintained registry
+
+ .. c:macro:: COMPRESSION_WEBP
+
+ WEBP: WARNING not registered in Adobe-maintained registry
+
+ .. c:macro:: COMPRESSION_JXL
+
+ JPEGXL: WARNING not registered in Adobe-maintained registry
+
+.. c:macro:: TIFFTAG_PHOTOMETRIC
+
+ photometric interpretation
+
+The following photometric interpretations are supported:
+
+ .. c:macro:: PHOTOMETRIC_MINISWHITE
+
+ min value is white
+
+ .. c:macro:: PHOTOMETRIC_MINISBLACK
+
+ min value is black
+
+ .. c:macro:: PHOTOMETRIC_RGB
+
+ RGB color model
+
+ .. c:macro:: PHOTOMETRIC_PALETTE
+
+ color map indexed
+
+ .. c:macro:: PHOTOMETRIC_MASK
+
+ $holdout mask
+
+ .. c:macro:: PHOTOMETRIC_SEPARATED
+
+ !color separations
+
+ .. c:macro:: PHOTOMETRIC_YCBCR
+
+ !CCIR 601
+
+ .. c:macro:: PHOTOMETRIC_CIELAB
+
+ !1976 CIE L*a*b*
+
+ .. c:macro:: PHOTOMETRIC_ICCLAB
+
+ ICC L*a*b* [Adobe TIFF Technote 4]
+
+ .. c:macro:: PHOTOMETRIC_ITULAB
+
+ ITU L*a*b*
+
+ .. c:macro:: PHOTOMETRIC_CFA
+
+ color filter array
+
+ .. c:macro:: PHOTOMETRIC_LOGL
+
+ CIE Log2(L)
+
+ .. c:macro:: PHOTOMETRIC_LOGLUV
+
+ CIE Log2(L) (u',v')
+
+.. c:macro:: TIFFTAG_THRESHHOLDING
+
+ +thresholding used on data
+
+The following thresholding modes are supported:
+
+ .. c:macro:: THRESHHOLD_BILEVEL
+
+ b&w art scan
+
+ .. c:macro:: THRESHHOLD_HALFTONE
+
+ or dithered scan
+
+ .. c:macro:: THRESHHOLD_ERRORDIFFUSE
+
+ usually floyd-steinberg
+
+.. c:macro:: TIFFTAG_CELLWIDTH
+
+ +dithering matrix width
+
+.. c:macro:: TIFFTAG_CELLLENGTH
+
+ +dithering matrix height
+
+.. c:macro:: TIFFTAG_FILLORDER
+
+ data order within a byte
+
+The following fill orders are supported:
+
+ .. c:macro:: FILLORDER_MSB2LSB
+
+ most significant to least significant
+
+ .. c:macro:: FILLORDER_LSB2MSB
+
+ least significant to most significant
+
+.. c:macro:: TIFFTAG_DOCUMENTNAME
+
+ name of doc. image is from
+
+.. c:macro:: TIFFTAG_IMAGEDESCRIPTION
+
+ info about image
+
+.. c:macro:: TIFFTAG_MAKE
+
+ scanner manufacturer name
+
+.. c:macro:: TIFFTAG_MODEL
+
+ scanner model name/number
+
+.. c:macro:: TIFFTAG_STRIPOFFSETS
+
+ offsets to data strips
+
+.. c:macro:: TIFFTAG_ORIENTATION
+
+ Image orientation
+
+The following orientations are supported:
+
+ .. c:macro:: ORIENTATION_TOPLEFT
+
+ row 0 top, col 0 lhs
+
+ .. c:macro:: ORIENTATION_TOPRIGHT
+
+ row 0 top, col 0 rhs
+
+ .. c:macro:: ORIENTATION_BOTRIGHT
+
+ row 0 bottom, col 0 rhs
+
+ .. c:macro:: ORIENTATION_BOTLEFT
+
+ row 0 bottom, col 0 lhs
+
+ .. c:macro:: ORIENTATION_LEFTTOP
+
+ row 0 lhs, col 0 top
+
+ .. c:macro:: ORIENTATION_RIGHTTOP
+
+ row 0 rhs, col 0 top
+
+ .. c:macro:: ORIENTATION_RIGHTBOT
+
+ row 0 rhs, col 0 bottom
+
+ .. c:macro:: ORIENTATION_LEFTBOT
+
+ row 0 lhs, col 0 bottom
+
+.. c:macro:: TIFFTAG_SAMPLESPERPIXEL
+
+ samples per pixel
+
+.. c:macro:: TIFFTAG_ROWSPERSTRIP
+
+ rows per strip of data
+
+.. c:macro:: TIFFTAG_STRIPBYTECOUNTS
+
+ bytes counts for strips
+
+.. c:macro:: TIFFTAG_MINSAMPLEVALUE
+
+ +minimum sample value
+
+.. c:macro:: TIFFTAG_MAXSAMPLEVALUE
+
+ +maximum sample value
+
+.. c:macro:: TIFFTAG_XRESOLUTION
+
+ pixels/resolution in x
+
+.. c:macro:: TIFFTAG_YRESOLUTION
+
+ pixels/resolution in y
+
+.. c:macro:: TIFFTAG_PLANARCONFIG
+
+ storage organization
+
+The following storage organizations are supported:
+
+ .. c:macro:: PLANARCONFIG_CONTIG
+
+ single image plane
+
+ .. c:macro:: PLANARCONFIG_SEPARATE
+
+ separate planes of data
+
+.. c:macro:: TIFFTAG_PAGENAME
+
+ page name image is from
+
+.. c:macro:: TIFFTAG_XPOSITION
+
+ x page offset of image lhs
+
+.. c:macro:: TIFFTAG_YPOSITION
+
+ y page offset of image lhs
+
+.. c:macro:: TIFFTAG_FREEOFFSETS
+
+ +byte offset to free block
+
+.. c:macro:: TIFFTAG_FREEBYTECOUNTS
+
+ +sizes of free blocks
+
+.. c:macro:: TIFFTAG_GRAYRESPONSEUNIT
+
+ $gray scale curve accuracy
+
+The following gray response units are supported:
+
+ .. c:macro:: GRAYRESPONSEUNIT_10S
+
+ tenths of a unit
+
+ .. c:macro:: GRAYRESPONSEUNIT_100S
+
+ hundredths of a unit
+
+ .. c:macro:: GRAYRESPONSEUNIT_1000S
+
+ thousandths of a unit
+
+ .. c:macro:: GRAYRESPONSEUNIT_10000S
+
+ ten-thousandths of a unit
+
+ .. c:macro:: GRAYRESPONSEUNIT_100000S
+
+ hundred-thousandths
+
+.. c:macro:: TIFFTAG_GRAYRESPONSECURVE
+
+ $gray scale response curve
+
+.. c:macro:: TIFFTAG_GROUP3OPTIONS
+
+ 32 flag bits
+
+.. c:macro:: TIFFTAG_T4OPTIONS
+
+ TIFF 6.0 proper name alias
+
+The following T4 options are supported:
+
+ .. c:macro:: GROUP3OPT_2DENCODING
+
+ 2-dimensional coding
+
+ .. c:macro:: GROUP3OPT_UNCOMPRESSED
+
+ data not compressed
+
+ .. c:macro:: GROUP3OPT_FILLBITS
+
+ fill to byte boundary
+
+.. c:macro:: TIFFTAG_GROUP4OPTIONS
+
+ 32 flag bits
+
+.. c:macro:: TIFFTAG_T6OPTIONS
+
+ TIFF 6.0 proper name
+
+The following T6 options are supported:
+
+ .. c:macro:: GROUP4OPT_UNCOMPRESSED
+
+ data not compressed
+
+.. c:macro:: TIFFTAG_RESOLUTIONUNIT
+
+ units of resolutions
+
+ .. c:macro:: RESUNIT_NONE
+
+ no meaningful units
+
+ .. c:macro:: RESUNIT_INCH
+
+ english
+
+ .. c:macro:: RESUNIT_CENTIMETER
+
+ metric
+
+.. c:macro:: TIFFTAG_PAGENUMBER
+
+ page numbers of multi-page
+
+.. c:macro:: TIFFTAG_COLORRESPONSEUNIT
+
+ $color curve accuracy
+
+The following color response units are supported:
+
+ .. c:macro:: COLORRESPONSEUNIT_10S
+
+ tenths of a unit
+
+ .. c:macro:: COLORRESPONSEUNIT_100S
+
+ hundredths of a unit
+
+ .. c:macro:: COLORRESPONSEUNIT_1000S
+
+ thousandths of a unit
+
+ .. c:macro:: COLORRESPONSEUNIT_10000S
+
+ ten-thousandths of a unit
+
+ .. c:macro:: COLORRESPONSEUNIT_100000S
+
+ hundred-thousandths
+
+.. c:macro:: TIFFTAG_TRANSFERFUNCTION
+
+ !colorimetry info
+
+.. c:macro:: TIFFTAG_SOFTWARE
+
+ name & release
+
+.. c:macro:: TIFFTAG_DATETIME
+
+ creation date and time
+
+.. c:macro:: TIFFTAG_ARTIST
+
+ creator of image
+
+.. c:macro:: TIFFTAG_HOSTCOMPUTER
+
+ machine where created
+
+.. c:macro:: TIFFTAG_PREDICTOR
+
+ prediction scheme w/ LZW
+
+The following predictors are supported:
+
+ .. c:macro:: PREDICTOR_NONE
+
+ no prediction scheme used
+
+ .. c:macro:: PREDICTOR_HORIZONTAL
+
+ horizontal differencing
+
+ .. c:macro:: PREDICTOR_FLOATINGPOINT
+
+ floating point predictor
+
+.. c:macro:: TIFFTAG_WHITEPOINT
+
+ image white point
+
+.. c:macro:: TIFFTAG_PRIMARYCHROMATICITIES
+
+ !primary chromaticities
+
+.. c:macro:: TIFFTAG_COLORMAP
+
+ RGB map for palette image
+
+.. c:macro:: TIFFTAG_HALFTONEHINTS
+
+ !highlight+shadow info
+
+.. c:macro:: TIFFTAG_TILEWIDTH
+
+ !tile width in pixels
+
+.. c:macro:: TIFFTAG_TILELENGTH
+
+ !tile height in pixels
+
+.. c:macro:: TIFFTAG_TILEOFFSETS
+
+ !offsets to data tiles
+
+.. c:macro:: TIFFTAG_TILEBYTECOUNTS
+
+ !byte counts for tiles
+
+.. c:macro:: TIFFTAG_BADFAXLINES
+
+ lines w/ wrong pixel count
+
+.. c:macro:: TIFFTAG_CLEANFAXDATA
+
+ regenerated line info
+
+The following clean fax data options are supported:
+
+ .. c:macro:: CLEANFAXDATA_CLEAN
+
+ no errors detected
+
+ .. c:macro:: CLEANFAXDATA_REGENERATED
+
+ receiver regenerated lines
+
+ .. c:macro:: CLEANFAXDATA_UNCLEAN
+
+ uncorrected errors exist
+
+.. c:macro:: TIFFTAG_CONSECUTIVEBADFAXLINES
+
+ max consecutive bad lines
+
+.. c:macro:: TIFFTAG_SUBIFD
+
+ subimage descriptors
+
+.. c:macro:: TIFFTAG_INKSET
+
+ !inks in separated image
+
+The following inksets are supported:
+
+ .. c:macro:: INKSET_CMYK
+
+ !cyan-magenta-yellow-black color
+
+ .. c:macro:: INKSET_MULTIINK
+
+ !multi-ink or hi-fi color
+
+.. c:macro:: TIFFTAG_INKNAMES
+
+ !ascii names of inks
+
+.. c:macro:: TIFFTAG_NUMBEROFINKS
+
+ !number of inks
+
+.. c:macro:: TIFFTAG_DOTRANGE
+
+ !0% and 100% dot codes
+
+.. c:macro:: TIFFTAG_TARGETPRINTER
+
+ !separation target
+
+.. c:macro:: TIFFTAG_EXTRASAMPLES
+
+ !info about extra samples
+
+The following extra samples options are supported:
+
+ .. c:macro:: EXTRASAMPLE_UNSPECIFIED
+
+ !unspecified data
+
+ .. c:macro:: EXTRASAMPLE_ASSOCALPHA
+
+ !associated alpha data
+
+ .. c:macro:: EXTRASAMPLE_UNASSALPHA
+
+ !unassociated alpha data
+
+.. c:macro:: TIFFTAG_SAMPLEFORMAT
+
+ !data sample format
+
+The following sample formats are supported:
+
+ .. c:macro:: SAMPLEFORMAT_UINT
+
+ !unsigned integer data
+
+ .. c:macro:: SAMPLEFORMAT_INT
+
+ !signed integer data
+
+ .. c:macro:: SAMPLEFORMAT_IEEEFP
+
+ !IEEE floating point data
+
+ .. c:macro:: SAMPLEFORMAT_VOID
+
+ !untyped data
+
+ .. c:macro:: SAMPLEFORMAT_COMPLEXINT
+
+ !complex signed int
+
+ .. c:macro:: SAMPLEFORMAT_COMPLEXIEEEFP
+
+ !complex ieee floating
+
+.. c:macro:: TIFFTAG_SMINSAMPLEVALUE
+
+ !variable MinSampleValue
+
+.. c:macro:: TIFFTAG_SMAXSAMPLEVALUE
+
+ !variable MaxSampleValue
+
+.. c:macro:: TIFFTAG_CLIPPATH
+
+ %ClipPath [Adobe TIFF technote 2]
+
+.. c:macro:: TIFFTAG_XCLIPPATHUNITS
+
+ %XClipPathUnits [Adobe TIFF technote 2]
+
+.. c:macro:: TIFFTAG_YCLIPPATHUNITS
+
+ %YClipPathUnits [Adobe TIFF technote 2]
+
+.. c:macro:: TIFFTAG_INDEXED
+
+ %Indexed [Adobe TIFF Technote 3]
+
+.. c:macro:: TIFFTAG_JPEGTABLES
+
+ %JPEG table stream
+
+.. c:macro:: TIFFTAG_OPIPROXY
+
+ %OPI Proxy [Adobe TIFF technote]
+
+ Tags 400-435 are from the TIFF/FX spec
+
+.. c:macro:: TIFFTAG_GLOBALPARAMETERSIFD
+
+ !
+
+.. c:macro:: TIFFTAG_PROFILETYPE
+
+ !
+
+The following profile types are supported:
+
+ .. c:macro:: PROFILETYPE_UNSPECIFIED
+
+ !
+
+ .. c:macro:: PROFILETYPE_G3_FAX
+
+ !
+
+.. c:macro:: TIFFTAG_FAXPROFILE
+
+ !
+
+The following fax profiles are supported:
+
+ .. c:macro:: FAXPROFILE_S
+
+ !TIFF/FX FAX profile S
+
+ .. c:macro:: FAXPROFILE_F
+
+ !TIFF/FX FAX profile F
+
+ .. c:macro:: FAXPROFILE_J
+
+ !TIFF/FX FAX profile J
+
+ .. c:macro:: FAXPROFILE_C
+
+ !TIFF/FX FAX profile C
+
+ .. c:macro:: FAXPROFILE_L
+
+ !TIFF/FX FAX profile L
+
+ .. c:macro:: FAXPROFILE_M
+
+ !TIFF/FX FAX profile LM
+
+.. c:macro:: TIFFTAG_CODINGMETHODS
+
+ !TIFF/FX coding methods
+
+The following coding methods are supported:
+
+ .. c:macro:: CODINGMETHODS_T4_1D
+
+ !T.4 1D
+
+ .. c:macro:: CODINGMETHODS_T4_2D
+
+ !T.4 2D
+
+ .. c:macro:: CODINGMETHODS_T6
+
+ !T.6
+
+ .. c:macro:: CODINGMETHODS_T85
+
+ !T.85 JBIG
+
+ .. c:macro:: CODINGMETHODS_T42
+
+ !T.42 JPEG
+
+ .. c:macro:: CODINGMETHODS_T43
+
+ !T.43 colour by layered JBIG
+
+.. c:macro:: TIFFTAG_VERSIONYEAR
+
+ !TIFF/FX version year
+
+.. c:macro:: TIFFTAG_MODENUMBER
+
+ !TIFF/FX mode number
+
+.. c:macro:: TIFFTAG_DECODE
+
+ !TIFF/FX decode
+
+.. c:macro:: TIFFTAG_IMAGEBASECOLOR
+
+ !TIFF/FX image base colour
+
+.. c:macro:: TIFFTAG_T82OPTIONS
+
+ !TIFF/FX T.82 options
+
+.. note::
+
+ Tags 512-521 are obsoleted by Technical Note #2 which specifies a revised JPEG-in-TIFF scheme.
+
+.. c:macro:: TIFFTAG_JPEGPROC
+
+ !JPEG processing algorithm
+
+The following JPEG processing algortithms are supported:
+
+ .. c:macro:: JPEGPROC_BASELINE
+
+ !baseline sequential
+
+ .. c:macro:: JPEGPROC_LOSSLESS
+
+ !Huffman coded lossless
+
+.. c:macro:: TIFFTAG_JPEGIFOFFSET
+
+ !pointer to SOI marker
+
+.. c:macro:: TIFFTAG_JPEGIFBYTECOUNT
+
+ !JFIF stream length
+
+.. c:macro:: TIFFTAG_JPEGRESTARTINTERVAL
+
+ !restart interval length
+
+.. c:macro:: TIFFTAG_JPEGLOSSLESSPREDICTORS
+
+ !lossless proc predictor
+
+.. c:macro:: TIFFTAG_JPEGPOINTTRANSFORM
+
+ !lossless point transform
+
+.. c:macro:: TIFFTAG_JPEGQTABLES
+
+ !Q matrix offsets
+
+.. c:macro:: TIFFTAG_JPEGDCTABLES
+
+ !DCT table offsets
+
+.. c:macro:: TIFFTAG_JPEGACTABLES
+
+ !AC coefficient offsets
+
+.. c:macro:: TIFFTAG_YCBCRCOEFFICIENTS
+
+ !RGB -> YCbCr transform
+
+.. c:macro:: TIFFTAG_YCBCRSUBSAMPLING
+
+ !YCbCr subsampling factors
+
+.. c:macro:: TIFFTAG_YCBCRPOSITIONING
+
+ !subsample positioning
+
+The following YCbCr positioning options are supported:
+
+ .. c:macro:: YCBCRPOSITION_CENTERED
+
+ !as in PostScript Level 2
+
+ .. c:macro:: YCBCRPOSITION_COSITED
+
+ !as in CCIR 601-1
+
+.. c:macro:: TIFFTAG_REFERENCEBLACKWHITE
+
+ !colorimetry info
+
+.. c:macro:: TIFFTAG_STRIPROWCOUNTS
+
+ !TIFF/FX strip row counts
+
+.. c:macro:: TIFFTAG_XMLPACKET
+
+ %XML packet [Adobe XMP Specification, January 2004
+
+.. c:macro:: TIFFTAG_OPIIMAGEID
+
+ %OPI ImageID Adobe TIFF technote]
+
+.. c:macro:: TIFFTAG_TIFFANNOTATIONDATA
+
+ http://web.archive.org/web/20050309141348/http://www.kofile.com/support%20pro/faqs/annospec.htm
+
+ tags 32952-32956 are private tags registered to Island Graphics
+
+.. c:macro:: TIFFTAG_REFPTS
+
+ image reference points
+
+.. c:macro:: TIFFTAG_REGIONTACKPOINT
+
+ region-xform tack point
+
+.. c:macro:: TIFFTAG_REGIONWARPCORNERS
+
+ warp quadrilateral
+
+.. c:macro:: TIFFTAG_REGIONAFFINE
+
+ affine transformation mat
+
+ tags 32995-32999 are private tags registered to SGI
+
+.. c:macro:: TIFFTAG_MATTEING
+
+ $use ExtraSamples
+
+.. c:macro:: TIFFTAG_DATATYPE
+
+ $use SampleFormat
+
+.. c:macro:: TIFFTAG_IMAGEDEPTH
+
+ z depth of image
+
+.. c:macro:: TIFFTAG_TILEDEPTH
+
+ z depth/data tile
+
+tags 33300-33309 are private tags registered to Pixar
+
+:c:macro:`TIFFTAG_PIXAR_IMAGEFULLWIDTH` and :c:macro:`TIFFTAG_PIXAR_IMAGEFULLLENGTH`
+are set when an image has been cropped out of a larger image.
+They reflect the size of the original uncropped image.
+The :c:macro:`TIFFTAG_XPOSITION` and :c:macro:`TIFFTAG_YPOSITION` can be used
+to determine the position of the smaller image in the larger one.
+
+.. c:macro:: TIFFTAG_PIXAR_IMAGEFULLWIDTH
+
+ full image size in x
+
+.. c:macro:: TIFFTAG_PIXAR_IMAGEFULLLENGTH
+
+ full image size in y
+
+Tags 33302-33306 are used to identify special image modes and data
+used by Pixar's texture formats.
+
+.. c:macro:: TIFFTAG_PIXAR_TEXTUREFORMAT
+
+ texture map format
+
+.. c:macro:: TIFFTAG_PIXAR_WRAPMODES
+
+ s & t wrap modes
+
+.. c:macro:: TIFFTAG_PIXAR_FOVCOT
+
+ cotan(fov) for env. maps
+
+.. c:macro:: TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN
+.. c:macro:: TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA
+
+tag 33405 is a private tag registered to Eastman Kodak
+
+.. c:macro:: TIFFTAG_WRITERSERIALNUMBER
+
+ device serial number
+
+.. c:macro:: TIFFTAG_CFAREPEATPATTERNDIM
+
+ dimensions of CFA pattern
+
+.. c:macro:: TIFFTAG_CFAPATTERN
+
+ color filter array pattern
+
+ tag 33432 is listed in the 6.0 spec w/ unknown ownership
+
+.. c:macro:: TIFFTAG_COPYRIGHT
+
+ copyright string
+
+Tags 33445-33452 are used for GEL fileformat, see
+http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_FILETAG
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_SCALEPIXEL
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_COLORTABLE
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_LABNAME
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_SAMPLEINFO
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_PREPDATE
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_PREPTIME
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+.. c:macro:: TIFFTAG_MD_FILEUNITS
+
+ http://research.stowers-institute.org/mcm/efg/ScientificSoftware/Utility/TiffTags/GEL-FileFormat.pdf
+
+IPTC TAG from RichTIFF specifications
+
+.. c:macro:: TIFFTAG_RICHTIFFIPTC
+
+.. c:macro:: TIFFTAG_INGR_PACKET_DATA_TAG
+
+ Intergraph Application specific storage.
+
+.. c:macro:: TIFFTAG_INGR_FLAG_REGISTERS
+
+ Intergraph Application specific flags.
+
+.. c:macro:: TIFFTAG_IRASB_TRANSORMATION_MATRIX
+
+ Originally part of Intergraph's GeoTIFF tags, but likely understood by IrasB only.
+
+.. c:macro:: TIFFTAG_MODELTIEPOINTTAG
+
+ GeoTIFF
+
+34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com)
+
+.. c:macro:: TIFFTAG_IT8SITE
+
+ site name
+
+.. c:macro:: TIFFTAG_IT8COLORSEQUENCE
+
+ color seq. [RGB,CMYK,etc]
+
+.. c:macro:: TIFFTAG_IT8HEADER
+
+ DDES Header
+
+.. c:macro:: TIFFTAG_IT8RASTERPADDING
+
+ raster scanline padding
+
+.. c:macro:: TIFFTAG_IT8BITSPERRUNLENGTH
+
+ # of bits in short run
+
+ .. c:macro:: TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH
+
+ # of bits in long run
+
+.. c:macro:: TIFFTAG_IT8COLORTABLE
+
+ LW colortable
+
+.. c:macro:: TIFFTAG_IT8IMAGECOLORINDICATOR
+
+ BP/BL image color switch
+
+.. c:macro:: TIFFTAG_IT8BKGCOLORINDICATOR
+
+ BP/BL bg color switch
+
+.. c:macro:: TIFFTAG_IT8IMAGECOLORVALUE
+
+ BP/BL image color value
+
+.. c:macro:: TIFFTAG_IT8BKGCOLORVALUE
+
+ BP/BL bg color value
+
+.. c:macro:: TIFFTAG_IT8PIXELINTENSITYRANGE
+
+ MP pixel intensity value
+
+.. c:macro:: TIFFTAG_IT8TRANSPARENCYINDICATOR
+
+ HC transparency switch
+
+.. c:macro:: TIFFTAG_IT8COLORCHARACTERIZATION
+
+ color character. table
+
+.. c:macro:: TIFFTAG_IT8HCUSAGE
+
+ HC usage indicator
+
+ .. c:macro:: TIFFTAG_IT8TRAPINDICATOR
+
+ Trapping indicator (untrapped=0, trapped=1)
+
+.. c:macro:: TIFFTAG_IT8CMYKEQUIVALENT
+
+ CMYK color equivalents
+
+tags 34232-34236 are private tags registered to Texas Instruments
+
+.. c:macro:: TIFFTAG_FRAMECOUNT
+
+ Sequence Frame Count
+
+.. c:macro:: TIFFTAG_MODELTRANSFORMATIONTAG
+
+ Used in interchangeable GeoTIFF files
+
+ tag 34377 is private tag registered to Adobe for PhotoShop
+
+.. c:macro:: TIFFTAG_PHOTOSHOP
+
+ tags 34665, 34853 and 40965 are documented in EXIF specification
+
+.. c:macro:: TIFFTAG_EXIFIFD
+
+ Pointer to EXIF private directory
+
+ tag 34750 is a private tag registered to Adobe?
+
+.. c:macro:: TIFFTAG_ICCPROFILE
+
+ ICC profile data
+
+.. c:macro:: TIFFTAG_IMAGELAYER
+
+ !TIFF/FX image layer information
+
+ tag 34750 is a private tag registered to Pixel Magic
+
+.. c:macro:: TIFFTAG_JBIGOPTIONS
+
+ JBIG options
+
+.. c:macro:: TIFFTAG_GPSIFD
+
+ Pointer to GPS private directory
+
+tags 34908-34914 are private tags registered to SGI
+
+.. c:macro:: TIFFTAG_FAXRECVPARAMS
+
+ encoded Class 2 ses. params
+
+.. c:macro:: TIFFTAG_FAXSUBADDRESS
+
+ received SubAddr string
+
+.. c:macro:: TIFFTAG_FAXRECVTIME
+
+ receive time (secs)
+
+.. c:macro:: TIFFTAG_FAXDCS
+
+ encoded fax ses. params, Table 2/T.30
+
+tags 37439-37443 are registered to SGI <gregl@sgi.com>
+
+.. c:macro:: TIFFTAG_STONITS
+
+ Sample value to Nits
+
+tag 34929 is a private tag registered to FedEx
+
+.. c:macro:: TIFFTAG_FEDEX_EDR
+
+ unknown use
+
+.. c:macro:: TIFFTAG_IMAGESOURCEDATA
+
+ http://justsolve.archiveteam.org/wiki/PSD, http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
+
+.. c:macro:: TIFFTAG_INTEROPERABILITYIFD
+
+ Pointer to Interoperability private directory
+
+.. c:macro:: TIFFTAG_GDAL_METADATA
+
+ Used by the GDAL library
+
+.. c:macro:: TIFFTAG_GDAL_NODATA
+
+ Used by the GDAL library
+
+.. c:macro:: TIFFTAG_OCE_SCANJOB_DESCRIPTION
+
+ Used in the Oce scanning process
+
+.. c:macro:: TIFFTAG_OCE_APPLICATION_SELECTOR
+
+ Used in the Oce scanning process.
+
+.. c:macro:: TIFFTAG_OCE_IDENTIFICATION_NUMBER
+
+.. c:macro:: TIFFTAG_OCE_IMAGELOGIC_CHARACTERISTICS
+
+tags 50674 to 50677 are reserved for ESRI
+
+.. c:macro:: TIFFTAG_LERC_PARAMETERS
+
+ Stores LERC version and additional compression method
+
+ Adobe Digital Negative (DNG) format tags
+
+.. c:macro:: TIFFTAG_DNGVERSION
+
+ &DNG version number
+
+.. c:macro:: TIFFTAG_DNGBACKWARDVERSION
+
+ &DNG compatibility version
+
+.. c:macro:: TIFFTAG_UNIQUECAMERAMODEL
+
+ &name for the camera model
+
+.. c:macro:: TIFFTAG_LOCALIZEDCAMERAMODEL
+
+ &localized camera model name
+
+.. c:macro:: TIFFTAG_CFAPLANECOLOR
+
+ &CFAPattern->LinearRaw space mapping
+
+.. c:macro:: TIFFTAG_CFALAYOUT
+
+ &spatial layout of the CFA
+
+.. c:macro:: TIFFTAG_LINEARIZATIONTABLE
+
+ &lookup table description
+
+.. c:macro:: TIFFTAG_BLACKLEVELREPEATDIM
+
+ &repeat pattern size for the BlackLevel tag
+
+.. c:macro:: TIFFTAG_BLACKLEVEL
+
+ &zero light encoding level
+
+.. c:macro:: TIFFTAG_BLACKLEVELDELTAH
+
+ &zero light encoding level differences (columns)
+
+.. c:macro:: TIFFTAG_BLACKLEVELDELTAV
+
+ &zero light encoding level differences (rows)
+
+.. c:macro:: TIFFTAG_WHITELEVEL
+
+ &fully saturated encoding level
+
+.. c:macro:: TIFFTAG_DEFAULTSCALE
+
+ &default scale factors
+
+.. c:macro:: TIFFTAG_DEFAULTCROPORIGIN
+
+ &origin of the final image area
+
+.. c:macro:: TIFFTAG_DEFAULTCROPSIZE
+
+ &size of the final image area
+
+.. c:macro:: TIFFTAG_COLORMATRIX1
+
+ &XYZ->reference color space transformation matrix 1
+
+.. c:macro:: TIFFTAG_COLORMATRIX2
+
+ &XYZ->reference color space transformation matrix 2
+
+.. c:macro:: TIFFTAG_CAMERACALIBRATION1
+
+ &calibration matrix 1
+
+.. c:macro:: TIFFTAG_CAMERACALIBRATION2
+
+ &calibration matrix 2
+
+.. c:macro:: TIFFTAG_REDUCTIONMATRIX1
+
+ &dimensionality reduction matrix 1
+
+.. c:macro:: TIFFTAG_REDUCTIONMATRIX2
+
+ &dimensionality reduction matrix 2
+
+.. c:macro:: TIFFTAG_ANALOGBALANCE
+
+ &gain applied the stored raw values
+
+.. c:macro:: TIFFTAG_ASSHOTNEUTRAL
+
+ &selected white balance in linear reference space
+
+.. c:macro:: TIFFTAG_ASSHOTWHITEXY
+
+ &selected white balance in x-y chromaticity coordinates
+
+.. c:macro:: TIFFTAG_BASELINEEXPOSURE
+
+ &how much to move the zero point
+
+.. c:macro:: TIFFTAG_BASELINENOISE
+
+ &relative noise level
+
+.. c:macro:: TIFFTAG_BASELINESHARPNESS
+
+ &relative amount of sharpening
+
+.. c:macro:: TIFFTAG_BAYERGREENSPLIT
+
+ &how closely the values of the green pixels in the blue/green rows track the values of the green pixels in the red/green rows
+
+.. c:macro:: TIFFTAG_LINEARRESPONSELIMIT
+
+ &non-linear encoding range
+
+.. c:macro:: TIFFTAG_CAMERASERIALNUMBER
+
+ &camera's serial number
+
+.. c:macro:: TIFFTAG_LENSINFO
+
+ info about the lens
+
+.. c:macro:: TIFFTAG_CHROMABLURRADIUS
+
+ &chroma blur radius
+
+.. c:macro:: TIFFTAG_ANTIALIASSTRENGTH
+
+ &relative strength of the camera's anti-alias filter
+
+.. c:macro:: TIFFTAG_SHADOWSCALE
+
+ &used by Adobe Camera Raw
+
+.. c:macro:: TIFFTAG_DNGPRIVATEDATA
+
+ &manufacturer's private data
+
+.. c:macro:: TIFFTAG_MAKERNOTESAFETY
+
+ &whether the EXIF MakerNote tag is safe to preserve along with the rest of the EXIF data
+
+.. c:macro:: TIFFTAG_CALIBRATIONILLUMINANT1
+
+ &illuminant 1
+
+.. c:macro:: TIFFTAG_CALIBRATIONILLUMINANT2
+
+ &illuminant 2
+
+.. c:macro:: TIFFTAG_BESTQUALITYSCALE
+
+ &best quality multiplier
+
+.. c:macro:: TIFFTAG_RAWDATAUNIQUEID
+
+ &unique identifier for the raw image data
+
+.. c:macro:: TIFFTAG_ORIGINALRAWFILENAME
+
+ &file name of the original raw file
+
+.. c:macro:: TIFFTAG_ORIGINALRAWFILEDATA
+
+ &contents of the original raw file
+
+.. c:macro:: TIFFTAG_ACTIVEAREA
+
+ &active (non-masked) pixels of the sensor
+
+.. c:macro:: TIFFTAG_MASKEDAREAS
+
+ &list of coordinates of fully masked pixels
+
+.. c:macro:: TIFFTAG_ASSHOTICCPROFILE
+
+ &these two tags used to
+
+.. c:macro:: TIFFTAG_ASSHOTPREPROFILEMATRIX
+
+ map cameras's color space into ICC profile space
+
+.. c:macro:: TIFFTAG_CURRENTICCPROFILE
+
+ &
+
+.. c:macro:: TIFFTAG_CURRENTPREPROFILEMATRIX
+
+ &
+
+.. c:macro:: TIFFTAG_RPCCOEFFICIENT
+
+ Define by GDAL for geospatial georeferencing through RPC: http://geotiff.maptools.org/rpc_prop.html
+
+
+.. c:macro:: TIFFTAG_ALIAS_LAYER_METADATA
+
+ Alias Sketchbook Pro layer usage description.
+
+
+ GeoTIFF DGIWG
+
+.. c:macro:: TIFFTAG_TIFF_RSID
+
+ https://www.awaresystems.be/imaging/tiff/tifftags/tiff_rsid.html
+
+.. c:macro:: TIFFTAG_GEO_METADATA
+
+ https://www.awaresystems.be/imaging/tiff/tifftags/geo_metadata.html
+
+
+.. c:macro:: TIFFTAG_EXTRACAMERAPROFILES
+
+ http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/photoshop/pdfs/dng_spec_1.4.0.0.pdf
+
+
+ tag 65535 is an undefined tag used by Eastman Kodak
+
+.. c:macro:: TIFFTAG_DCSHUESHIFTVALUES
+
+ hue shift correction data
+
+"Pseudo-tags"
+-------------
+
+The following are "pseudo-tags" that can be used to control
+codec-specific functionality. These tags are not written to file.
+Note that these values start at 0xffff+1 so that they'll never
+collide with Aldus-assigned tags.
+
+If you want your private pseudo tags "registered" (i.e. added to
+this file), please post a bug report (see :doc:`/project/bugs`)
+with the appropriate C definitions to add.
+
+.. c:macro:: TIFFTAG_FAXMODE
+
+ Group 3/4 format control
+
+The following fax modes are supported:
+
+.. c:macro:: FAXMODE_CLASSIC
+
+ default, include RTC
+
+.. c:macro:: FAXMODE_NORTC
+
+ no RTC at end of data
+
+.. c:macro:: FAXMODE_NOEOL
+
+ no EOL code at end of row
+
+.. c:macro:: FAXMODE_BYTEALIGN
+
+ byte align row
+
+.. c:macro:: FAXMODE_WORDALIGN
+
+ word align row
+
+.. c:macro:: FAXMODE_CLASSF
+
+ TIFF Class F
+
+.. c:macro:: TIFFTAG_JPEGQUALITY
+
+ Compression quality level
+
+ Note: quality level is on the IJG 0-100 scale. Default value is 75
+
+.. c:macro:: TIFFTAG_JPEGCOLORMODE
+
+ Auto RGB<=>YCbCr convert?
+
+The following JPEG color modes are supported:
+
+.. c:macro:: JPEGCOLORMODE_RAW
+
+ no conversion (default)
+
+.. c:macro:: JPEGCOLORMODE_RGB
+
+ do auto conversion
+
+.. c:macro:: TIFFTAG_JPEGTABLESMODE
+
+ What to put in JPEGTables
+
+The following JPEG tables modes are supported:
+
+.. c:macro:: JPEGTABLESMODE_QUANT
+
+ include quantization tbls
+
+.. c:macro:: JPEGTABLESMODE_HUFF
+
+ include Huffman tbls
+
+Note: default is :c:expr:`JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF`
+
+.. c:macro:: TIFFTAG_FAXFILLFUNC
+
+ G3/G4 fill function
+
+.. c:macro:: TIFFTAG_PIXARLOGDATAFMT
+
+ PixarLogCodec I/O data sz
+
+The following PixarLog data formats are supported:
+
+.. c:macro:: PIXARLOGDATAFMT_8BIT
+
+ regular u_char samples
+
+.. c:macro:: PIXARLOGDATAFMT_8BITABGR
+
+ ABGR-order u_chars
+
+.. c:macro:: PIXARLOGDATAFMT_11BITLOG
+
+ 11-bit log-encoded (raw)
+
+.. c:macro:: PIXARLOGDATAFMT_12BITPICIO
+
+ as per PICIO (1.0==2048)
+
+.. c:macro:: PIXARLOGDATAFMT_16BIT
+
+ signed short samples
+
+.. c:macro:: PIXARLOGDATAFMT_FLOAT
+
+ IEEE float samples
+
+ 65550-65556 are allocated to Oceana Matrix <dev@oceana.com>
+
+.. c:macro:: TIFFTAG_DCSIMAGERTYPE
+
+ imager model & filter
+
+The following DCS imager types are supported:
+
+.. c:macro:: DCSIMAGERMODEL_M3
+
+ M3 chip (1280 x 1024)
+
+.. c:macro:: DCSIMAGERMODEL_M5
+
+ M5 chip (1536 x 1024)
+
+.. c:macro:: DCSIMAGERMODEL_M6
+
+ M6 chip (3072 x 2048)
+
+.. c:macro:: DCSIMAGERFILTER_IR
+
+ infrared filter
+
+.. c:macro:: DCSIMAGERFILTER_MONO
+
+ monochrome filter
+
+.. c:macro:: DCSIMAGERFILTER_CFA
+
+ color filter array
+
+.. c:macro:: DCSIMAGERFILTER_OTHER
+
+ other filter
+
+.. c:macro:: TIFFTAG_DCSINTERPMODE
+
+ interpolation mode
+
+The following DCS interpolation modes are supported:
+
+.. c:macro:: DCSINTERPMODE_NORMAL
+
+ whole image, default
+
+.. c:macro:: DCSINTERPMODE_PREVIEW
+
+ preview of image (384x256)
+
+.. c:macro:: TIFFTAG_DCSBALANCEARRAY
+
+ color balance values
+
+.. c:macro:: TIFFTAG_DCSCORRECTMATRIX
+
+ color correction values
+
+.. c:macro:: TIFFTAG_DCSGAMMA
+
+ gamma value
+
+.. c:macro:: TIFFTAG_DCSTOESHOULDERPTS
+
+ toe & shoulder points
+
+.. c:macro:: TIFFTAG_DCSCALIBRATIONFD
+
+ calibration file desc
+
+ Note: quality level is on the ZLIB 1-9 scale. Default value is -1
+
+.. c:macro:: TIFFTAG_ZIPQUALITY
+
+ compression quality level
+
+.. c:macro:: TIFFTAG_PIXARLOGQUALITY
+
+ PixarLog uses same scale
+
+ 65559 is allocated to Oceana Matrix <dev@oceana.com>
+
+.. c:macro:: TIFFTAG_DCSCLIPRECTANGLE
+
+ area of image to acquire
+
+.. c:macro:: TIFFTAG_SGILOGDATAFMT
+
+ SGILog user data format
+
+The following SGILog data formats are supported:
+
+.. c:macro:: SGILOGDATAFMT_FLOAT
+
+ IEEE float samples
+
+.. c:macro:: SGILOGDATAFMT_16BIT
+
+ 16-bit samples
+
+.. c:macro:: SGILOGDATAFMT_RAW
+
+ uninterpreted data
+
+.. c:macro:: SGILOGDATAFMT_8BIT
+
+ 8-bit RGB monitor values
+
+.. c:macro:: TIFFTAG_SGILOGENCODE
+
+ SGILog data encoding control
+
+The following SGILog data encodings are supported:
+
+.. c:macro:: SGILOGENCODE_NODITHER
+
+ do not dither encoded values
+
+.. c:macro:: SGILOGENCODE_RANDITHER
+
+ randomly dither encd values
+
+.. c:macro:: TIFFTAG_LZMAPRESET
+
+ LZMA2 preset (compression level)
+
+.. c:macro:: TIFFTAG_PERSAMPLE
+
+ interface for per sample tags
+
+The following persample options are supported:
+
+.. c:macro:: PERSAMPLE_MERGED
+
+ present as a single value
+
+.. c:macro:: PERSAMPLE_MULTI
+
+ present as multiple values
+
+.. c:macro:: TIFFTAG_ZSTD_LEVEL
+
+ ZSTD compression level
+
+.. c:macro:: TIFFTAG_LERC_VERSION
+
+ LERC version
+
+ .. c:macro:: LERC_VERSION_2_4
+
+.. c:macro:: TIFFTAG_LERC_ADD_COMPRESSION
+
+ LERC additional compression
+
+The following LERC compression options are supported:
+
+.. c:macro:: LERC_ADD_COMPRESSION_NONE
+.. c:macro:: LERC_ADD_COMPRESSION_DEFLATE
+.. c:macro:: LERC_ADD_COMPRESSION_ZSTD
+
+.. c:macro:: TIFFTAG_LERC_MAXZERROR
+
+ LERC maximum error
+
+.. c:macro:: TIFFTAG_WEBP_LEVEL
+
+ WebP compression level
+
+.. c:macro:: TIFFTAG_WEBP_LOSSLESS
+
+ WebP lossless/lossy
+
+.. c:macro:: TIFFTAG_DEFLATE_SUBCODEC
+
+ ZIP codec: to get/set the sub-codec to use. Will default to libdeflate when available
+
+The following Deflate subcoded options are supported:
+
+.. c:macro:: DEFLATE_SUBCODEC_ZLIB
+.. c:macro:: DEFLATE_SUBCODEC_LIBDEFLATE
+
+EXIF tags
+---------
+
+.. c:macro:: EXIFTAG_EXPOSURETIME
+
+ Exposure time
+
+.. c:macro:: EXIFTAG_FNUMBER
+
+ F number
+
+.. c:macro:: EXIFTAG_EXPOSUREPROGRAM
+
+ Exposure program
+
+.. c:macro:: EXIFTAG_SPECTRALSENSITIVITY
+
+ Spectral sensitivity
+
+.. c:macro:: EXIFTAG_ISOSPEEDRATINGS
+
+ ISO speed rating
+
+.. c:macro:: EXIFTAG_PHOTOGRAPHICSENSITIVITY
+
+ Photographic Sensitivity (new name for tag 34855)
+
+.. c:macro:: EXIFTAG_OECF
+
+ Optoelectric conversion factor
+
+.. c:macro:: EXIFTAG_EXIFVERSION
+
+ Exif version
+
+.. c:macro:: EXIFTAG_DATETIMEORIGINAL
+
+ Date and time of original data generation
+
+.. c:macro:: EXIFTAG_DATETIMEDIGITIZED
+
+ Date and time of digital data generation
+
+.. c:macro:: EXIFTAG_COMPONENTSCONFIGURATION
+
+ Meaning of each component
+
+.. c:macro:: EXIFTAG_COMPRESSEDBITSPERPIXEL
+
+ Image compression mode
+
+.. c:macro:: EXIFTAG_SHUTTERSPEEDVALUE
+
+ Shutter speed
+
+.. c:macro:: EXIFTAG_APERTUREVALUE
+
+ Aperture
+
+.. c:macro:: EXIFTAG_BRIGHTNESSVALUE
+
+ Brightness
+
+.. c:macro:: EXIFTAG_EXPOSUREBIASVALUE
+
+ Exposure bias
+
+.. c:macro:: EXIFTAG_MAXAPERTUREVALUE
+
+ Maximum lens aperture
+
+.. c:macro:: EXIFTAG_SUBJECTDISTANCE
+
+ Subject distance
+
+.. c:macro:: EXIFTAG_METERINGMODE
+
+ Metering mode
+
+.. c:macro:: EXIFTAG_LIGHTSOURCE
+
+ Light source
+
+.. c:macro:: EXIFTAG_FLASH
+
+ Flash
+
+.. c:macro:: EXIFTAG_FOCALLENGTH
+
+ Lens focal length
+
+.. c:macro:: EXIFTAG_SUBJECTAREA
+
+ Subject area
+
+.. c:macro:: EXIFTAG_MAKERNOTE
+
+ Manufacturer notes
+
+.. c:macro:: EXIFTAG_USERCOMMENT
+
+ User comments
+
+.. c:macro:: EXIFTAG_SUBSECTIME
+
+ DateTime subseconds
+
+.. c:macro:: EXIFTAG_SUBSECTIMEORIGINAL
+
+ DateTimeOriginal subseconds
+
+.. c:macro:: EXIFTAG_SUBSECTIMEDIGITIZED
+
+ DateTimeDigitized subseconds
+
+.. c:macro:: EXIFTAG_FLASHPIXVERSION
+
+ Supported Flashpix version
+
+.. c:macro:: EXIFTAG_COLORSPACE
+
+ Color space information
+
+.. c:macro:: EXIFTAG_PIXELXDIMENSION
+
+ Valid image width
+
+.. c:macro:: EXIFTAG_PIXELYDIMENSION
+
+ Valid image height
+
+.. c:macro:: EXIFTAG_RELATEDSOUNDFILE
+
+ Related audio file
+
+.. c:macro:: EXIFTAG_FLASHENERGY
+
+ Flash energy
+
+.. c:macro:: EXIFTAG_SPATIALFREQUENCYRESPONSE
+
+ Spatial frequency response
+
+.. c:macro:: EXIFTAG_FOCALPLANEXRESOLUTION
+
+ Focal plane X resolution
+
+.. c:macro:: EXIFTAG_FOCALPLANEYRESOLUTION
+
+ Focal plane Y resolution
+
+.. c:macro:: EXIFTAG_FOCALPLANERESOLUTIONUNIT
+
+ Focal plane resolution unit
+
+.. c:macro:: EXIFTAG_SUBJECTLOCATION
+
+ Subject location
+
+.. c:macro:: EXIFTAG_EXPOSUREINDEX
+
+ Exposure index
+
+.. c:macro:: EXIFTAG_SENSINGMETHOD
+
+ Sensing method
+
+.. c:macro:: EXIFTAG_FILESOURCE
+
+ File source
+
+.. c:macro:: EXIFTAG_SCENETYPE
+
+ Scene type
+
+.. c:macro:: EXIFTAG_CFAPATTERN
+
+ CFA pattern
+
+.. c:macro:: EXIFTAG_CUSTOMRENDERED
+
+ Custom image processing
+
+.. c:macro:: EXIFTAG_EXPOSUREMODE
+
+ Exposure mode
+
+.. c:macro:: EXIFTAG_WHITEBALANCE
+
+ White balance
+
+.. c:macro:: EXIFTAG_DIGITALZOOMRATIO
+
+ Digital zoom ratio
+
+.. c:macro:: EXIFTAG_FOCALLENGTHIN35MMFILM
+
+ Focal length in 35 mm film
+
+.. c:macro:: EXIFTAG_SCENECAPTURETYPE
+
+ Scene capture type
+
+.. c:macro:: EXIFTAG_GAINCONTROL
+
+ Gain control
+
+.. c:macro:: EXIFTAG_CONTRAST
+
+ Contrast
+
+.. c:macro:: EXIFTAG_SATURATION
+
+ Saturation
+
+.. c:macro:: EXIFTAG_SHARPNESS
+
+ Sharpness
+
+.. c:macro:: EXIFTAG_DEVICESETTINGDESCRIPTION
+
+ Device settings description
+
+.. c:macro:: EXIFTAG_SUBJECTDISTANCERANGE
+
+ Subject distance range
+
+.. c:macro:: EXIFTAG_IMAGEUNIQUEID
+
+ Unique image ID
+
+.. c:macro:: EXIFTAG_SENSITIVITYTYPE
+
+ The SensitivityType tag indicates which one of the parameters of ISO12232 is the PhotographicSensitivity tag.
+
+.. c:macro:: EXIFTAG_STANDARDOUTPUTSENSITIVITY
+
+ This tag indicates the standard output sensitivity value of a camera or input device defined in ISO 12232.
+
+.. c:macro:: EXIFTAG_RECOMMENDEDEXPOSUREINDEX
+
+ recommended exposure index
+
+.. c:macro:: EXIFTAG_ISOSPEED
+
+ ISO speed value
+
+.. c:macro:: EXIFTAG_ISOSPEEDLATITUDEYYY
+
+ ISO speed latitude yyy
+
+.. c:macro:: EXIFTAG_ISOSPEEDLATITUDEZZZ
+
+ ISO speed latitude zzz
+
+.. c:macro:: EXIFTAG_OFFSETTIME
+
+ offset from UTC of the time of DateTime tag.
+
+.. c:macro:: EXIFTAG_OFFSETTIMEORIGINAL
+
+ offset from UTC of the time of DateTimeOriginal tag.
+
+.. c:macro:: EXIFTAG_OFFSETTIMEDIGITIZED
+
+ offset from UTC of the time of DateTimeDigitized tag.
+
+.. c:macro:: EXIFTAG_TEMPERATURE
+
+ Temperature as the ambient situation at the shot in dergee Celsius
+
+.. c:macro:: EXIFTAG_HUMIDITY
+
+ Humidity as the ambient situation at the shot in percent
+
+.. c:macro:: EXIFTAG_PRESSURE
+
+ Pressure as the ambient situation at the shot hecto-Pascal (hPa)
+
+.. c:macro:: EXIFTAG_WATERDEPTH
+
+ WaterDepth as the ambient situation at the shot in meter (m)
+
+.. c:macro:: EXIFTAG_ACCELERATION
+
+ Acceleration (a scalar regardless of direction) as the ambient situation at the shot in units of mGal (10-5 m/s^2)
+
+.. c:macro:: EXIFTAG_CAMERAELEVATIONANGLE
+
+ Elevation/depression. angle of the orientation of the camera(imaging optical axis) as the ambient situation at the shot in degree from -180deg to +180deg.
+
+.. c:macro:: EXIFTAG_CAMERAOWNERNAME
+
+ owner of a camera
+
+.. c:macro:: EXIFTAG_BODYSERIALNUMBER
+
+ serial number of the body of the camera
+
+.. c:macro:: EXIFTAG_LENSSPECIFICATION
+
+ minimum focal length (in mm), maximum focal length (in mm), minimum F number in the minimum focal length, and minimum F number in the maximum focal length,
+
+.. c:macro:: EXIFTAG_LENSMAKE
+
+ the lens manufacturer
+
+.. c:macro:: EXIFTAG_LENSMODEL
+
+ the lens model name and model number
+
+.. c:macro:: EXIFTAG_LENSSERIALNUMBER
+
+ the serial number of the interchangeable lens
+
+.. c:macro:: EXIFTAG_GAMMA
+
+ value of coefficient gamma
+
+.. c:macro:: EXIFTAG_COMPOSITEIMAGE
+
+ composite image
+
+.. c:macro:: EXIFTAG_SOURCEIMAGENUMBEROFCOMPOSITEIMAGE
+
+ source image number of composite image
+
+.. c:macro:: EXIFTAG_SOURCEEXPOSURETIMESOFCOMPOSITEIMAGE
+
+ source exposure times of composite image
+
+
+EXIF GPS tags
+-------------
+
+.. c:macro:: GPSTAG_VERSIONID
+
+ Indicates the version of GPSInfoIFD.
+
+.. c:macro:: GPSTAG_LATITUDEREF
+
+ Indicates whether the latitude is north or south latitude.
+
+.. c:macro:: GPSTAG_LATITUDE
+
+ Indicates the latitude.
+
+.. c:macro:: GPSTAG_LONGITUDEREF
+
+ Indicates whether the longitude is east or west longitude.
+
+.. c:macro:: GPSTAG_LONGITUDE
+
+ Indicates the longitude.
+
+.. c:macro:: GPSTAG_ALTITUDEREF
+
+ Indicates the altitude used as the reference altitude.
+
+.. c:macro:: GPSTAG_ALTITUDE
+
+ Indicates the altitude based on the reference in GPSAltitudeRef.
+
+.. c:macro:: GPSTAG_TIMESTAMP
+
+ Indicates the time as UTC (Coordinated Universal Time).
+
+.. c:macro:: GPSTAG_SATELLITES
+
+ Indicates the GPS satellites used for measurements.
+
+.. c:macro:: GPSTAG_STATUS
+
+ Indicates the status of the GPS receiver when the image is recorded.
+
+.. c:macro:: GPSTAG_MEASUREMODE
+
+ Indicates the GPS measurement mode.
+
+.. c:macro:: GPSTAG_DOP
+
+ Indicates the GPS DOP (data degree of precision).
+
+.. c:macro:: GPSTAG_SPEEDREF
+
+ Indicates the unit used to express the GPS receiver speed of movement.
+
+.. c:macro:: GPSTAG_SPEED
+
+ Indicates the speed of GPS receiver movement.
+
+.. c:macro:: GPSTAG_TRACKREF
+
+ Indicates the reference for giving the direction of GPS receiver movement.
+
+.. c:macro:: GPSTAG_TRACK
+
+ Indicates the direction of GPS receiver movement.
+
+.. c:macro:: GPSTAG_IMGDIRECTIONREF
+
+ Indicates the reference for giving the direction of the image when it is captured.
+
+.. c:macro:: GPSTAG_IMGDIRECTION
+
+ Indicates the direction of the image when it was captured.
+
+.. c:macro:: GPSTAG_MAPDATUM
+
+ Indicates the geodetic survey data used by the GPS receiver. (e.g. WGS-84)
+
+.. c:macro:: GPSTAG_DESTLATITUDEREF
+
+ Indicates whether the latitude of the destination point is north or south latitude.
+
+.. c:macro:: GPSTAG_DESTLATITUDE
+
+ Indicates the latitude of the destination point.
+
+.. c:macro:: GPSTAG_DESTLONGITUDEREF
+
+ Indicates whether the longitude of the destination point is east or west longitude.
+
+.. c:macro:: GPSTAG_DESTLONGITUDE
+
+ Indicates the longitude of the destination point.
+
+.. c:macro:: GPSTAG_DESTBEARINGREF
+
+ Indicates the reference used for giving the bearing to the destination point.
+
+.. c:macro:: GPSTAG_DESTBEARING
+
+ Indicates the bearing to the destination point.
+
+.. c:macro:: GPSTAG_DESTDISTANCEREF
+
+ Indicates the unit used to express the distance to the destination point.
+
+.. c:macro:: GPSTAG_DESTDISTANCE
+
+ Indicates the distance to the destination point.
+
+.. c:macro:: GPSTAG_PROCESSINGMETHOD
+
+ A character string recording the name of the method used for location finding.
+
+.. c:macro:: GPSTAG_AREAINFORMATION
+
+ A character string recording the name of the GPS area.
+
+.. c:macro:: GPSTAG_DATESTAMP
+
+ A character string recording date and time information relative to UTC (Coordinated Universal Time).
+
+.. c:macro:: GPSTAG_DIFFERENTIAL
+
+ Indicates whether differential correction is applied to the GPS receiver.
+
+.. c:macro:: GPSTAG_GPSHPOSITIONINGERROR
+
+ Indicates horizontal positioning errors in meters.
+
+See also
+--------
+
+:doc:`TIFFGetField` (3tiff),
+:doc:`TIFFSetField` (3tiff),
+:doc:`libtiff` (3tiff)
diff --git a/doc/functions/TIFFmemory.rst b/doc/functions/TIFFmemory.rst
index 826d6d22..addc34ab 100644
--- a/doc/functions/TIFFmemory.rst
+++ b/doc/functions/TIFFmemory.rst
@@ -20,7 +20,7 @@ Synopsis
.. c:function:: void _TIFFmemcpy(tdata_t dest, const tdata_t src, tsize_t n)
-.. c:function:: int _TIFFmemcmp(const tdata_t s1, const tdata_ts2, tsize_t n)
+.. c:function:: int _TIFFmemcmp(const tdata_t s1, const tdata_t s2, tsize_t n)
Description
-----------
diff --git a/doc/functions/TIFFswab.rst b/doc/functions/TIFFswab.rst
index ffbd7e53..49d1a300 100644
--- a/doc/functions/TIFFswab.rst
+++ b/doc/functions/TIFFswab.rst
@@ -12,15 +12,23 @@ Synopsis
.. c:function:: const unsigned char* TIFFGetBitRevTable(int reversed)
-.. c:function:: void TIFFReverseBits(u_char* data, unsigned long nbytes)
+.. c:function:: void TIFFReverseBits(uint8_t* cp, tmsize_t n)
.. c:function:: void TIFFSwabShort(uint16_t* data)
.. c:function:: void TIFFSwabLong(uint32_t* data)
-.. c:function:: void TIFFSwabArrayOfShort(uint16_t* data, unsigned long nshorts)
+.. c:function:: void TIFFSwabArrayOfShort(uint16_t* data, tmsize_t)
-.. c:function:: void TIFFSwabArrayOfLong(uint32_t* data, unsigned long nlongs)
+.. c:function:: void TIFFSwabArrayOfTriples(uint8_t* data, tmsize_t)
+
+.. c:function:: void TIFFSwabArrayOfLong(uint32_t* data, tmsize_t)
+
+.. c:function:: void TIFFSwabArrayOfLong8(uint64_t* data, tmsize_t)
+
+.. c:function:: void TIFFSwabArrayOfFloat(float* data, tmsize_t)
+
+.. c:function:: void TIFFSwabArrayOfDouble(double* data, tmsize_t)
Description
-----------
@@ -38,7 +46,8 @@ lookup table, which is returned using the :c:func:`TIFFGetBitRevTable`
function. The *reversed* parameter specifies which table should be
returned. Supply *1* if you want bit reversal table. Supply *0* to get
the table that do not reverse bit values. It is a lookup table that can
-be used as an "identity function"; i.e. :c:expr:`TIFFNoBitRevTable[n] == n`.
+be used as an "identity function"; i.e.
+:c:expr:`TIFFNoBitRevTable[n] == n`.
Diagnostics
-----------
diff --git a/doc/functions/libtiff.rst b/doc/functions/libtiff.rst
index e0da7efe..3621dbc0 100644
--- a/doc/functions/libtiff.rst
+++ b/doc/functions/libtiff.rst
@@ -55,63 +55,86 @@ fields are defined differently on a per-sample basis
``Compression``
tag is not defined on a per-sample basis, so this is immaterial).
+.. _public-data-types:
+
Data types
----------
The library makes extensive use of C typedefs to promote portability.
Two sets of typedefs are used, one for communication with clients
of the library and one for internal data structures and parsing of the
-TIFF format.
-The following typedefs are exposed to users either through function
-definitions or through parameters passed through the varargs interfaces.
+TIFF format. The following typedefs are exposed to users either through
+function definitions or through parameters passed through the varargs
+interfaces.
.. highlight:: c
-::
+.. c:type:: uint32_t ttag_t
+
+ directory tag
+
+.. c:type:: uint16_t tdir_t
+
+ directory index
+
+.. c:type:: uint16_t tsample_t
+
+ sample number
+
+.. c:type:: uint32_t tstrip_t
+
+ strip number
+
+.. c:type:: uint32_t ttile_t
+
+ tile number
+
+.. c:type:: int64_t tmsize_t
+
+ signed size type (int32_t on 32-bit platforms)
- typedef uint32_t ttag_t; // directory tag
- typedef uint16_t tdir_t; // directory index
- typedef uint16_t tsample_t; // sample number
- typedef uint32_t tstrip_t; // strip number
- typedef uint32_t ttile_t; // tile number
- typedef int64_t tmsize_t; // signed size type (int32_t on 32-bit platforms)
- typedef tmsize_t tsize_t; // i/o size in bytes
- typedef void* tdata_t; // image data ref
- typedef void* thandle_t; // client data handle
- typedef uint64_t toff_t; // file offset
-
-Note that
-:c:type:`tstrip_t`,
-:c:type:`ttile_t`,
-and
-:c:type:`tsize_t`
-are constrained to be no more than 32-bit quantities by 32-bit fields they are
-stored in in the
-TIFF
-image.
-Likewise
-:c:type:`tsample_t`
-is limited by the 16-bit field used to store the
-``SamplesPerPixel``
-tag.
-:c:type:`tdir_t`
-constrains the maximum number of
-IFDs
-that may appear in an image and may be an arbitrary size (w/o penalty).
-:c:type:`ttag_t`
-must be either int, unsigned int, pointer, or double because the library uses
-a varargs interface and
-C restricts the type of the parameter before an ellipsis to be a promoted type.
-:c:type:`toff_t`
-is defined as :c:type:`uint64_t` because TIFF file offsets are (unsigned) 32-bit
-quantities, and BigTIFF file offsets are unsigned 64-bit quantities.
-A signed value is used because some interfaces return -1 on
-error. Finally, note that user-specified data references are passed as opaque
-handles and only cast at the lowest layers where their type is presumed.
+.. c:type:: tmsize_t tsize_t
+
+ i/o size in bytes
+
+.. c:type:: void* tdata_t
+
+ image data ref
+
+.. c:type:: void* thandle_t
+
+ client data handle
+
+.. c:type:: uint64_t toff_t
+
+ file offset (should be :c:type:`off_t`)
+
+Note that :c:type:`tstrip_t`, :c:type:`ttile_t`, and :c:type:`tsize_t`
+are constrained to be no more than 32-bit quantities by 32-bit fields
+they are stored in in the TIFF image. Likewise :c:type:`tsample_t` is
+limited by the 16-bit field used to store the ``SamplesPerPixel`` tag.
+:c:type:`tdir_t` constrains the maximum number of IFDs that may appear
+in an image and may be an arbitrary size (w/o penalty). :c:type:`ttag_t`
+must be either :c:expr:`int`, :c:expr:`int`unsigned int`, pointer, or
+:c:expr:`int`double`, because the library uses a varargs interface and
+C restricts the type of the parameter before an ellipsis to be a
+promoted type. :c:type:`toff_t` is defined as :c:type:`uint64_t`
+because TIFF file offsets are (unsigned) 32-bit quantities, and BigTIFF
+file offsets are unsigned 64-bit quantities. A signed value is used
+because some interfaces return -1 on error. Finally, note that
+user-specified data references are passed as opaque handles and only
+cast at the lowest layers where their type is presumed.
.. TODO: Check why this toff_t was switched to unsigned and update description.
+Structures
+----------
+
+.. c:struct:: TIFF
+
+ An opaque data type representing an open TIFF file.
+
List of routines
----------------
diff --git a/doc/internals.rst b/doc/internals.rst
index 86014d9f..0b07b25a 100644
--- a/doc/internals.rst
+++ b/doc/internals.rst
@@ -31,9 +31,7 @@ Configuration defines are split into three areas:
are considered optional, and
* those that control operating system or machine-specific support.
-If the define :c:macro:`COMPRESSION_SUPPORT` is **not defined**
-then a default set of compression schemes is automatically
-configured:
+The following built-in compression algorithms are enabled by default:
* CCITT Group 3 and 4 algorithms (compression codes 2, 3, 4, and 32771),
* the Macintosh PackBits algorithm (compression 32773),
@@ -42,22 +40,15 @@ configured:
* two experimental schemes intended for images with high dynamic range
(compression 34676 and 34677).
-To override the default compression behaviour define
-:c:macro:`COMPRESSION_SUPPORT` and then one or more additional defines
-to enable configuration of the appropriate codecs (see the table
-below); e.g.
-
-.. highlight:: c
-
-::
-
- #define COMPRESSION_SUPPORT
- #define CCITT_SUPPORT
- #define PACKBITS_SUPPORT
+To override the default compression behaviour, set the appropriate
+defines enable configuration of the appropriate codecs (see the list
+below); e.g. :c:macro:`PACKBITS_SUPPORT` and :c:macro:`CCITT_SUPPORT`.
Several other compression schemes are configured separately from
the default set because they depend on ancillary software
-packages that are not distributed with LibTIFF.
+packages that are not distributed with LibTIFF. They will be
+enabled automatically if the CMake or Autotools build configuration
+detects them, or they may be explicitly enabled or disabled.
Support for JPEG compression is controlled by :c:macro:`JPEG_SUPPORT`.
The JPEG codec that comes with LibTIFF is designed for
@@ -71,6 +62,10 @@ This software can be retrieved from the directory
Enabling JPEG support automatically enables support for
the TIFF 6.0 colorimetry and YCbCr-related tags.
+.. c:macro:: DEFLATE_SUPPORT
+
+ Enable Deflate support
+
Experimental support for the deflate algorithm is controlled by
:c:macro:`DEFLATE_SUPPORT`.
The deflate codec that comes with LibTIFF is designed
@@ -101,58 +96,66 @@ and
:c:macro:`CMYK_SUPPORT`.
-.. list-table:: :file:`tiffconf.h` defines
- :widths: 5 20
- :header-rows: 1
+:file:`tiffconf.h` defines:
+
+.. c:macro:: CCITT_SUPPORT
+
+ CCITT Group 3 and 4 algorithms (compression codes 2, 3, 4, and 32771)
+
+.. c:macro:: PACKBITS_SUPPORT
+
+ Macintosh PackBits algorithm (compression 32773)
+
+.. c:macro:: LZW_SUPPORT
- * - Define
- - Description
+ Lempel-Ziv & Welch (LZW) algorithm (compression 5)
- * - :c:macro:`CCITT_SUPPORT`
- - CCITT Group 3 and 4 algorithms (compression codes 2, 3, 4, and 32771)
+.. c:macro:: THUNDER_SUPPORT
- * - :c:macro:`PACKBITS_SUPPORT`
- - Macintosh PackBits algorithm (compression 32773)
+ 4-bit run-length encoding scheme from ThunderScan (compression 32809)
- * - :c:macro:`LZW_SUPPORT`
- - Lempel-Ziv & Welch (LZW) algorithm (compression 5)
+.. c:macro:: NEXT_SUPPORT
- * - :c:macro:`THUNDER_SUPPORT`
- - 4-bit run-length encoding scheme from ThunderScan (compression 32809)
+ 2-bit encoding scheme used by NeXT (compression 32766)
- * - :c:macro:`NEXT_SUPPORT`
- - 2-bit encoding scheme used by NeXT (compression 32766)
+.. c:macro:: OJPEG_SUPPORT
- * - :c:macro:`OJPEG_SUPPORT`
- - obsolete JPEG scheme defined in the 6.0 spec (compression 6)
+ obsolete JPEG scheme defined in the 6.0 spec (compression 6)
- * - :c:macro:`JPEG_SUPPORT`
- - current JPEG scheme defined in TTN2 (compression 7)
+.. c:macro:: JPEG_SUPPORT
- * - :c:macro:`ZIP_SUPPORT`
- - experimental Deflate scheme (compression 32946)
+ current JPEG scheme defined in TTN2 (compression 7)
- * - :c:macro:`PIXARLOG_SUPPORT`
- - Pixar's compression scheme for high-resolution color images (compression 32909)
+.. c:macro:: ZIP_SUPPORT
- * - :c:macro:`SGILOG_SUPPORT`
- - SGI's compression scheme for high-resolution color images (compression 34676 and 34677)
+ experimental Deflate scheme (compression 32946)
- * - :c:macro:`COLORIMETRY_SUPPORT`
- - support for the TIFF 6.0 colorimetry tags
+.. c:macro:: PIXARLOG_SUPPORT
- * - :c:macro:`YCBCR_SUPPORT`
- - support for the TIFF 6.0 YCbCr-related tags
+ Pixar's compression scheme for high-resolution color images (compression 32909)
- * - :c:macro:`CMYK_SUPPORT`
- - support for the TIFF 6.0 CMYK-related tags
+.. c:macro:: SGILOG_SUPPORT
- * - :c:macro:`ICC_SUPPORT`
- - support for the ICC Profile tag; see
- *The ICC Profile Format Specification*,
- Annex B.3 "Embedding ICC Profiles in TIFF Files";
- available at
- `<http://www.color.org/>`_
+ SGI's compression scheme for high-resolution color images (compression 34676 and 34677)
+
+.. c:macro:: COLORIMETRY_SUPPORT
+
+ support for the TIFF 6.0 colorimetry tags
+
+.. c:macro:: YCBCR_SUPPORT
+
+ support for the TIFF 6.0 YCbCr-related tags
+
+.. c:macro:: CMYK_SUPPORT
+
+ support for the TIFF 6.0 CMYK-related tags
+
+.. c:macro:: ICC_SUPPORT
+
+ support for the ICC Profile tag; see
+ *The ICC Profile Format Specification*,
+ Annex B.3 "Embedding ICC Profiles in TIFF Files";
+ available at `<http://www.color.org/>`_
General Portability Comments
----------------------------
@@ -191,49 +194,32 @@ The UNIX (:file:`tif_unix.c`) code has had the most use.
Native CPU byte order is determined on the fly by
the library and does not need to be specified.
-The :c:macro:`HOST_FILLORDER` and :c:macro:`HOST_BIGENDIAN`
-definitions are not currently used, but may be employed by
-codecs for optimization purposes.
The following defines control general portability:
-.. list-table:: Portability defines
- :widths: 5 20
- :header-rows: 1
+.. c:macro:: HAVE_MMAP
- * - Define
- - Description
+ Define this if there is *mmap-style* support for
+ mapping files into memory (used only to read data).
- * - :c:macro:`BSDTYPES`
- - Define this if your system does **not** define the
- usual BSD typedefs: :c:type:`u_char`,
- :c:type:`u_short`, :c:type:`u_int`, :c:type:`u_long`.
+.. c:macro:: HOST_FILLORDER
- * - :c:macro:`HAVE_IEEEFP`
- - Define this as 0 or 1 according to the floating point
- format supported by the machine. If your machine does
- not support IEEE floating point then you will need to
- add support to tif_machdep.c to convert between the
- native format and IEEE format.
+ Define the native CPU bit order: one of :c:macro:`FILLORDER_MSB2LSB`
+ or :c:macro:`FILLORDER_LSB2MSB`
- * - :c:macro:`HAVE_MMAP`
- - Define this if there is *mmap-style* support for
- mapping files into memory (used only to read data).
+.. c:macro:: HOST_BIGENDIAN
- * - :c:macro:`HOST_FILLORDER`
- - Define the native CPU bit order: one of :c:macro:`FILLORDER_MSB2LSB`
- or :c:macro:`FILLORDER_LSB2MSB`
+ Define the native CPU byte order: 1 if big-endian (Motorola)
+ or 0 if little-endian (Intel); this may be used
+ in codecs to optimize code
- * - :c:macro:`HOST_BIGENDIAN`
- - Define the native CPU byte order: 1 if big-endian (Motorola)
- or 0 if little-endian (Intel); this may be used
- in codecs to optimize code
+The :c:macro:`HOST_FILLORDER` and :c:macro:`HOST_BIGENDIAN`
+definitions are not currently used, but may be employed by
+codecs for optimization purposes.
On UNIX systems :c:macro:`HAVE_MMAP` is defined through the running of
the :program:`configure` script; otherwise support for memory-mapped
files is disabled.
-Note that :file:`tiffcomp.h` defines :c:macro:`HAVE_IEEEFP` to be
-1 (:c:macro:`BSDTYPES` is not defined).
Types and Portability
---------------------
@@ -243,120 +229,312 @@ Two sets of typedefs are used, one for communication with clients
of the library and one for internal data structures and parsing of the
TIFF format. There are interactions between these two to be careful
of, but for the most part you should be able to deal with portability
-purely by fiddling with the following machine-dependent typedefs:
+purely by fiddling with the following machine-dependent typedefs. Note
+that C99 :file:`stdint.h` types are used in most cases.
+
+Included through :file:`tiff.h`:
+
+.. c:type:: uint8_t
+
+ 8-bit unsigned integer
+
+.. c:type:: int8_t
+
+ 8-bit signed integer
+
+.. c:type:: uint16_t
+
+ 16-bit unsigned integer
+
+.. c:type:: int16_t
-.. list-table:: Portability typedefs
- :widths: 5 15 5
- :header-rows: 1
+ 16-bit signed integer
- * - Typedef
- - Description
- - Header
+.. c:type:: uint32_t
- * - :c:type:`uint8_t`
- - 8-bit unsigned integer
- - :file:`tiff.h`
+ 32-bit unsigned integer
- * - :c:type:`int8_t`
- - 8-bit signed integer
- - :file:`tiff.h`
+.. c:type:: int32_t
- * - :c:type:`uint16_t`
- - 16-bit unsigned integer
- - :file:`tiff.h`
+ 32-bit signed integer
- * - :c:type:`int16_t`
- - 16-bit signed integer
- - :file:`tiff.h`
+.. c:type:: uint64_t
- * - :c:type:`uint32_t`
- - 32-bit unsigned integer
- - :file:`tiff.h`
+ 64-bit unsigned integer
- * - :c:type:`int32_t`
- - 32-bit signed integer
- - :file:`tiff.h`
+.. c:type:: int64_t
- * - :c:type:`dblparam_t`
- - promoted type for floats
- - :file:`tiffcomp.h`
+ 64-bit signed integer
-(to clarify :c:type:`dblparam_t`, it is the type that float parameters are
-promoted to when passed by value in a function call.)
+.. c:type:: size_t
+
+ C size type
+
+.. c:type:: va_list
+
+ Variable argument list
+
+The public typedefs used throughout the library and in public interfaces are
+described in Section :ref:`public-data-types`.
The following typedefs are used throughout the library and interfaces
to refer to certain objects whose size is dependent on the TIFF image
structure:
-.. list-table:: TIFF image typedefs
- :widths: 10 10 10
- :header-rows: 1
-
- * - Typedef
- - Type
- - Description
-
-
- * - :c:type:`ttag_t`
- - :c:expr:`unsigned int`
- - directory tag
-
- * - :c:type:`tdir_t`
- - :c:type:`uint16_t`
- - directory index
-
- * - :c:type:`tsample_t`
- - :c:type:`uint16_t`
- - sample number
-
- * - :c:type:`tstrip_t`
- - :c:type:`uint32_t`
- - strip number
-
- * - :c:type:`ttile_t`
- - :c:type:`uint32_t`
- - tile number
-
- * - :c:type:`tsize_t`
- - :c:type:`int32_t`
- - i/o size in bytes
-
- * - :c:type:`tdata_t`
- - :c:expr:`void *`
- - image data ref
-
- * - :c:type:`thandle_t`
- - :c:expr:`void *`
- - client data handle
-
- * - :c:type:`toff_t`
- - :c:type:`int32_t`
- - file offset (should be off_t)
-
- * - :c:type:`tidata_t`
- - :c:expr:`unsigned char *`
- - internal image data
-
-Note that :c:type:`tstrip_t`, :c:type:`ttile_t`, and :c:type:`tsize_t`
-are constrained to be
-no more than 32-bit quantities by 32-bit fields they are stored
-in in the TIFF image. Likewise :c:type:`tsample_t` is limited by the 16-bit
-field used to store the ``SamplesPerPixel`` tag. :c:type:`tdir_t`
-constrains
-the maximum number of IFDs that may appear in an image and may
-be an arbitrary size (without penalty). :c:type:`ttag_t` must be either
-:c:expr:`int`, :c:expr:`unsigned int`, pointer, or :c:expr:`double`
-because the library uses a varargs
-interface and ANSI C restricts the type of the parameter before an
-ellipsis to be a promoted type. :c:type:`toff_t` is defined as
-:c:type:`int32_t` because
-TIFF file offsets are (unsigned) 32-bit quantities. A signed
-value is used because some interfaces return -1 on error (sigh).
-Finally, note that :c:type:`tidata_t` is used internally to the library to
-manipulate internal data. User-specified data references are
-passed as opaque handles and only cast at the lowest layers where
-their type is presumed.
+.. c:type:: unsigned char * tidata_t
+
+ internal image data
+
+The following macros are used from the standard library:
+
+.. c:macro:: NULL
+
+ Null pointer value
+
+The following types are been used in the past and are obsoleted by the use of the
+C library integer types, above:
+
+.. c:type:: u_char
+
+ Obsolete type. Use :c:type:`uint8_t`.
+
+.. c:type:: u_short
+
+ Obsolete type. Use :c:type:`uint16_t`.
+
+.. c:type:: u_int
+
+ Obsolete type. Use :c:type:`uint32_t`.
+
+.. c:type:: u_long
+
+ Obsolete type. Use :c:type:`uint64_t`.
+
+.. c:type:: int8
+
+ Obsolete type. Use :c:type:`int8_t`.
+
+.. c:type:: uint8
+
+ Obsolete type. Use :c:type:`uint8_t`.
+
+.. c:type:: int16
+
+ Obsolete type. Use :c:type:`int16_t`.
+
+.. c:type:: uint16
+
+ Obsolete type. Use :c:type:`uint16_t`.
+
+.. c:type:: int32
+
+ Obsolete type. Use :c:type:`int32_t`.
+
+.. c:type:: uint32
+
+ Obsolete type. Use :c:type:`uint32_t`.
+
+.. c:type:: int64
+
+ Obsolete type. Use :c:type:`int64_t`.
+
+.. c:type:: uint64
+
+ Obsolete type. Use :c:type:`uint64_t`.
+
+The following C types and functions are used from the standard library:
+
+.. c:type:: FILE
+
+ File handle
+
+.. c:function:: int memcmp(const void* lhs, const void* rhs, size_t count)
+
+ See `memcmp <https://en.cppreference.com/w/c/string/byte/memcmp>`_
+
+.. c:function:: void* memcpy(void *restrict dest, const void *restrict src, size_t count)
+
+ See `memcpy <https://en.cppreference.com/w/c/string/byte/memcpy>`_
+
+.. c:function:: void* memmove(void* dest, const void* src, size_t count)
+
+ See `memmove <https://en.cppreference.com/w/c/string/byte/memmove>`_
+
+.. c:function:: void *memset(void *dest, int ch, size_t count)
+
+ See `memset <https://en.cppreference.com/w/c/string/byte/memset>`_
+
+.. c:function:: long strtol(const char *restrict str, char **restrict str_end, int base)
+
+ See `strtol <https://en.cppreference.com/w/c/string/byte/strtol>`_
+
+.. c:function:: long long strtoll(const char *restrict str, char **restrict str_end, int base)
+
+ See `strtoll <https://en.cppreference.com/w/c/string/byte/strtol>`_
+
+.. c:function:: unsigned long strtoul(const char *restrict str, char **restrict str_end, int base)
+
+ See `strtoul <https://en.cppreference.com/w/c/string/byte/strtoul>`_
+
+.. c:function:: unsigned long long strtoull(const char *restrict str, char **restrict str_end, int base)
+
+ See `strtoull <https://en.cppreference.com/w/c/string/byte/strtoul>`_
+
+.. c:function:: void* bsearch(const void *key, const void *ptr, size_t count, size_t size, int (*comp)(const void*, const void*))
+
+ See `bsearch <https://en.cppreference.com/w/c/algorithm/bsearch>`_
+.. c:function:: void* malloc(size_t size)
+
+ See `malloc <https://en.cppreference.com/w/c/memory/malloc>`_
+
+.. c:function:: void *realloc(void *ptr, size_t new_size)
+
+ See `realloc <https://en.cppreference.com/w/c/memory/realloc>`_
+
+.. c:function:: void free(void* ptr)
+
+ See `free <https://en.cppreference.com/w/c/memory/free>`_
+
+.. c:function:: int printf(const char *restrict format, ...)
+
+ See `printf <https://en.cppreference.com/w/c/io/fprintf>`_
+
+.. c:function:: int snprintf(char *restrict buffer, size_t bufsz, const char *restrict format, ...)
+
+ See `snprintf <https://en.cppreference.com/w/c/io/fprintf>`_
+
+.. c:function:: double pow(double base, double exponent)
+
+ See `pow <https://en.cppreference.com/w/c/numeric/math/pow>`_
+
+The following POSIX types and functions are used from the standard library:
+
+.. c:type:: ssize_t
+
+ Signed size type
+
+.. c:type:: off_t
+
+ File offset
+
+.. c:function:: int open(const char *path, int oflag, ...)
+
+ See `open <https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html>`_
+
+.. c:function:: int close(int fildes)
+
+ See `close <https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html>`_
+
+.. c:function:: ssize_t read(int fildes, void *buf, size_t nbyte)
+
+ See `read <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>`_
+
+.. c:function:: ssize_t write(int fildes, const void *buf, size_t nbyte)
+
+ See `write <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>`_
+
+.. c:function:: off_t lseek(int fildes, off_t offset, int whence)
+
+ See `lseek <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>`_
+
+.. c:function:: int fseeko(FILE *stream, off_t offset, int whence)
+
+ See `fseeko <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseeko.html>`_
+
+.. c:function:: int mkstemp(char *template)
+
+ See `mkstemp <https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkstemp.html>`_
+
+.. c:function:: void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off)
+
+ See `mmap <https://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html>`_
+
+.. c:function:: int munmap(void *addr, size_t len)
+
+ See `munmap <https://pubs.opengroup.org/onlinepubs/9699919799/functions/munmap.html>`_
+
+The following Windows types and functions are used from the C runtime:
+
+.. c:type:: BOOL
+
+ Boolean type
+
+.. c:type:: LONG
+
+ Long integer type
+
+.. c:type:: DWORD
+
+ Double-length word
+
+.. c:type:: HANDLE
+
+ File handle
+
+.. c:type:: LPCSTR
+
+ Long pointer to constant string
+
+.. c:type:: LPCWSTR
+
+ Long pointer to constant wide string
+
+.. c:type:: LPVOID
+
+ Long pointer to void
+
+.. c:type:: LPCVOID
+
+ Long pointer to const void
+
+.. c:type:: LPDWORD
+
+ Long pointer to double-length word
+
+.. c:type:: LPOVERLAPPED
+
+ Long pointer to overlapped structure
+
+.. c:type:: LPSECURITY_ATTRIBUTES
+
+ Long pointer to security attributes
+
+.. c:type:: PLONG
+
+ Pointer to long
+
+.. c:function:: HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
+
+ See `CreateFileW <https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew>`_
+
+.. c:function:: HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
+
+ See `CreateFileA <https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea>`_
+
+.. c:function:: BOOL CloseHandle(HANDLE hObject)
+
+ See `CloseHandle <https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle>`_
+
+.. c:function:: BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
+
+ See `ReadFile <https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile>`_
+
+.. c:function:: BOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
+
+ See `WriteFile <https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-writefile>`_
+
+.. c:function:: DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
+
+ See `SetFilePointer <https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfilepointer>`_
+
+.. c:function:: HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName)
+
+ See `CreateFileMappingA <https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createfilemappinga>`_
+
+.. c:function:: BOOL UnmapViewOfFile(LPCVOID lpBaseAddress)
+
+ See `UnmapViewOfFile <https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-unmapviewoffile>`_
General Comments
----------------
@@ -464,3 +642,24 @@ boundaries, and :file:`tif_lzw.c` has the LZW scheme that has the most
complexity -- it tracks the buffer boundary at a bit level.
Of course, using a private compression scheme (or private tags) limits
the portability of your TIFF files.
+
+Internal functions
+------------------
+
+The following functions are private and are not part of the public API.
+
+.. c:function:: int _TIFFRewriteField(TIFF *, uint16_t, TIFFDataType, tmsize_t, void *)
+
+
+
+The following functions are static and not part of the public or private API.
+
+.. c:function:: int TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
+
+ Fetch a normal tag, not covered by special-case code
+
+.. c:function:: int TIFFWriteDirectoryTagData(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t datatype, uint32_t count, uint32_t datalength, void* data)
+
+.. c:function:: int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32_t nstrips, uint64_t** lpp)
+
+.. c:function:: int TIFFAppendToStrip(TIFF* tif, uint32_t strip, uint8_t* data, tmsize_t cc)
diff --git a/doc/releases/v3.7.0beta.rst b/doc/releases/v3.7.0beta.rst
index 8239faae..3244fd4d 100644
--- a/doc/releases/v3.7.0beta.rst
+++ b/doc/releases/v3.7.0beta.rst
@@ -75,8 +75,8 @@ Library changes
Tools changes
-------------
-* :program:`tiff2ps`: Avoid zero division in :c:func:`setupPageState` function;
- properly initialize array in :c:func:`PSDataBW`.
+* :program:`tiff2ps`: Avoid zero division in ``setupPageState()`` function;
+ properly initialize array in ``PSDataBW()``.
* :program:`tiff2pdf`: Multiple bugfixes.
diff --git a/doc/releases/v3.7.2.rst b/doc/releases/v3.7.2.rst
index b7369cd7..b397ae29 100644
--- a/doc/releases/v3.7.2.rst
+++ b/doc/releases/v3.7.2.rst
@@ -115,8 +115,8 @@ Tools changes
as per bug
:bugzilla-rs:`785`
-* :file:`fax2ps.c`: Replace insecure :c:func:`mktemp` function with the
- :c:func:`tmpfile` as per bug
+* :file:`fax2ps.c`: Replace insecure ``mktemp`` function with the
+ ``tmpfile`` as per bug
:bugzilla-rs:`786`
* :file:`tiffgt.c`: Fix problem on big-endian CPUs so that images
diff --git a/doc/releases/v3.7.3.rst b/doc/releases/v3.7.3.rst
index c558e0d5..1e4ef5fc 100644
--- a/doc/releases/v3.7.3.rst
+++ b/doc/releases/v3.7.3.rst
@@ -84,7 +84,7 @@ Library changes
:bugzilla-rs:`830`
* :file:`tif_win32.c`: Use ``FILE_SHARE_READ | FILE_SHARE_WRITE`` share
- mode in :c:func:`CreateFile` call as per bug
+ mode in ``CreateFile`` call as per bug
:bugzilla-rs:`829`
* :file:`tif_jpeg.c`: Substantial fix for :program:`addtiffo` problems with
diff --git a/doc/releases/v4.0.8.rst b/doc/releases/v4.0.8.rst
index 00ec2d89..cc2769d3 100644
--- a/doc/releases/v4.0.8.rst
+++ b/doc/releases/v4.0.8.rst
@@ -340,7 +340,7 @@ Tools changes
:bugzilla:`2605`
* :file:`tools/tiff2ps.c`: fix 2 heap-based buffer overflows (in
- :c:func:`PSDataBW` and :c:func:`PSDataColorContig`). Reported by Agostino Sarubbo.
+ ``PSDataBW()`` and ``PSDataColorContig()``. Reported by Agostino Sarubbo.
Fixes :bugzilla:`2633` and
:bugzilla:`2634`.
@@ -354,19 +354,19 @@ Tools changes
:bugzilla:`2638`
* :file:`tools/tiff2pdf.c`: avoid potential invalid memory read in
- :c:func:`t2p_writeproc`. Fixes
+ ``t2p_writeproc()``. Fixes
:bugzilla:`2639`
* :file:`tools/tiff2pdf.c`: avoid potential heap-based overflow in
- :c:func:`t2p_readwrite_pdf_image_tile`. Fixes
+ ``t2p_readwrite_pdf_image_tile()``. Fixes
:bugzilla:`2640`
* :file:`tools/tiffcrop.c`: remove extraneous :c:func:`TIFFClose` in error code
path, that caused double free. Related to
:bugzilla:`2535`
-* :file:`tools/tiffcp.c`: error out cleanly in :c:func:`cpContig2SeparateByRow`
- and :c:func:`cpSeparate2ContigByRow` if ``BitsPerSample != 8`` to avoid heap
+* :file:`tools/tiffcp.c`: error out cleanly in ``cpContig2SeparateByRow()``
+ and ``cpSeparate2ContigByRow()`` if ``BitsPerSample != 8`` to avoid heap
based overflow. Fixes
:bugzilla:`2656` and
:bugzilla:`2657`
diff --git a/doc/releases/v4.4.0.rst b/doc/releases/v4.4.0.rst
index 22c40e1f..55f552d5 100644
--- a/doc/releases/v4.4.0.rst
+++ b/doc/releases/v4.4.0.rst
@@ -42,7 +42,7 @@ Library changes
New/improved functionalities:
* :c:func:`TIFFIsBigTiff` function added.
-* Functions :c:func:`TIFFFieldSetGetSize` and :c:func:`TIFFieldSetGetCountSize` added.
+* Functions :c:func:`TIFFFieldSetGetSize()` and :c:func:`TIFFFieldSetGetCountSize()` added.
* :c:func:`LZWDecode`: major speed improvements (~30% faster)
* Predictor 2 (horizontal differenciation): support 64-bit
* Support libjpeg 9d