TIFFOpen (3)
Leading comments
$Id: TIFFOpen.3tiff,v 1.2 2005-07-01 12:36:22 dron Exp $ Copyright (c) 1988-1997 Sam Leffler Copyright (c) 1991-1997 Silicon Graphics, Inc. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of Sam Leffler and Silicon Graphics may not be used in any adv...
NAME
TIFFOpen, TIFFFdOpen, TIFFClientOpen - open aSYNOPSIS
#include <tiffio.h>
TIFF* TIFFOpen(const char *filename, const char *mode)
TIFF* TIFFFdOpen(const int fd, const char *filename, const char *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 )
DESCRIPTION
TIFFOpen opens aIf a file is opened for reading, the first
TIFFFdOpen is like TIFFOpen except that it opens a
TIFFClientOpen is like TIFFOpen except that the caller supplies a collection of functions that the library will use to do
OPTIONS
The open mode parameter can include the following flags in addition to the ``r'', ``w'', and ``a'' flags. Note however that option flags must follow the read-write-append specification.- l
-
When creating a new file force information be written with
Little-Endian byte order (but see below).
By default the library will create new files using the native
CPUbyte order.
- b
-
When creating a new file force information be written with
Big-Endian byte order (but see below).
By default the library will create new files using the native
CPUbyte order.
- L
-
Force image data that is read or written to be treated with
bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB). Note that this is the opposite to the way the library has worked from its inception.
- B
-
Force image data that is read or written to be treated with
bits filled from Most Significant Bit (MSB) to Least Significant Bit (LSB); this is the default.
- H
-
Force image data that is read or written to be treated with
bits filled in the same order as the native
CPU.
- M
- Enable the use of memory-mapped files for images opened read-only. If the underlying system does not support memory-mapped files or if the specific image being opened cannot be memory-mapped then the library will fallback to using the normal system interface for reading information. By default the library will attempt to use memory-mapped files.
- m
- Disable the use of memory-mapped files.
- C
- Enable the use of ``strip chopping'' when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically convert the single-strip image to multiple strips, each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used to read an image because the library normally reads each strip in its entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate strips. Finally, note that default handling of strip chopping is a compile-time configuration parameter. The default behaviour, for backwards compatibility, is to enable strip chopping.
- c
- Disable the use of strip chopping when reading images.
- h
- Read TIFF header only, do not load the first image directory. That could be useful in case of the broken first directory. We can open the file and proceed to the other directories.
BYTE ORDER
TheRETURN VALUES
Upon successful completion TIFFOpen, TIFFFdOpen, and TIFFClientOpen return aDIAGNOSTICS
All error messages are directed to the TIFFError(3TIFF) routine. Likewise, warning messages are directed to the TIFFWarning(3TIFF) routine."%s": Bad mode. The specified mode parameter was not one of ``r'' (read), ``w'' (write), or ``a'' (append).
%s: Cannot open. TIFFOpen() was unable to open the specified filename for read/writing.
Cannot read TIFF header. An error occurred while attempting to read the header information.
Error writing TIFF header. An error occurred while writing the default header information for a new file.
Not a TIFF file, bad magic number %d (0x%x). The magic number in the header was not (hex) 0x4d4d or (hex) 0x4949.
Not a TIFF file, bad version number %d (0x%x). The version field in the header was not 42 (decimal).
Cannot append to file that has opposite byte ordering. A file with a byte ordering opposite to the native byte ordering of the current machine was opened for appending (``a''). This is a limitation of the library.