TIFFGetField(3T)
NAME
TIFFGetField, TIFFVGetField - get the value(s) of a tag in
an open TIFF file
SYNOPSIS
#include <<tiffio.h>>
int TIFFGetField(TIFF* tif, ttag_t tag, ...)
#include <<stdarg.h>>
int TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
int TIFFGetFieldDefaulted(TIFF* tif, ttag_t tag, ...)
int TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list
ap)
DESCRIPTION
TIFFGetField returns the value of a tag or pseudo-tag
associated with the the current directory of the open TIFF
file tif. (A pseudo-tag is a parameter that is used to
control the operation of the TIFF library but whose value
is not read or written to the underlying file.) The file
must have been previously opened with TIFFOpen(3T). The
tag is identified by tag, one of the values defined in the
include file tiff.h (see also the table below). The type
and number of values returned is dependent on the tag
being requested. The programming interface uses a vari-
able argument list as prescribed by the stdarg(3) inter-
face. The returned values should only be interpreted if
TIFFGetField returns 1.
TIFFVGetField is functionally equivalent to TIFFGetField
except that it takes a pointer to a variable argument
list. TIFFVGetField is useful for layering interfaces on
top of the functionality provided by TIFFGetField.
TIFFGetFieldDefaulted and TIFFVGetFieldDefaulted are iden-
tical to TIFFGetField and TIFFVGetField, except that if a
tag is not defined in the current directory and it has a
default value, then the default value is returned.
The tags understood by libtiff, the number of parameter
values, and the types for the returned values are shown
below. The data types are specified as in C and corre-
spond to the types used to specify tag values to TIFFSet-
Field(3T). Remember that TIFFGetField returns parameter
values, so all the listed data types are pointers to stor-
age where values should be returned. Consult the TIFF
specification for information on the meaning of each tag
and their possible values.
Tag Name Count Types Notes
TIFFTAG_ARTIST 1 char**
TIFFTAG_BADFAXLINES 1 uint32*
TIFFTAG_BITSPERSAMPLE 1 uint16*
TIFFTAG_CLEANFAXDATA 1 uint16*
TIFFTAG_COLORMAP 3 uint16** 1<SamplesPerPixel is one, then a single array is
returned; otherwise three arrays are returned.
RETURN VALUES
1 is returned if the tag is defined in the current direc-
tory; otherwise a 0 is returned.
DIAGNOSTICS
All error messages are directed to the TIFFError(3T) rou-
tine.
Unknown field, tag 0x%x. An unknown tag was supplied.
SEE ALSO
libtiff(3T) TIFFOpen(3T) TIFFSetField(3T) TIFFSetDirec-
tory(3T) TIFFReadDirectory(3T) TIFFWriteDirectory(3T)