TIFFOPEN(3tiff) LibTIFF TIFFOPEN(3tiff)
NAME
TIFFOpen - open a TIFF file for reading or writing
SYNOPSIS
#include <tiffio.h>
TIFF *TIFFOpen(const char *filename, const char *mode)
TIFF *TIFFOpenW(const wchar_t *name, const char *mode)
TIFF *TIFFFdOpen(const int fd, const char *filename, const char *mode)
TIFF *TIFFOpenExt(const char *filename, const char *mode,
TIFFOpenOptions *opts)
TIFF *TIFFOpenWExt(const wchar_t *name, const char *mode,
TIFFOpenOptions *opts)
TIFF *TIFFFdOpenExt(const int fd, const char *filename, const char
*mode, TIFFOpenOptions *opts)
const char *TIFFSetFileName(TIFF *tif)
int TIFFSetFileno(TIFF *tif, int fd)
int TIFFSetMode(TIFF *tif, int mode)
typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t)
typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int)
typedef int (*TIFFCloseProc)(thandle_t)
typedef toff_t (*TIFFSizeProc)(thandle_t)
typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*)
typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t)
TIFF *TIFFClientOpen(const char *filename, const char *mode, thandle_t
clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc,
TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc,
TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
TIFF *TIFFClientOpenExt(const char *filename, const char *mode,
thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc
writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc
sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc,
TIFFOpenOptions *opts)
thandle_t TIFFClientdata(TIFF *tif)
thandle_t TIFFSetClientdata(TIFF *tif, thandle_t newvalue)
DESCRIPTION
TIFFOpen() opens a TIFF file whose name is filename and returns a han-
dle to be used in subsequent calls to routines in libtiff. If the open
operation fails, then NULL (0) is returned. The mode parameter speci-
fies if the file is to be opened for reading (r), writing (w), or ap-
pending (a) and, optionally, whether to override certain default as-
pects of library operation (see below). When a file is opened for ap-
pending, existing data will not be touched; instead new data will be
written as additional subfiles. If an existing file is opened for
writing, all previous data is overwritten.
If a file is opened for reading, the first TIFF directory in the file
is automatically read (also see TIFFSetDirectory() for reading directo-
ries other than the first). If a file is opened for writing or append-
ing, a default directory is automatically created for writing subse-
quent data. This directory has all the default values specified in
TIFF Revision 6.0:
o BitsPerSample = 1,
o ThreshHolding = "bilevel art scan"
o FillOrder = 1 (most significant bit of each data byte is filled
first)
o Orientation = 1 (the 0th row represents the visual top of the image,
and the 0th column represents the visual left hand side),
o SamplesPerPixel = 1,
o RowsPerStrip = ,
o ResolutionUnit = 2 (inches), and
o Compression = 1 (no compression).
To alter these values, or to define values for additional fields,
TIFFSetField() must be used.
A file can also be opened for reading and writing with mode (r+). In
this case, the first TIFF directory in the file is automatically read,
but calls to TIFFSetField() are put into a fresh directory, which will
be appended when the file is closed.
TIFFOpenW() opens a TIFF file with a Unicode filename, for read/writ-
ing.
TIFFFdOpen() is like TIFFOpen() except that it opens a TIFF file given
an open file descriptor fd. The file's name and mode must reflect that
of the open descriptor. The object associated with the file descriptor
must support random access. In order to close a TIFF file opened with
TIFFFdOpen() first TIFFCleanup() should be called to free the internal
TIFF structure without closing the file handle and afterwards the file
should be closed using its file descriptor fd.
TIFFOpenExt() (added in libtiff 4.5) is like TIFFOpen(), but options,
such as re-entrant error and warning handlers may be passed with the
opts argument. The opts argument may be NULL. Refer to TIFFOpenOptions
for allocating and filling the opts argument parameters. The allocated
memory for TIFFOpenOptions can be released straight after successful
execution of the related "TIFFOpenExt" functions.
TIFFOpenWExt() (added in libtiff 4.5) is like TIFFOpenExt(), but opens
a TIFF file with a Unicode filename.
TIFFFdOpenExt() (added in libtiff 4.5) is like TIFFFdOpen(), but op-
tions, such as re-entrant error and warning handlers may be passed with
the opts argument. The opts argument may be NULL. Refer to
TIFFOpenOptions for filling the opts argument.
TIFFSetFileName() sets the file name in the tif-structure and returns
the old file name.
TIFFSetFileno() overwrites a copy of the open file's I/O descriptor,
that was saved when the TIFF file was first opened, and returns the
previous value. See note below.
TIFFSetMode() sets the libtiff open mode in the tif-structure and re-
turns the old mode.
TIFFClientOpen() is like TIFFOpen() except that the caller supplies a
collection of functions that the library will use to do UNIX-like I/O
operations. The readproc and writeproc functions are called to read
and write data at the current file position. seekproc is called to
change the current file position la lseek() (2). closeproc is invoked
to release any resources associated with an open file. sizeproc is in-
voked to obtain the size in bytes of a file. mapproc and unmapproc are
called to map and unmap a file's contents in memory; c.f. mmap() (2)
and munmap() (2). The clientdata parameter is an opaque "handle"
passed to the client-specified routines passed as parameters to
TIFFClientOpen().
TIFFClientOpenExt() (added in libtiff 4.5) is like TIFFClientOpen(),
but options argument opts like for TIFFOpenExt() can be passed.
TIFFClientdata() returns open file's clientdata handle, which is the
real open file's I.
TIFFOPEN(3tiff) LibTIFF TIFFOPEN(3tiff)
NAME
TIFFOpen - open a TIFF file for reading or writing
SYNOPSIS
#include <tiffio.h>
TIFF *TIFFOpen(const char *filename, const char *mode)
TIFF *TIFFOpenW(const wchar_t *name, const char *mode)
TIFF *TIFFFdOpen(const int fd, const char *filename, const char *mode)
TIFF *TIFFOpenExt(const char *filename, const char *mode,
TIFFOpenOptions *opts)
TIFF *TIFFOpenWExt(const wchar_t *name, const char *mode,
TIFFOpenOptions *opts)
TIFF *TIFFFdOpenExt(const int fd, const char *filename, const char
*mode, TIFFOpenOptions *opts)
const char *TIFFSetFileName(TIFF *tif)
int TIFFSetFileno(TIFF *tif, int fd)
int TIFFSetMode(TIFF *tif, int mode)
typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t)
typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int)
typedef int (*TIFFCloseProc)(thandle_t)
typedef toff_t (*TIFFSizeProc)(thandle_t)
typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*)
typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t)
TIFF *TIFFClientOpen(const char *filename, const char *mode, thandle_t
clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc,
TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc,
TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
TIFF *TIFFClientOpenExt(const char *filename, const char *mode,
thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc
writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc
sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc,
TIFFOpenOptions *opts)
thandle_t TIFFClientdata(TIFF *tif)
thandle_t TIFFSetClientdata(TIFF *tif, thandle_t newvalue)
DESCRIPTION
TIFFOpen() opens a TIFF file whose name is filename and returns a han-
dle to be used in subsequent calls to routines in libtiff. If the open
operation fails, then NULL (0) is returned. The mode parameter speci-
fies if the file is to be opened for reading (r), writing (w), or ap-
pending (a) and, optionally, whether to override certain default as-
pects of library operation (see below). When a file is opened for ap-
pending, existing data will not be touched; instead new data will be
written as additional subfiles. If an existing file is opened for
writing, all previous data is overwritten.
If a file is opened for reading, the first TIFF directory in the file
is automatically read (also see TIFFSetDirectory() for reading directo-
ries other than the first). If a file is opened for writing or append-
ing, a default directory is automatically created for writing subse-
quent data. This directory has all the default values specified in
TIFF Revision 6.0:
o BitsPerSample = 1,
o ThreshHolding = "bilevel art scan"
o FillOrder = 1 (most significant bit of each data byte is filled
first)
o Orientation = 1 (the 0th row represents the visual top of the image,
and the 0th column represents the visual left hand side),
o SamplesPerPixel = 1,
o RowsPerStrip = ,
o ResolutionUnit = 2 (inches), and
o Compression = 1 (no compression).
To alter these values, or to define values for additional fields,
TIFFSetField() must be used.
A file can also be opened for reading and writing with mode (r+). In
this case, the first TIFF directory in the file is automatically read,
but calls to TIFFSetField() are put into a fresh directory, which will
be appended when the file is closed.
TIFFOpenW() opens a TIFF file with a Unicode filename, for read/writ-
ing.
TIFFFdOpen() is like TIFFOpen() except that it opens a TIFF file given
an open file descriptor fd. The file's name and mode must reflect that
of the open descriptor. The object associated with the file descriptor
must support random access. In order to close a TIFF file opened with
TIFFFdOpen() first TIFFCleanup() should be called to free the internal
TIFF structure without closing the file handle and afterwards the file
should be closed using its file descriptor fd.
TIFFOpenExt() (added in libtiff 4.5) is like TIFFOpen(), but options,
such as re-entrant error and warning handlers may be passed with the
opts argument. The opts argument may be NULL. Refer to TIFFOpenOptions
for allocating and filling the opts argument parameters. The allocated
memory for TIFFOpenOptions can be released straight after successful
execution of the related "TIFFOpenExt" functions.
TIFFOpenWExt() (added in libtiff 4.5) is like TIFFOpenExt(), but opens
a TIFF file with a Unicode filename.
TIFFFdOpenExt() (added in libtiff 4.5) is like TIFFFdOpen(), but op-
tions, such as re-entrant error and warning handlers may be passed with
the opts argument. The opts argument may be NULL. Refer to
TIFFOpenOptions for filling the opts argument.
TIFFSetFileName() sets the file name in the tif-structure and returns
the old file name.
TIFFSetFileno() overwrites a copy of the open file's I/O descriptor,
that was saved when the TIFF file was first opened, and returns the
previous value. See note below.
TIFFSetMode() sets the libtiff open mode in the tif-structure and re-
turns the old mode.
TIFFClientOpen() is like TIFFOpen() except that the caller supplies a
collection of functions that the library w
4.5 Jan 03, 2025 TIFFOPEN(3tiff)
Czas wygenerowania: 0.00011 sek.
Created with the man page lookup class by Andrew Collington.
Based on a C man page viewer by Vadim Pavlov
Unicode soft-hyphen fix (as used by RedHat) by Dan Edwards
Some optimisations by Eli Argon
Caching idea and code contribution by James Richardson
Copyright © 2003-2025 Linux.pl
Hosted by Hosting Linux.pl