37#ifdef HAVE_SYS_TYPES_H
54extern void *
lfind(
const void *,
const void *,
size_t *,
size_t,
55 int (*)(
const void *,
const void *));
58#if !defined(HAVE_SNPRINTF) && !defined(HAVE__SNPRINTF)
60#define snprintf _TIFF_snprintf_f
68#ifndef STRIP_SIZE_DEFAULT
69# define STRIP_SIZE_DEFAULT 8192
72#define streq(a,b) (strcmp(a,b) == 0)
73#define strneq(a,b,n) (strncmp(a,b,n) == 0)
80#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
81#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
86#define TIFF_UINT32_MAX 0xFFFFFFFFU
91#define TIFF_UINT64_MAX (((uint64)(TIFF_UINT32_MAX)) << 32 | TIFF_UINT32_MAX)
120 #define TIFF_FILLORDER 0x00003U
121 #define TIFF_DIRTYHEADER 0x00004U
122 #define TIFF_DIRTYDIRECT 0x00008U
123 #define TIFF_BUFFERSETUP 0x00010U
124 #define TIFF_CODERSETUP 0x00020U
125 #define TIFF_BEENWRITING 0x00040U
126 #define TIFF_SWAB 0x00080U
127 #define TIFF_NOBITREV 0x00100U
128 #define TIFF_MYBUFFER 0x00200U
129 #define TIFF_ISTILED 0x00400U
130 #define TIFF_MAPPED 0x00800U
131 #define TIFF_POSTENCODE 0x01000U
132 #define TIFF_INSUBIFD 0x02000U
133 #define TIFF_UPSAMPLED 0x04000U
134 #define TIFF_STRIPCHOP 0x08000U
135 #define TIFF_HEADERONLY 0x10000U
136 #define TIFF_NOREADRAW 0x20000U
137 #define TIFF_INCUSTOMIFD 0x40000U
138 #define TIFF_BIGTIFF 0x80000U
139 #define TIFF_BUF4WRITE 0x100000U
140 #define TIFF_DIRTYSTRIP 0x200000U
141 #define TIFF_PERSAMPLE 0x400000U
142 #define TIFF_BUFFERMMAP 0x800000U
143 #define TIFF_DEFERSTRILELOAD 0x1000000U
144 #define TIFF_LAZYSTRILELOAD 0x2000000U
145 #define TIFF_CHOPPEDUPARRAYS 0x4000000U
227#define isPseudoTag(t) (t > 0xffff)
229#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
230#define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0)
231#define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0)
232#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
233#define TIFFReadFile(tif, buf, size) \
234 ((*(tif)->tif_readproc)((tif)->tif_clientdata,(buf),(size)))
235#define TIFFWriteFile(tif, buf, size) \
236 ((*(tif)->tif_writeproc)((tif)->tif_clientdata,(buf),(size)))
237#define TIFFSeekFile(tif, off, whence) \
238 ((*(tif)->tif_seekproc)((tif)->tif_clientdata,(off),(whence)))
239#define TIFFCloseFile(tif) \
240 ((*(tif)->tif_closeproc)((tif)->tif_clientdata))
241#define TIFFGetFileSize(tif) \
242 ((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
243#define TIFFMapFileContents(tif, paddr, psize) \
244 ((*(tif)->tif_mapproc)((tif)->tif_clientdata,(paddr),(psize)))
245#define TIFFUnmapFileContents(tif, addr, size) \
246 ((*(tif)->tif_unmapproc)((tif)->tif_clientdata,(addr),(size)))
252#define ReadOK(tif, buf, size) \
253 (TIFFReadFile((tif),(buf),(size))==(size))
256#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
259#define WriteOK(tif, buf, size) \
260 (TIFFWriteFile((tif),(buf),(size))==(size))
264#define TIFFhowmany_32(x, y) (((uint32)x < (0xffffffff - (uint32)(y-1))) ? \
265 ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) : \
269#define TIFFhowmany_32_maxuint_compat(x, y) \
270 (((uint32)(x) / (uint32)(y)) + ((((uint32)(x) % (uint32)(y)) != 0) ? 1 : 0))
271#define TIFFhowmany8_32(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
272#define TIFFroundup_32(x, y) (TIFFhowmany_32(x,y)*(y))
273#define TIFFhowmany_64(x, y) ((((uint64)(x))+(((uint64)(y))-1))/((uint64)(y)))
274#define TIFFhowmany8_64(x) (((x)&0x07)?((uint64)(x)>>3)+1:(uint64)(x)>>3)
275#define TIFFroundup_64(x, y) (TIFFhowmany_64(x,y)*(y))
278#define TIFFSafeMultiply(t,v,m) ((((t)(m) != (t)0) && (((t)(((v)*(m))/(m))) == (t)(v))) ? (t)((v)*(m)) : (t)0)
280#define TIFFmax(A,B) ((A)>(B)?(A):(B))
281#define TIFFmin(A,B) ((A)<(B)?(A):(B))
283#define TIFFArrayCount(a) (sizeof (a) / sizeof ((a)[0]))
291#if defined(HAVE_FSEEKO)
303#if defined(HAVE_FSEEKO)
304# define fseek(stream,offset,whence) fseeko(stream,offset,whence)
305# define ftell(stream,offset,whence) ftello(stream,offset,whence)
308#if defined(__WIN32__) && \
309 !(defined(_MSC_VER) && _MSC_VER < 1400) && \
310 !(defined(__MSVCRT_VERSION__) && __MSVCRT_VERSION__ < 0x800)
312#define _TIFF_lseek_f(fildes,offset,whence) _lseeki64(fildes, offset,whence)
314#define _TIFF_fseek_f(stream,offset,whence) _fseeki64(stream, offset,whence)
315#define _TIFF_fstat_f(fildes,stat_buff) _fstati64(fildes, stat_buff)
318#define _TIFF_stat_s struct _stati64
319#define _TIFF_off_t __int64
322#define _TIFF_lseek_f(fildes,offset,whence) lseek(fildes,offset,whence)
324#define _TIFF_fseek_f(stream,offset,whence) fseek(stream,offset,whence)
325#define _TIFF_fstat_f(fildes,stat_buff) fstat(fildes,stat_buff)
328#define _TIFF_stat_s struct stat
329#define _TIFF_off_t off_t
332#if defined(__has_attribute) && defined(__clang__)
333#if __has_attribute(no_sanitize)
334#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW __attribute__((no_sanitize("unsigned-integer-overflow")))
336#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
339#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
343#if defined(__cplusplus)
412#ifdef PACKBITS_SUPPORT
419#ifdef THUNDER_SUPPORT
433extern int TIFFJPEGIsFullStripRequired(
TIFF*);
441#ifdef PIXARLOG_SUPPORT
462#if defined(__cplusplus)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLenum GLuint GLenum GLsizei const GLchar * buf
struct client_info * next
TIFFReadWriteProc tif_readproc
TIFFReadWriteProc tif_writeproc
const TIFFField * tif_foundfield
TIFFTileMethod tif_deftilesize
TIFFCodeMethod tif_encodestrip
TIFFUnmapFileProc tif_unmapproc
TIFFHeaderClassic classic
TIFFSeekProc tif_seekproc
TIFFCodeMethod tif_encodetile
TIFFTagMethods tif_tagmethods
tmsize_t tif_scanlinesize
TIFFPreMethod tif_preencode
TIFFBoolMethod tif_fixuptags
TIFFDirectory tif_customdir
tmsize_t tif_rawdataloaded
TIFFPreMethod tif_predecode
TIFFCodeMethod tif_decodestrip
TIFFCloseProc tif_closeproc
TIFFClientInfoLink * tif_clientinfo
TIFFPostMethod tif_postdecode
TIFFStripMethod tif_defstripsize
TIFFCodeMethod tif_decoderow
TIFFBoolMethod tif_setupencode
TIFFBoolMethod tif_postencode
union tiff::@3465 tif_header
tmsize_t tif_scanlineskew
TIFFCodeMethod tif_encoderow
TIFFVoidMethod tif_cleanup
TIFFMapFileProc tif_mapproc
TIFFBoolMethod tif_setupdecode
TIFFCodeMethod tif_decodetile
TIFFFieldArray * tif_fieldscompat
TIFFSizeProc tif_sizeproc
#define TIFFInitCCITTRLEW
#define TIFFInitCCITTFax4
#define TIFFInitCCITTFax3
#define TIFFInitThunderScan
int(* TIFFMapFileProc)(thandle_t, void **base, toff_t *size)
void(* TIFFErrorHandler)(const char *, const char *, va_list)
void(* TIFFUnmapFileProc)(thandle_t, void *base, toff_t size)
toff_t(* TIFFSizeProc)(thandle_t)
void(* TIFFErrorHandlerExt)(thandle_t, const char *, const char *, va_list)
tmsize_t(* TIFFReadWriteProc)(thandle_t, void *, tmsize_t)
toff_t(* TIFFSeekProc)(thandle_t, toff_t, int)
int(* TIFFCloseProc)(thandle_t)
void _TIFFsetByteArray(void **, void *, uint32)
void _TIFFprintAsciiTag(FILE *, const char *, const char *)
tmsize_t _TIFFReadEncodedStripAndAllocBuffer(TIFF *tif, uint32 strip, void **buf, tmsize_t bufsizetoalloc, tmsize_t size_to_read)
void _TIFFNoPostDecode(TIFF *tif, uint8 *buf, tmsize_t cc)
void _TIFFprintAscii(FILE *, const char *)
int _TIFFSeekOK(TIFF *tif, toff_t off)
int _TIFFNoPreCode(TIFF *tif, uint16 s)
void(* TIFFVoidMethod)(TIFF *)
int _TIFFNoSeek(TIFF *tif, uint32 off)
TIFFErrorHandler _TIFFwarningHandler
uint64 _TIFFMultiply64(TIFF *, uint64, uint64, const char *)
TIFFErrorHandlerExt _TIFFerrorHandlerExt
void _TIFFSwab32BitData(TIFF *tif, uint8 *buf, tmsize_t cc)
void(* TIFFTileMethod)(TIFF *, uint32 *, uint32 *)
void _TIFFsetString(char **, char *)
void _TIFFSwab16BitData(TIFF *tif, uint8 *buf, tmsize_t cc)
void _TIFFsetShortArray(uint16 **, uint16 *, uint32)
TIFFErrorHandlerExt _TIFFwarningHandlerExt
int(* TIFFPreMethod)(TIFF *, uint16)
int _TIFFNoStripDecode(TIFF *tif, uint8 *pp, tmsize_t cc, uint16 s)
void _TIFFSwab64BitData(TIFF *tif, uint8 *buf, tmsize_t cc)
uint32 _TIFFMultiply32(TIFF *, uint32, uint32, const char *)
int _TIFFgetMode(const char *mode, const char *module)
int TIFFSetCompressionScheme(TIFF *tif, int scheme)
void _TIFFsetDoubleArray(double **, double *, uint32)
void(* TIFFPostMethod)(TIFF *tif, uint8 *buf, tmsize_t size)
int(* TIFFCodeMethod)(TIFF *tif, uint8 *buf, tmsize_t size, uint16 sample)
void _TIFFSwab24BitData(TIFF *tif, uint8 *buf, tmsize_t cc)
int TIFFDefaultDirectory(TIFF *tif)
unsigned char tidataval_t
int(* TIFFSeekMethod)(TIFF *, uint32)
void _TIFFSetDefaultCompressionState(TIFF *tif)
void _TIFFsetLongArray(uint32 **, uint32 *, uint32)
int _TIFFRewriteField(TIFF *, uint16, TIFFDataType, tmsize_t, void *)
tmsize_t _TIFFCastUInt64ToSSize(TIFF *, uint64, const char *)
uint32(* TIFFStripMethod)(TIFF *, uint32)
double _TIFFUInt64ToDouble(uint64)
TIFFCodec _TIFFBuiltinCODECS[]
int TIFFFlushData1(TIFF *tif)
tmsize_t _TIFFReadEncodedTileAndAllocBuffer(TIFF *tif, uint32 tile, void **buf, tmsize_t bufsizetoalloc, tmsize_t size_to_read)
int(* TIFFBoolMethod)(TIFF *)
tmsize_t _TIFFReadTileAndAllocBuffer(TIFF *tif, void **buf, tmsize_t bufsizetoalloc, uint32 x, uint32 y, uint32 z, uint16 s)
int _TIFFNoRowEncode(TIFF *tif, uint8 *pp, tmsize_t cc, uint16 s)
int _TIFFNoStripEncode(TIFF *tif, uint8 *pp, tmsize_t cc, uint16 s)
tmsize_t _TIFFMultiplySSize(TIFF *, tmsize_t, tmsize_t, const char *)
int _TIFFDataSize(TIFFDataType type)
float _TIFFClampDoubleToFloat(double)
int TIFFInitDumpMode(TIFF *, int)
struct client_info TIFFClientInfoLink
void _TIFFsetFloatArray(float **, float *, uint32)
int _TIFFNoTileEncode(TIFF *, uint8 *pp, tmsize_t cc, uint16 s)
TIFFErrorHandler _TIFFerrorHandler
int _TIFFNoRowDecode(TIFF *tif, uint8 *pp, tmsize_t cc, uint16 s)
void * _TIFFCheckRealloc(TIFF *, void *, tmsize_t, tmsize_t, const char *)
int _TIFFNoTileDecode(TIFF *, uint8 *pp, tmsize_t cc, uint16 s)
void _TIFFDefaultTileSize(TIFF *tif, uint32 *tw, uint32 *th)
void * _TIFFCheckMalloc(TIFF *, tmsize_t, tmsize_t, const char *)
float _TIFFUInt64ToFloat(uint64)
uint32 _TIFFDefaultStripSize(TIFF *tif, uint32 s)
int TIFFSetDefaultCompressionState(TIFF *tif)