Blame man/TIFFSetField.3tiff

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