Blame man/TIFFGetField.3tiff

Packit 85355f
.\" $Id: TIFFGetField.3tiff,v 1.8 2017-06-30 17:40:02 erouault Exp $
Packit 85355f
.\"
Packit 85355f
.\" Copyright (c) 1988-1997 Sam Leffler
Packit 85355f
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
Packit 85355f
.\"
Packit 85355f
.\" Permission to use, copy, modify, distribute, and sell this software and 
Packit 85355f
.\" its documentation for any purpose is hereby granted without fee, provided
Packit 85355f
.\" that (i) the above copyright notices and this permission notice appear in
Packit 85355f
.\" all copies of the software and related documentation, and (ii) the names of
Packit 85355f
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit 85355f
.\" publicity relating to the software without the specific, prior written
Packit 85355f
.\" permission of Sam Leffler and Silicon Graphics.
Packit 85355f
.\" 
Packit 85355f
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
Packit 85355f
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
Packit 85355f
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
Packit 85355f
.\" 
Packit 85355f
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit 85355f
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit 85355f
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit 85355f
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
Packit 85355f
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
Packit 85355f
.\" OF THIS SOFTWARE.
Packit 85355f
.\"
Packit 85355f
.if n .po 0
Packit 85355f
.TH TIFFGetField 3TIFF "March 18, 2005" "libtiff"
Packit 85355f
.SH NAME
Packit 85355f
TIFFGetField, TIFFVGetField \- get the value(s) of a tag in an open
Packit 85355f
.SM TIFF
Packit 85355f
file
Packit 85355f
.SH SYNOPSIS
Packit 85355f
.B "#include <tiffio.h>"
Packit 85355f
.sp
Packit 85355f
.BI "int TIFFGetField(TIFF *" tif ", ttag_t " tag ", " ... ")"
Packit 85355f
.sp
Packit 85355f
.B "#include <stdarg.h>"
Packit 85355f
.sp
Packit 85355f
.BI "int TIFFVGetField(TIFF *" tif ", ttag_t " tag ", va_list " ap ")"
Packit 85355f
.br
Packit 85355f
.BI "int TIFFGetFieldDefaulted(TIFF *" tif ", ttag_t " tag ", " ... ")"
Packit 85355f
.br
Packit 85355f
.BI "int TIFFVGetFieldDefaulted(TIFF *" tif ", ttag_t " tag ", va_list " ap ")"
Packit 85355f
.SH DESCRIPTION
Packit 85355f
.IR TIFFGetField
Packit 85355f
returns the value of a tag or pseudo-tag associated with the the current
Packit 85355f
directory of the opened
Packit 85355f
.SM TIFF
Packit 85355f
file
Packit 85355f
.IR tif .
Packit 85355f
(A
Packit 85355f
.I pseudo-tag 
Packit 85355f
is a parameter that is used to control the operation of the
Packit 85355f
.SM TIFF
Packit 85355f
library but whose value is not read or written to the underlying file.) The
Packit 85355f
file must have been previously opened with
Packit 85355f
.IR TIFFOpen (3TIFF).
Packit 85355f
The tag is identified by
Packit 85355f
.IR tag ,
Packit 85355f
one of the values defined in the include file
Packit 85355f
.B tiff.h
Packit 85355f
(see also the table below). The type and number of values returned is
Packit 85355f
dependent on the tag being requested. The programming interface uses a
Packit 85355f
variable argument list as prescribed by the
Packit 85355f
.IR stdarg (3)
Packit 85355f
interface. The returned values should only be interpreted if
Packit 85355f
.IR TIFFGetField
Packit 85355f
returns 1.
Packit 85355f
.PP
Packit 85355f
.IR TIFFVGetField
Packit 85355f
is functionally equivalent to
Packit 85355f
.IR TIFFGetField
Packit 85355f
except that it takes a pointer to a variable argument list.
Packit 85355f
.I TIFFVGetField
Packit 85355f
is useful for layering interfaces on top of the functionality provided by
Packit 85355f
.IR TIFFGetField .
Packit 85355f
.PP
Packit 85355f
.IR TIFFGetFieldDefaulted
Packit 85355f
and
Packit 85355f
.IR TIFFVGetFieldDefaulted
Packit 85355f
are identical to 
Packit 85355f
.IR TIFFGetField
Packit 85355f
and
Packit 85355f
.IR TIFFVGetField ,
Packit 85355f
except that if a tag is not defined in the current directory and it has a
Packit 85355f
default value, then the default value is returned.
Packit 85355f
.PP
Packit 85355f
The tags understood by
Packit 85355f
.IR libtiff(3TIFF),
Packit 85355f
the number of parameter values, and the types for the returned values are
Packit 85355f
shown below. The data types are specified as in C and correspond to the types
Packit 85355f
used to specify tag values to
Packit 85355f
.IR TIFFSetField (3TIFF).
Packit 85355f
Remember that
Packit 85355f
.IR TIFFGetField
Packit 85355f
returns parameter values, so all the listed data types are pointers to storage
Packit 85355f
where values should be returned.
Packit 85355f
Consult the
Packit 85355f
.SM TIFF
Packit 85355f
specification (or relevant industry specification) for information on the
Packit 85355f
meaning of each tag and their possible values.
Packit 85355f
.PP
Packit 85355f
.nf
Packit 85355f
.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'TIFFFaxFillFunc*'u+2n
Packit 85355f
\fITag Name\fP	\fICount\fP	\fITypes\fP	\fINotes\fP
Packit 85355f
.sp 5p
Packit 85355f
TIFFTAG_ARTIST	1	char**
Packit 85355f
TIFFTAG_BADFAXLINES	1	uint32*
Packit 85355f
TIFFTAG_BITSPERSAMPLE	1	uint16*
Packit 85355f
TIFFTAG_CLEANFAXDATA	1	uint16*
Packit 85355f
TIFFTAG_COLORMAP	3	uint16**	1<
Packit 85355f
TIFFTAG_COMPRESSION	1	uint16*
Packit 85355f
TIFFTAG_CONSECUTIVEBADFAXLINES	1	uint32*
Packit 85355f
TIFFTAG_COPYRIGHT	1	char**
Packit 85355f
TIFFTAG_DATATYPE	1	uint16*
Packit 85355f
TIFFTAG_DATETIME	1	char**
Packit 85355f
TIFFTAG_DOCUMENTNAME	1	char**
Packit 85355f
TIFFTAG_DOTRANGE	2	uint16*
Packit 85355f
TIFFTAG_EXTRASAMPLES	2	uint16*,uint16**	count & types array
Packit 85355f
TIFFTAG_FAXFILLFUNC	1	TIFFFaxFillFunc*	G3/G4 compression pseudo-tag
Packit 85355f
TIFFTAG_FAXMODE	1	int*	G3/G4 compression pseudo-tag
Packit 85355f
TIFFTAG_FILLORDER	1	uint16*
Packit 85355f
TIFFTAG_GROUP3OPTIONS	1	uint32*
Packit 85355f
TIFFTAG_GROUP4OPTIONS	1	uint32*
Packit 85355f
TIFFTAG_HALFTONEHINTS	2	uint16*
Packit 85355f
TIFFTAG_HOSTCOMPUTER	1	char**
Packit 85355f
TIFFTAG_ICCPROFILE	2	uint32*,void**	count, profile data
Packit 85355f
TIFFTAG_IMAGEDEPTH	1	uint32*
Packit 85355f
TIFFTAG_IMAGEDESCRIPTION	1	char**
Packit 85355f
TIFFTAG_IMAGELENGTH	1	uint32*
Packit 85355f
TIFFTAG_IMAGEWIDTH	1	uint32*
Packit 85355f
TIFFTAG_INKNAMES	1	char**
Packit 85355f
TIFFTAG_INKSET	1	uint16*
Packit 85355f
TIFFTAG_JPEGCOLORMODE	1	int*	JPEG pseudo-tag
Packit 85355f
TIFFTAG_JPEGQUALITY	1	int*	JPEG pseudo-tag
Packit 85355f
TIFFTAG_JPEGTABLES	2	uint32*,void**	count & tables
Packit 85355f
TIFFTAG_JPEGTABLESMODE	1	int*	JPEG pseudo-tag
Packit 85355f
TIFFTAG_MAKE	1	char**
Packit 85355f
TIFFTAG_MATTEING	1	uint16*
Packit 85355f
TIFFTAG_MAXSAMPLEVALUE	1	uint16*
Packit 85355f
TIFFTAG_MINSAMPLEVALUE	1	uint16*
Packit 85355f
TIFFTAG_MODEL	1	char**
Packit 85355f
TIFFTAG_ORIENTATION	1	uint16*
Packit 85355f
TIFFTAG_PAGENAME	1	char**
Packit 85355f
TIFFTAG_PAGENUMBER	2	uint16*
Packit 85355f
TIFFTAG_PHOTOMETRIC	1	uint16*
Packit 85355f
TIFFTAG_PHOTOSHOP	2	uint32*,void**	count, data
Packit 85355f
TIFFTAG_PLANARCONFIG	1	uint16*
Packit 85355f
TIFFTAG_PREDICTOR	1	uint16*
Packit 85355f
TIFFTAG_PRIMARYCHROMATICITIES	1	float**	6-entry array
Packit 85355f
TIFFTAG_REFERENCEBLACKWHITE	1	float**	6-entry array
Packit 85355f
TIFFTAG_RESOLUTIONUNIT	1	uint16*
Packit 85355f
TIFFTAG_RICHTIFFIPTC	2	uint32*,void**	count, data
Packit 85355f
TIFFTAG_ROWSPERSTRIP	1	uint32*
Packit 85355f
TIFFTAG_SAMPLEFORMAT	1	uint16*
Packit 85355f
TIFFTAG_SAMPLESPERPIXEL	1	uint16*
Packit 85355f
TIFFTAG_SMAXSAMPLEVALUE	1	double*
Packit 85355f
TIFFTAG_SMINSAMPLEVALUE	1	double*
Packit 85355f
TIFFTAG_SOFTWARE	1	char**
Packit 85355f
TIFFTAG_STONITS	1	double**
Packit 85355f
TIFFTAG_STRIPBYTECOUNTS	1	uint32**
Packit 85355f
TIFFTAG_STRIPOFFSETS	1	uint32**
Packit 85355f
TIFFTAG_SUBFILETYPE	1	uint32*
Packit 85355f
TIFFTAG_SUBIFD	2	uint16*,uint64**	count & offsets array
Packit 85355f
TIFFTAG_TARGETPRINTER	1	char**
Packit 85355f
TIFFTAG_THRESHHOLDING	1	uint16*
Packit 85355f
TIFFTAG_TILEBYTECOUNTS	1	uint32**
Packit 85355f
TIFFTAG_TILEDEPTH	1	uint32*
Packit 85355f
TIFFTAG_TILELENGTH	1	uint32*
Packit 85355f
TIFFTAG_TILEOFFSETS	1	uint32**
Packit 85355f
TIFFTAG_TILEWIDTH	1	uint32*
Packit 85355f
TIFFTAG_TRANSFERFUNCTION	1 or 3\(dg	uint16**1<
Packit 85355f
TIFFTAG_WHITEPOINT	1	float**	2-entry array
Packit 85355f
TIFFTAG_XMLPACKET	2	uint32*,void**	count, data
Packit 85355f
TIFFTAG_XPOSITION	1	float*
Packit 85355f
TIFFTAG_XRESOLUTION	1	float*
Packit 85355f
TIFFTAG_YCBCRCOEFFICIENTS	1	float**	3-entry array
Packit 85355f
TIFFTAG_YCBCRPOSITIONING	1	uint16*
Packit 85355f
TIFFTAG_YCBCRSUBSAMPLING	2	uint16*
Packit 85355f
TIFFTAG_YPOSITION	1	float*
Packit 85355f
TIFFTAG_YRESOLUTION	1	float*\(dd
Packit 85355f
.fi
Packit 85355f
\(dg If
Packit 85355f
.I SamplesPerPixel
Packit 85355f
is one, then a single array is returned; otherwise three arrays are returned.
Packit 85355f
.fi
Packit 85355f
\(dd The contents of this field are quite complex.  See 
Packit 85355f
.IR "The ICC Profile Format Specification" ,
Packit 85355f
Annex B.3 "Embedding ICC Profiles in TIFF Files" (available at
Packit 85355f
http://www.color.org) for an explanation.
Packit 85355f
.SH AUTOREGISTERED TAGS
Packit 85355f
If you can't find the tag in the table above that means this is an unsupported
Packit 85355f
tag and is not directly supported by
Packit 85355f
.BR libtiff(3TIFF)
Packit 85355f
library. You will still be able to read it's value if you know the data type of
Packit 85355f
that tag. For example, if you want to read the LONG value from the tag 33424
Packit 85355f
and ASCII string from the tag 36867 you can use the following code:
Packit 85355f
.PP
Packit 85355f
.RS
Packit 85355f
.nf
Packit 85355f
uint32  count;
Packit 85355f
void    *data;
Packit 85355f
Packit 85355f
TIFFGetField(tiff, 33424, &count, &data);
Packit 85355f
printf("Tag %d: %d, count %d\n", 33424, *(uint32 *)data, count);
Packit 85355f
TIFFGetField(tiff, 36867, &count, &data);
Packit 85355f
printf("Tag %d: %s, count %d\n", 36867, (char *)data, count);
Packit 85355f
.fi
Packit 85355f
.RE
Packit 85355f
.PP
Packit 85355f
.SH RETURN VALUES
Packit 85355f
1 is returned if the tag is defined in the current directory; otherwise a 0 is
Packit 85355f
returned.
Packit 85355f
.SH DIAGNOSTICS
Packit 85355f
All error messages are directed to the
Packit 85355f
.BR TIFFError (3TIFF)
Packit 85355f
routine.
Packit 85355f
.PP
Packit 85355f
.BR "Unknown field, tag 0x%x" .
Packit 85355f
An unknown tag was supplied.
Packit 85355f
.SH "SEE ALSO"
Packit 85355f
.BR TIFFOpen (3TIFF),
Packit 85355f
.BR TIFFSetField (3TIFF),
Packit 85355f
.BR TIFFSetDirectory (3TIFF),
Packit 85355f
.BR TIFFReadDirectory (3TIFF),
Packit 85355f
.BR TIFFWriteDirectory (3TIFF)
Packit 85355f
.BR libtiff (3TIFF),
Packit 85355f
.PP
Packit 85355f
Libtiff library home page:
Packit 85355f
.BR http://www.simplesystems.org/libtiff/