⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tiffopen.3t

📁 tiff文件开发库
💻 3T
字号:
.\" $Header: /cvsroot/osrs/libtiff/man/TIFFOpen.3t,v 1.1.1.1 1999/07/27 21:50:27 mike 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 advertising or.\" publicity relating to the software without the specific, prior written.\" permission of Sam Leffler and Silicon Graphics..\" .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  .\" .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE .\" OF THIS SOFTWARE..\".if n .po 0.TH TIFFOpen 3T "January 9, 1996".SH NAMETIFFOpen, TIFFFdOpen, TIFFClientOpen \- open a.SM TIFFfile for reading or writing.SH SYNOPSIS.nf.B "#include <tiffio.h>".B "TIFF* TIFFOpen(const char* filename, const char* mode)".sp 5p.B "TIFF* TIFFFdOpen(const int fd, const char* filename, const char* mode)".sp 5p.B "typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);".B "typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);".B "typedef int (*TIFFCloseProc)(thandle_t);".B "typedef toff_t (*TIFFSizeProc)(thandle_t);".B "typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);".B "typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);".sp 5p.B "TIFF* TIFFClientOpen(const char* filename, const char* mode, thandle_t clientdata,".B "    TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc,".B "    TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc,".B "    TIFFUnmapFileProc unmapproc)".fi.SH DESCRIPTION.IR TIFFOpenopens a.SM TIFFfile whose name is.I filenameand returns a handle to be used in subsequent calls to routines in.IR libtiff .If the open operation fails, then zero is returned.The.I modeparameter specifies if the file is to be opened for reading (``r''),writing (``w''), or appending (``a'') and, optionally, whetherto override certain default aspects of library operation (see below).When a file is opened for appending, existing data will notbe touched; instead new data will be written as additional subfiles.If an existing file is opened for writing, all previous data isoverwritten..PPIf a file is opened for reading, the first.SM TIFFdirectory in the file is automatically read(also see.IR TIFFSetDirectory (3T)for reading directories other than the first).If a file is opened for writing or appending, a default directoryis automatically created for writing subsequent data.This directory has all the default values specified in.SM TIFFRevision 6.0:.IR BitsPerSample =1,.IR ThreshHolding "=bilevel art scan,".IR FillOrder =1(most significant bit of each data byte is filled first),.IR Orientation =1(the 0th row represents the visual top of the image, and the 0thcolumn represents the visual left hand side),.IR SamplesPerPixel =1,.IR RowsPerStrip =infinity,.IR ResolutionUnit =2(inches), and.IR Compression =1(no compression).To alter these values, or to define values for additional fields,.IR TIFFSetField (3T)must be used..PP.IR TIFFFdOpenis like.IR TIFFOpenexcept that it opens a.SM TIFFfile given an open file descriptor.IR fd .The file's name and mode must reflect that of the open descriptor.The object associated with the file descriptor.BR "must support random access" ..PP.IR TIFFClientOpenis like.IR TIFFOpenexcept that the caller supplies a collection of functions that thelibrary will use to do \s-1UNIX\s+1-like I/O operations. The.I readprocand.I writeprocare called to read and write data at the current file position..I seekprocis called to change the current file position a la.IR lseek (2)..I closeprocis invoked to release any resources associated with an open file..I sizeprocis invoked to obtain the size in bytes of a file..I mapprocand.I unmapprocare called to map and unmap a file's contents in memory; c.f..IR mmap (2)and.IR munmap (2).The.I clientdataparameter is an opaque ``handle'' passed to the client-specifiedroutines passed as parameters to.IR TIFFClientOpen ..SH OPTIONSThe open mode parameter can include the following flags inaddition to the ``r'', ``w'', and ``a'' flags.Note however that option flags must follow the read-write-appendspecification..TP.B lWhen creating a new file force information be written withLittle-Endian byte order (but see below).By default the library will create new files using the native.SM CPUbyte order..TP.B bWhen creating a new file force information be written withBig-Endian byte order (but see below).By default the library will create new files using the native.SM CPUbyte order..TP.B LForce image data that is read or written to be treated withbits filled from Least Significant Bit (\s-1LSB\s+1) toMost Significant Bit (\s-1MSB\s+1).Note that this is the opposite to the way the library hasworked from its inception..TP.B BForce image data that is read or written to be treated withbits filled from Most Significant Bit (\s-1MSB\s+1) toLeast Significant Bit (\s-1LSB\s+1); this is the default..TP.B HForce image data that is read or written to be treated withbits filled in the same order as the native .SM CPU..TP.B MEnable the use of memory-mapped files for images opened read-only.If the underlying system does not support memory-mapped filesor if the specific image being opened cannot be memory-mappedthen the library will fallback to using the normal system interfacefor reading information.By default the library will attempt to use memory-mapped files..TP.B mDisable the use of memory-mapped files..TP.B CEnable the use of ``strip chopping'' when reading imagesthat are comprised of a single strip or tile of uncompressed data.Strip chopping is a mechanism by which the library will automaticallyconvert 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 usedto read an image because the library normally reads each stripin its entirety.Strip chopping does however alter the apparent contents of theimage because when an image is divided into multiple strips itlooks as though the underlying file contains multiple separatestrips.Finally, note that default handling of strip chopping is a compile-timeconfiguration parameter.The default behaviour, for backwards compatibility, is to enablestrip chopping..TP.B cDisable the use of strip chopping when reading images..SH "BYTE ORDER"The .SM TIFFspecification (\fBall versions\fP) states that compliant readers.IR "must be capable of reading images written in either byte order" .Nonetheless some software that claims to support the reading of.SM TIFFimages is incapable of reading images in anything but the native.SM CPUbyte order on which the software was written.(Especially notoriousare applications written to run on Intel-based machines.)By default the library will create new files with the nativebyte-order of the .SM CPUon which the application is run.This ensures optimal performance and is portable to any applicationthat conforms to the TIFF specification.To force the library to use a specific byte-order when creatinga new file the ``b'' and ``l'' option flags may be included inthe call to open a file; for example, ``wb'' or ``wl''..SH "RETURN VALUES"Upon successful completion .IR TIFFOpen ,.IR TIFFFdOpen ,and.IR TIFFClientOpenreturn a .SM TIFFpointer.Otherwise, NULL is returned..SH DIAGNOSTICSAll error messages are directed to the.IR TIFFError (3T)routine.Likewise, warning messages are directed to the.IR TIFFWarning (3T)routine..PP\fB"%s": Bad mode\fP.The specified.I modeparameter was not one of ``r'' (read), ``w'' (write), or ``a'' (append)..PP.BR "%s: Cannot open" ..IR TIFFOpen ()was unable to open the specified filename for read/writing..PP.BR "Cannot read TIFF header" .An error occurred while attempting to read the header information..PP.BR "Error writing TIFF header" .An error occurred while writing the default header informationfor a new file..PP.BR "Not a TIFF file, bad magic number %d (0x%x)" .The magic number in the header was not (hex)0x4d4d or (hex) 0x4949..PP.BR "Not a TIFF file, bad version number %d (0x%x)" .The version field in the header was not 42 (decimal)..PP.BR "Cannot append to file that has opposite byte ordering" .A file with a byte ordering opposite to the native byteordering of the current machine was opened for appending (``a'').This is a limitation of the library..SH "SEE ALSO".IR libtiff (3T),.IR TIFFClose (3T)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -