10 $}ˆl–Ãa¾””†»%åÆÃq§”Å£é „iÖškèÂë?÷}/* * 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. */ #ifndef _TIFF_ #define _TIFF_ #include "tiffconf.h" /* * Tag Image File Format (TIFF) * * Based on Rev 6.0 from: * Developer's Desk * Aldus Corporation * 411 First Ave. South * Suite 200 * Seattle, WA 98104 * 206-622-5500 * * (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf) * * For BigTIFF design notes see the following links * http://www.remotesensing.org/libtiff/bigtiffdesign.html * http://www.awaresystems.be/imaging/tiff/bigtiff.html */ #define TIFF_VERSION_CLASSIC 42 #define TIFF_VERSION_BIG 43 #define TIFF_BIGENDIAN 0x4d4d #define TIFF_LITTLEENDIAN 0x4949 #define MDI_LITTLEENDIAN 0x5045 #define MDI_BIGENDIAN 0x4550 /* * Intrinsic data types required by the file format: * * 8-bit quantities int8_t/uint_8_t * 16-bit quantities int16_t/uint_16_t * 32-bit quantities int32_t/uint_32_t * 64-bit quantities int64_t/uint_64_t * strings unsigned char* */ #ifdef __GNUC__ #define TIFF_GCC_DEPRECATED __attribute__((deprecated)) #else #define TIFF_GCC_DEPRECATED #endif #ifdef _MSC_VER #define TIFF_MSC_DEPRECATED __declspec(deprecated("libtiff type deprecated; please use corresponding C99 stdint.h type")) #else #define TIFF_MSC_DEPRECATED #endif #ifndef TIFF_DISABLE_DEPRECATED typedef TIFF_MSC_DEPRECATED int8_t int8 TIFF_GCC_DEPRECATED; typedef TIFF_MSC_DEPRECATED uint8_t uint8 TIFF_GCC_DEPRECATED; typedef TIFF_MSC_DEPRECATED int16_t int16 TIFF_GCC_DEPRECATED; typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED; typedef TIFF_MSC_DEPRECATED int32_t int32 TIFF_GCC_DEPRECATED; typedef TIFF_MSC_DEPRECATED uint32_t uint32 TIFF_GCC_DEPRECATED; typedef TIFF_MSC_DEPRECATED int64_t int64 TIFF_GCC_DEPRECATED; typedef TIFF_MSC_DEPRECATED uint64_t uint64 TIFF_GCC_DEPRECATED; #endif /* TIFF_DISABLE_DEPRECATED */ /* * Some types as promoted in a variable argument list * We use uint16_vap rather then directly using int, because this way * we document the type we actually want to pass through, conceptually, * rather then confusing the issue by merely stating the type it gets * promoted to */ typedef int uint16_vap; /* * TIFF header. */ typedef struct { uint16_t tiff_magic; /* magic number (defines byte order) */ uint16_t tiff_version; /* TIFF version number */ } TIFFHeaderCommon; typedef struct { uint16_t tiff_magic; /* magic number (defines byte order) */ uint16_t tiff_version; /* TIFF version number */ uint32_t tiff_diroff; /* byte offset to first directory */ } TIFFHeaderClassic; typedef struct { uint16_t tiff_magic; /* magic number (defines byte order) */ uint16_t tiff_version; /* TIFF version number */ uint16_t tiff_offsetsize; /* size of offsets, should be 8 */ uint16_t tiff_unused; /* unused word, should