roentgen b75cab
.\" $Id: TIFFSetField.3tiff,v 1.5 2010-05-06 02:54:46 olivier Exp $
roentgen b75cab
.\"
roentgen b75cab
.\" Copyright (c) 1988-1997 Sam Leffler
roentgen b75cab
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
roentgen b75cab
.\"
roentgen b75cab
.\" Permission to use, copy, modify, distribute, and sell this software and 
roentgen b75cab
.\" its documentation for any purpose is hereby granted without fee, provided
roentgen b75cab
.\" that (i) the above copyright notices and this permission notice appear in
roentgen b75cab
.\" all copies of the software and related documentation, and (ii) the names of
roentgen b75cab
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
roentgen b75cab
.\" publicity relating to the software without the specific, prior written
roentgen b75cab
.\" permission of Sam Leffler and Silicon Graphics.
roentgen b75cab
.\" 
roentgen b75cab
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
roentgen b75cab
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
roentgen b75cab
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
roentgen b75cab
.\" 
roentgen b75cab
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
roentgen b75cab
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
roentgen b75cab
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
roentgen b75cab
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
roentgen b75cab
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
roentgen b75cab
.\" OF THIS SOFTWARE.
roentgen b75cab
.\"
roentgen b75cab
.if n .po 0
roentgen b75cab
.TH TIFFSetField 3TIFF "October 29, 2004" "libtiff"
roentgen b75cab
.SH NAME
roentgen b75cab
TIFFSetField, TIFFVSetField \- set the value(s) of a tag in a
roentgen b75cab
.SM TIFF
roentgen b75cab
file open for writing
roentgen b75cab
.SH SYNOPSIS
roentgen b75cab
.B "#include <tiffio.h>"</tiffio.h>
roentgen b75cab
.sp
roentgen b75cab
.BI "int TIFFSetField(TIFF *" tif ", ttag_t " tag ", " ... ")"
roentgen b75cab
.sp
roentgen b75cab
.B "#include <stdarg.h>"</stdarg.h>
roentgen b75cab
.sp
roentgen b75cab
.BI "int TIFFVSetField(TIFF *" tif ", ttag_t " tag ", va_list " ap ")"
roentgen b75cab
.SH DESCRIPTION
roentgen b75cab
.IR TIFFSetField
roentgen b75cab
sets the value of a field
roentgen b75cab
or pseudo-tag in the current directory associated with
roentgen b75cab
the open
roentgen b75cab
.SM TIFF
roentgen b75cab
file
roentgen b75cab
.IR tif .
roentgen b75cab
(A
roentgen b75cab
.I pseudo-tag 
roentgen b75cab
is a parameter that is used to control the operation of the
roentgen b75cab
.SM TIFF
roentgen b75cab
library but whose value is not read or written to the underlying file.)
roentgen b75cab
To set the value of a field
roentgen b75cab
the file must have been previously opened for writing with
roentgen b75cab
.IR TIFFOpen (3TIFF);
roentgen b75cab
pseudo-tags can be set whether the file was opened for reading
roentgen b75cab
or writing.
roentgen b75cab
The field is identified by
roentgen b75cab
.IR tag ,
roentgen b75cab
one of the values defined in the include file
roentgen b75cab
.B tiff.h
roentgen b75cab
(see also the table below).
roentgen b75cab
The actual value is specified using a variable argument list,
roentgen b75cab
as prescribed by the
roentgen b75cab
.IR stdarg (3)
roentgen b75cab
interface (\c
roentgen b75cab
or, on some machines, the
roentgen b75cab
.IR varargs (3)
roentgen b75cab
interface.)
roentgen b75cab
.PP
roentgen b75cab
.IR TIFFVSetField
roentgen b75cab
is functionally equivalent to
roentgen b75cab
.IR TIFFSetField
roentgen b75cab
except that it takes a pointer to a variable
roentgen b75cab
argument list.
roentgen b75cab
.I TIFFVSetField
roentgen b75cab
is useful for writing routines that are layered
roentgen b75cab
on top of the functionality provided by
roentgen b75cab
.IR TIFFSetField .
roentgen b75cab
.PP
roentgen b75cab
The tags understood by
roentgen b75cab
.IR libtiff ,
roentgen b75cab
the number of parameter values, and the
roentgen b75cab
expected types for the parameter values are shown below.
roentgen b75cab
The data types are:
roentgen b75cab
.I char*
roentgen b75cab
is null-terminated string and corresponds to the
roentgen b75cab
.SM ASCII
roentgen b75cab
data type;
roentgen b75cab
.I uint16
roentgen b75cab
is an unsigned 16-bit value;
roentgen b75cab
.I uint32
roentgen b75cab
is an unsigned 32-bit value;
roentgen b75cab
.I uint16*
roentgen b75cab
is an array of unsigned 16-bit values.
roentgen b75cab
.I void*
roentgen b75cab
is an array of data values of unspecified type.
roentgen b75cab
roentgen b75cab
Consult the
roentgen b75cab
.SM TIFF
roentgen b75cab
specification for information on the meaning of each tag.
roentgen b75cab
.PP
roentgen b75cab
.nf
roentgen b75cab
.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'TIFFFaxFillFunc \(dg'u+2n
roentgen b75cab
\fITag Name\fP	\fICount\fP	\fITypes\fP	\fINotes\fP
roentgen b75cab
.sp 5p
roentgen b75cab
TIFFTAG_ARTIST	1	char*
roentgen b75cab
TIFFTAG_BADFAXLINES	1	uint32
roentgen b75cab
TIFFTAG_BITSPERSAMPLE	1	uint16	\(dg
roentgen b75cab
TIFFTAG_CLEANFAXDATA	1	uint16
roentgen b75cab
TIFFTAG_COLORMAP	3	uint16*	1<
roentgen b75cab
TIFFTAG_COMPRESSION	1	uint16	\(dg
roentgen b75cab
TIFFTAG_CONSECUTIVEBADFAXLINES	1	uint32
roentgen b75cab
TIFFTAG_COPYRIGHT	1	char*
roentgen b75cab
TIFFTAG_DATETIME	1	char*
roentgen b75cab
TIFFTAG_DOCUMENTNAME	1	char*
roentgen b75cab
TIFFTAG_DOTRANGE	2	uint16
roentgen b75cab
TIFFTAG_EXTRASAMPLES	2	uint16,uint16*	\(dg count & types array
roentgen b75cab
TIFFTAG_FAXFILLFUNC	1	TIFFFaxFillFunc	G3/G4 compression pseudo-tag
roentgen b75cab
TIFFTAG_FAXMODE	1	int	\(dg G3/G4 compression pseudo-tag
roentgen b75cab
TIFFTAG_FILLORDER	1	uint16	\(dg
roentgen b75cab
TIFFTAG_GROUP3OPTIONS	1	uint32	\(dg
roentgen b75cab
TIFFTAG_GROUP4OPTIONS	1	uint32	\(dg
roentgen b75cab
TIFFTAG_HALFTONEHINTS	2	uint16
roentgen b75cab
TIFFTAG_HOSTCOMPUTER	1	char*
roentgen b75cab
TIFFTAG_ICCPROFILE	2	uint32,void*	count, profile data
roentgen b75cab
TIFFTAG_IMAGEDEPTH	1	uint32	\(dg
roentgen b75cab
TIFFTAG_IMAGEDESCRIPTION	1	char*
roentgen b75cab
TIFFTAG_IMAGELENGTH	1	uint32
roentgen b75cab
TIFFTAG_IMAGEWIDTH	1	uint32	\(dg
roentgen b75cab
TIFFTAG_INKNAMES	2	uint16, char*
roentgen b75cab
TIFFTAG_INKSET	1	uint16	\(dg
roentgen b75cab
TIFFTAG_JPEGCOLORMODE	1	int	\(dg JPEG pseudo-tag
roentgen b75cab
TIFFTAG_JPEGQUALITY	1	int	JPEG pseudo-tag
roentgen b75cab
TIFFTAG_JPEGTABLES	2	uint32*,void*	\(dg count & tables
roentgen b75cab
TIFFTAG_JPEGTABLESMODE	1	int	\(dg JPEG pseudo-tag
roentgen b75cab
TIFFTAG_MAKE	1	char*
roentgen b75cab
TIFFTAG_MATTEING	1	uint16	\(dg
roentgen b75cab
TIFFTAG_MAXSAMPLEVALUE	1	uint16
roentgen b75cab
TIFFTAG_MINSAMPLEVALUE	1	uint16
roentgen b75cab
TIFFTAG_MODEL	1	char*
roentgen b75cab
TIFFTAG_ORIENTATION	1	uint16
roentgen b75cab
TIFFTAG_PAGENAME	1	char*
roentgen b75cab
TIFFTAG_PAGENUMBER	2	uint16
roentgen b75cab
TIFFTAG_PHOTOMETRIC	1	uint16
roentgen b75cab
TIFFTAG_PHOTOSHOP	?	uint32,void*	count, data
roentgen b75cab
TIFFTAG_PLANARCONFIG	1	uint16	\(dg
roentgen b75cab
TIFFTAG_PREDICTOR	1	uint16	\(dg
roentgen b75cab
TIFFTAG_PRIMARYCHROMATICITIES	1	float*	6-entry array
roentgen b75cab
TIFFTAG_REFERENCEBLACKWHITE	1	float*	\(dg 6-entry array
roentgen b75cab
TIFFTAG_RESOLUTIONUNIT	1	uint16
roentgen b75cab
TIFFTAG_RICHTIFFIPTC	2	uint32,void*	count, data
roentgen b75cab
TIFFTAG_ROWSPERSTRIP	1	uint32	\(dg must be > 0
roentgen b75cab
TIFFTAG_SAMPLEFORMAT	1	uint16	\(dg
roentgen b75cab
TIFFTAG_SAMPLESPERPIXEL	1	uint16	\(dg value must be <= 4
roentgen b75cab
TIFFTAG_SMAXSAMPLEVALUE	1	double
roentgen b75cab
TIFFTAG_SMINSAMPLEVALUE	1	double
roentgen b75cab
TIFFTAG_SOFTWARE	1	char*
roentgen b75cab
TIFFTAG_STONITS	1	double	\(dg
roentgen b75cab
TIFFTAG_SUBFILETYPE	1	uint32
roentgen b75cab
TIFFTAG_SUBIFD	2	uint16,uint32*	count & offsets array
roentgen b75cab
TIFFTAG_TARGETPRINTER	1	char*
roentgen b75cab
TIFFTAG_THRESHHOLDING	1	uint16
roentgen b75cab
TIFFTAG_TILEDEPTH	1	uint32	\(dg
roentgen b75cab
TIFFTAG_TILELENGTH	1	uint32	\(dg must be a multiple of 8
roentgen b75cab
TIFFTAG_TILEWIDTH	1	uint32	\(dg must be a multiple of 8
roentgen b75cab
TIFFTAG_TRANSFERFUNCTION	1 or 3\(dd uint16*	1<
roentgen b75cab
TIFFTAG_WHITEPOINT	1	float*	2-entry array
roentgen b75cab
TIFFTAG_XMLPACKET	2	uint32,void*	count, data
roentgen b75cab
TIFFTAG_XPOSITION	1	float
roentgen b75cab
TIFFTAG_XRESOLUTION	1	float
roentgen b75cab
TIFFTAG_YCBCRCOEFFICIENTS	1	float*	\(dg 3-entry array
roentgen b75cab
TIFFTAG_YCBCRPOSITIONING	1	uint16	\(dg
roentgen b75cab
TIFFTAG_YCBCRSAMPLING	2	uint16	\(dg
roentgen b75cab
TIFFTAG_YPOSITION	1	float
roentgen b75cab
TIFFTAG_YRESOLUTION	1	float
roentgen b75cab
.fi
roentgen b75cab
.sp 5p
roentgen b75cab
\(dg Tag may not have its values changed once data is written.
roentgen b75cab
.br
roentgen b75cab
.fi
roentgen b75cab
\(dd
roentgen b75cab
If
roentgen b75cab
.I SamplesPerPixel
roentgen b75cab
is one, then a single array is passed; otherwise three arrays should be
roentgen b75cab
passed.
roentgen b75cab
.fi
roentgen b75cab
* The contents of this field are quite complex.  See 
roentgen b75cab
.BR "The ICC Profile Format Specification" ,
roentgen b75cab
Annex B.3 "Embedding ICC Profiles in TIFF Files"
roentgen b75cab
(available at http://www.color.org) for an explanation.
roentgen b75cab
.br
roentgen b75cab
.SH "RETURN VALUES"
roentgen b75cab
1 is returned if the operation was successful.
roentgen b75cab
Otherwise, 0 is returned if an error was detected.
roentgen b75cab
.SH DIAGNOSTICS
roentgen b75cab
All error messages are directed to the
roentgen b75cab
.BR TIFFError (3TIFF)
roentgen b75cab
routine.
roentgen b75cab
.PP
roentgen b75cab
\fB%s: Cannot modify tag "%s" while writing\fP.
roentgen b75cab
Data has already been written to the file, so the
roentgen b75cab
specified tag's value can not be changed.
roentgen b75cab
This restriction is applied to all tags that affect
roentgen b75cab
the format of written data.
roentgen b75cab
.PP
roentgen b75cab
\fB%d: Bad value for "%s"\fP.
roentgen b75cab
An invalid value was supplied for the named tag.
roentgen b75cab
.SH "SEE ALSO"
roentgen b75cab
.BR TIFFOpen (3TIFF),
roentgen b75cab
.BR TIFFGetField (3TIFF),
roentgen b75cab
.BR TIFFSetDirectory (3TIFF),
roentgen b75cab
.BR TIFFWriteDirectory (3TIFF),
roentgen b75cab
.BR TIFFReadDirectory (3TIFF),
roentgen b75cab
.BR libtiff (3TIFF)
roentgen b75cab
.PP
roentgen b75cab
Libtiff library home page:
roentgen b75cab
.BR http://www.remotesensing.org/libtiff/