ReactOS 0.4.16-dev-2617-g01a0906
tiffiop.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1988-1997 Sam Leffler
3 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
4 *
5 * Permission to use, copy, modify, distribute, and sell this software and
6 * its documentation for any purpose is hereby granted without fee, provided
7 * that (i) the above copyright notices and this permission notice appear in
8 * all copies of the software and related documentation, and (ii) the names of
9 * Sam Leffler and Silicon Graphics may not be used in any advertising or
10 * publicity relating to the software without the specific, prior written
11 * permission of Sam Leffler and Silicon Graphics.
12 *
13 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16 *
17 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22 * OF THIS SOFTWARE.
23 */
24
25#ifndef _TIFFIOP_
26#define _TIFFIOP_
27/*
28 * ``Library-private'' definitions.
29 */
30
31#include "tif_config.h"
32
33#ifdef HAVE_FCNTL_H
34#include <fcntl.h>
35#endif
36
37#ifdef HAVE_SYS_TYPES_H
38#include <sys/types.h>
39#endif
40
41#include <string.h>
42
43#ifdef HAVE_ASSERT_H
44#include <assert.h>
45#else
46#define assert(x)
47#endif
48
49#include "tif_hash_set.h"
50#include "tiffio.h"
51
52#include "tif_dir.h"
53
54#include <limits.h>
55
56#ifndef STRIP_SIZE_DEFAULT
57#define STRIP_SIZE_DEFAULT 8192
58#endif
59
60#ifndef TIFF_MAX_DIR_COUNT
61#define TIFF_MAX_DIR_COUNT 1048576
62#endif
63
64#define TIFF_NON_EXISTENT_DIR_NUMBER UINT_MAX
65
66#define streq(a, b) (strcmp(a, b) == 0)
67#define strneq(a, b, n) (strncmp(a, b, n) == 0)
68
69#ifndef TRUE
70#define TRUE 1
71#define FALSE 0
72#endif
73
74typedef struct client_info
75{
77 void *data;
78 char *name;
80
81/*
82 * Typedefs for ``method pointers'' used internally.
83 * these are deprecated and provided only for backwards compatibility.
84 */
85typedef unsigned char tidataval_t; /* internal image data value type */
86typedef tidataval_t *tidata_t; /* reference to internal image data */
87
88typedef void (*TIFFVoidMethod)(TIFF *);
89typedef int (*TIFFBoolMethod)(TIFF *);
92 uint16_t sample);
97
99{
102};
104
105typedef union
106{
111
112struct tiff
113{
114 char *tif_name; /* name of open file */
115 int tif_fd; /* open file descriptor */
116 int tif_mode; /* open mode (O_*) */
118#define TIFF_FILLORDER 0x00003U /* natural bit fill order for machine */
119#define TIFF_DIRTYHEADER 0x00004U /* header must be written on close */
120#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
121#define TIFF_BUFFERSETUP 0x00010U /* data buffers setup */
122#define TIFF_CODERSETUP 0x00020U /* encoder/decoder setup done */
123#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
124#define TIFF_SWAB 0x00080U /* byte swap file information */
125#define TIFF_NOBITREV 0x00100U /* inhibit bit reversal logic */
126#define TIFF_MYBUFFER 0x00200U /* my raw data buffer; free on close */
127#define TIFF_ISTILED 0x00400U /* file is tile, not strip- based */
128#define TIFF_MAPPED 0x00800U /* file is mapped into memory */
129#define TIFF_POSTENCODE 0x01000U /* need call to postencode routine */
130#define TIFF_INSUBIFD 0x02000U /* currently writing a subifd */
131#define TIFF_UPSAMPLED 0x04000U /* library is doing data up-sampling */
132#define TIFF_STRIPCHOP 0x08000U /* enable strip chopping support */
133#define TIFF_HEADERONLY \
134 0x10000U /* read header only, do not process the first directory */
135#define TIFF_NOREADRAW \
136 0x20000U /* skip reading of raw uncompressed image data */
137#define TIFF_INCUSTOMIFD 0x40000U /* currently writing a custom IFD */
138#define TIFF_BIGTIFF 0x80000U /* read/write bigtiff */
139#define TIFF_BUF4WRITE 0x100000U /* rawcc bytes are for writing */
140#define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
141#define TIFF_PERSAMPLE 0x400000U /* get/set per sample tags as arrays */
142#define TIFF_BUFFERMMAP \
143 0x800000U /* read buffer (tif_rawdata) points into mmap() memory */
144#define TIFF_DEFERSTRILELOAD \
145 0x1000000U /* defer strip/tile offset/bytecount array loading. */
146#define TIFF_LAZYSTRILELOAD \
147 0x2000000U /* lazy/ondemand loading of strip/tile offset/bytecount values. \
148 Only used if TIFF_DEFERSTRILELOAD is set and in read-only \
149 mode */
150#define TIFF_CHOPPEDUPARRAYS \
151 0x4000000U /* set when allocChoppedUpStripArrays() has modified strip \
152 array */
153 uint64_t tif_diroff; /* file offset of current directory */
154 uint64_t tif_nextdiroff; /* file offset of following directory */
155 uint64_t tif_lastdiroff; /* file offset of last directory written so far */
158 int tif_setdirectory_force_absolute; /* switch between relative and absolute
159 stepping in TIFFSetDirectory() */
160 TIFFDirectory tif_dir; /* internal rep of current directory */
162 tif_customdir; /* custom IFDs are separated from the main ones */
163 TIFFHeaderUnion tif_header; /* file's header block Classic/BigTIFF union */
164 uint16_t tif_header_size; /* file's header block and its length */
165 uint32_t tif_row; /* current scanline */
166
167 /* There are IFDs in the file and an "active" IFD in memory,
168 * from which fields are "set" and "get".
169 * tif_curdir is set to:
170 * a) TIFF_NON_EXISTENT_DIR_NUMBER if there is no IFD in the file
171 * or the state is unknown,
172 * or the last read (i.e. TIFFFetchDirectory()) failed,
173 * or a custom directory was written.
174 * b) IFD index of last IFD written in the file. In this case the
175 * active IFD is a new (empty) one and tif_diroff is zero.
176 * If writing fails, tif_curdir is not changed.
177 * c) IFD index of IFD read from file into memory (=active IFD),
178 * even if IFD is corrupt and TIFFReadDirectory() returns 0.
179 * Then tif_diroff contains the offset of the IFD in the file.
180 * d) IFD index 0, whenever a custom directory or an unchained SubIFD
181 * was read. */
182 tdir_t tif_curdir; /* current directory (index) */
183 /* tif_curdircount: number of directories (main-IFDs) in file:
184 * - TIFF_NON_EXISTENT_DIR_NUMBER means 'dont know number of IFDs'.
185 * - 0 means 'empty file opened for writing, but no IFD written yet' */
187 uint32_t tif_curstrip; /* current strip for read/write */
188 uint64_t tif_curoff; /* current offset for read/write */
189 uint64_t tif_lastvalidoff; /* last valid offset allowed for rewrite in
190 place. Used only by TIFFAppendToStrip() */
191 uint64_t tif_dataoff; /* current offset for writing dir (IFD) */
192 /* SubIFD support */
193 uint16_t tif_nsubifd; /* remaining subifds to write */
194 uint64_t tif_subifdoff; /* offset for patching SubIFD link */
195 /* tiling support */
196 uint32_t tif_col; /* current column (offset by row too) */
197 uint32_t tif_curtile; /* current tile for read/write */
198 tmsize_t tif_tilesize; /* # of bytes in a tile */
199 /* compression scheme hooks */
201 TIFFBoolMethod tif_fixuptags; /* called in TIFFReadDirectory */
202 TIFFBoolMethod tif_setupdecode; /* called once before predecode */
203 TIFFPreMethod tif_predecode; /* pre- row/strip/tile decoding */
204 TIFFBoolMethod tif_setupencode; /* called once before preencode */
206 TIFFPreMethod tif_preencode; /* pre- row/strip/tile encoding */
207 TIFFBoolMethod tif_postencode; /* post- row/strip/tile encoding */
208 TIFFCodeMethod tif_decoderow; /* scanline decoding routine */
209 TIFFCodeMethod tif_encoderow; /* scanline encoding routine */
210 TIFFCodeMethod tif_decodestrip; /* strip decoding routine */
211 TIFFCodeMethod tif_encodestrip; /* strip encoding routine */
212 TIFFCodeMethod tif_decodetile; /* tile decoding routine */
213 TIFFCodeMethod tif_encodetile; /* tile encoding routine */
214 TIFFVoidMethod tif_close; /* cleanup-on-close routine */
215 TIFFSeekMethod tif_seek; /* position within a strip routine */
216 TIFFVoidMethod tif_cleanup; /* cleanup state routine */
217 TIFFStripMethod tif_defstripsize; /* calculate/constrain strip size */
218 TIFFTileMethod tif_deftilesize; /* calculate/constrain tile size */
219 uint8_t *tif_data; /* compression scheme private data */
220 /* input/output buffering */
221 tmsize_t tif_scanlinesize; /* # of bytes in a scanline */
222 tmsize_t tif_scanlineskew; /* scanline skew for reading strips */
223 uint8_t *tif_rawdata; /* raw data buffer */
224 tmsize_t tif_rawdatasize; /* # of bytes in raw data buffer */
225 tmsize_t tif_rawdataoff; /* rawdata offset within strip */
226 tmsize_t tif_rawdataloaded; /* amount of data in rawdata */
227 uint8_t *tif_rawcp; /* current spot in raw buffer */
228 tmsize_t tif_rawcc; /* bytes unread from raw buffer */
229 /* memory-mapped file support */
230 uint8_t *tif_base; /* base of mapped file */
231 tmsize_t tif_size; /* size of mapped file region (bytes, thus tmsize_t) */
232 TIFFMapFileProc tif_mapproc; /* map file method */
233 TIFFUnmapFileProc tif_unmapproc; /* unmap file method */
234 /* input/output callback methods */
235 thandle_t tif_clientdata; /* callback parameter */
238 TIFFSeekProc tif_seekproc; /* lseek method */
239 TIFFCloseProc tif_closeproc; /* close method */
240 TIFFSizeProc tif_sizeproc; /* filesize method */
241 /* post-decoding support */
242 TIFFPostMethod tif_postdecode; /* post decoding routine */
243 /* tag support */
244 TIFFField **tif_fields; /* sorted table of registered tags */
245 size_t tif_nfields; /* # entries in registered tag table */
246 const TIFFField *tif_foundfield; /* cached pointer to already found tag */
247 TIFFTagMethods tif_tagmethods; /* tag get/set/print routines */
248 TIFFClientInfoLink *tif_clientinfo; /* extra client information. */
249 /* Backward compatibility stuff. We need these two fields for
250 * setting up an old tag extension scheme. */
253 /* Error handler support */
258 tmsize_t tif_max_single_mem_alloc; /* in bytes. 0 for unlimited */
259 tmsize_t tif_max_cumulated_mem_alloc; /* in bytes. 0 for unlimited */
262};
267 void *errorhandler_user_data; /* may be NULL */
269 void *warnhandler_user_data; /* may be NULL */
270 tmsize_t max_single_mem_alloc; /* in bytes. 0 for unlimited */
271 tmsize_t max_cumulated_mem_alloc; /* in bytes. 0 for unlimited */
273};
275#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */
277#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
278#define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0)
279#define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0)
280#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
281#define TIFFReadFile(tif, buf, size) \
282 ((*(tif)->tif_readproc)((tif)->tif_clientdata, (buf), (size)))
283#define TIFFWriteFile(tif, buf, size) \
284 ((*(tif)->tif_writeproc)((tif)->tif_clientdata, (buf), (size)))
285#define TIFFSeekFile(tif, off, whence) \
286 ((*(tif)->tif_seekproc)((tif)->tif_clientdata, (off), (whence)))
287#define TIFFCloseFile(tif) ((*(tif)->tif_closeproc)((tif)->tif_clientdata))
288#define TIFFGetFileSize(tif) ((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
289#define TIFFMapFileContents(tif, paddr, psize) \
290 ((*(tif)->tif_mapproc)((tif)->tif_clientdata, (paddr), (psize)))
291#define TIFFUnmapFileContents(tif, addr, size) \
292 ((*(tif)->tif_unmapproc)((tif)->tif_clientdata, (addr), (size)))
293
294/*
295 * Default Read/Seek/Write definitions.
296 */
297#ifndef ReadOK
298#define ReadOK(tif, buf, size) (TIFFReadFile((tif), (buf), (size)) == (size))
299#endif
300#ifndef SeekOK
301#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
302#endif
303#ifndef WriteOK
304#define WriteOK(tif, buf, size) (TIFFWriteFile((tif), (buf), (size)) == (size))
305#endif
306
307/* NB: the uint32_t casts are to silence certain ANSI-C compilers */
308#define TIFFhowmany_32(x, y) \
309 (((uint32_t)x < (0xffffffff - (uint32_t)(y - 1))) \
310 ? ((((uint32_t)(x)) + (((uint32_t)(y)) - 1)) / ((uint32_t)(y))) \
311 : 0U)
312/* Variant of TIFFhowmany_32() that doesn't return 0 if x close to MAXUINT. */
313/* Caution: TIFFhowmany_32_maxuint_compat(x,y)*y might overflow */
314#define TIFFhowmany_32_maxuint_compat(x, y) \
315 (((uint32_t)(x) / (uint32_t)(y)) + \
316 ((((uint32_t)(x) % (uint32_t)(y)) != 0) ? 1 : 0))
317#define TIFFhowmany8_32(x) \
318 (((x)&0x07) ? ((uint32_t)(x) >> 3) + 1 : (uint32_t)(x) >> 3)
319#define TIFFroundup_32(x, y) (TIFFhowmany_32(x, y) * (y))
320#define TIFFhowmany_64(x, y) \
321 ((((uint64_t)(x)) + (((uint64_t)(y)) - 1)) / ((uint64_t)(y)))
322#define TIFFhowmany8_64(x) \
323 (((x)&0x07) ? ((uint64_t)(x) >> 3) + 1 : (uint64_t)(x) >> 3)
324#define TIFFroundup_64(x, y) (TIFFhowmany_64(x, y) * (y))
326/* Safe multiply which returns zero if there is an *unsigned* integer overflow.
327 * This macro is not safe for *signed* integer types */
328#define TIFFSafeMultiply(t, v, m) \
329 ((((t)(m) != (t)0) && (((t)(((v) * (m)) / (m))) == (t)(v))) \
330 ? (t)((v) * (m)) \
331 : (t)0)
332
333#define TIFFmax(A, B) ((A) > (B) ? (A) : (B))
334#define TIFFmin(A, B) ((A) < (B) ? (A) : (B))
335
336#define TIFFArrayCount(a) (sizeof(a) / sizeof((a)[0]))
337
338/*
339 Support for large files.
340
341 Windows read/write APIs support only 'unsigned int' rather than 'size_t'.
342 Windows off_t is only 32-bit, even in 64-bit builds.
343*/
344#if defined(HAVE_FSEEKO)
345/*
346 Use fseeko() and ftello() if they are available since they use
347 'off_t' rather than 'long'. It is wrong to use fseeko() and
348 ftello() only on systems with special LFS support since some systems
349 (e.g. FreeBSD) support a 64-bit off_t by default.
350
351 For MinGW, __MSVCRT_VERSION__ must be at least 0x800 to expose these
352 interfaces. The MinGW compiler must support the requested version. MinGW
353 does not distribute the CRT (it is supplied by Microsoft) so the correct CRT
354 must be available on the target computer in order for the program to run.
356#if defined(HAVE_FSEEKO)
357#define fseek(stream, offset, whence) fseeko(stream, offset, whence)
358#define ftell(stream, offset, whence) ftello(stream, offset, whence)
359#endif
360#endif
361#if defined(_WIN32) && \
362 !(defined(__MSVCRT_VERSION__) && __MSVCRT_VERSION__ < 0x800)
363typedef unsigned int TIFFIOSize_t;
364#define _TIFF_lseek_f(fildes, offset, whence) \
365 _lseeki64(fildes, /* __int64 */ offset, whence)
366/* #define _TIFF_tell_f(fildes) /\* __int64 *\/ _telli64(fildes) */
367#define _TIFF_fseek_f(stream, offset, whence) \
368 _fseeki64(stream, /* __int64 */ offset, whence)
369#define _TIFF_fstat_f(fildes, stat_buff) \
370 _fstati64(fildes, /* struct _stati64 */ stat_buff)
371/* #define _TIFF_ftell_f(stream) /\* __int64 *\/ _ftelli64(stream) */
372/* #define _TIFF_stat_f(path,stat_buff) _stati64(path,/\* struct _stati64 *\/
373 * stat_buff) */
374#define _TIFF_stat_s struct _stati64
375#define _TIFF_off_t __int64
376#else
377typedef size_t TIFFIOSize_t;
378#define _TIFF_lseek_f(fildes, offset, whence) lseek(fildes, offset, whence)
379/* #define _TIFF_tell_f(fildes) (_TIFF_lseek_f(fildes,0,SEEK_CUR)) */
380#define _TIFF_fseek_f(stream, offset, whence) fseek(stream, offset, whence)
381#define _TIFF_fstat_f(fildes, stat_buff) fstat(fildes, stat_buff)
382/* #define _TIFF_ftell_f(stream) ftell(stream) */
383/* #define _TIFF_stat_f(path,stat_buff) stat(path,stat_buff) */
384#define _TIFF_stat_s struct stat
385#define _TIFF_off_t off_t
386#endif
387
388#if defined(__has_attribute) && defined(__clang__)
389#if __has_attribute(no_sanitize)
390#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW \
391 __attribute__((no_sanitize("unsigned-integer-overflow")))
392#else
393#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
394#endif
395#else
396#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
397#endif
398
399#if defined(__cplusplus)
400extern "C"
401{
402#endif
403 extern int _tiffDummyMapProc(thandle_t fd, void **pbase, toff_t *psize);
404 extern void _tiffDummyUnmapProc(thandle_t fd, void *base, toff_t size);
405 extern int _TIFFgetMode(TIFFOpenOptions *opts, thandle_t clientdata,
406 const char *mode, const char *module);
407 extern int _TIFFNoRowEncode(TIFF *tif, uint8_t *pp, tmsize_t cc,
408 uint16_t s);
409 extern int _TIFFNoStripEncode(TIFF *tif, uint8_t *pp, tmsize_t cc,
410 uint16_t s);
411 extern int _TIFFNoTileEncode(TIFF *, uint8_t *pp, tmsize_t cc, uint16_t s);
412 extern int _TIFFNoRowDecode(TIFF *tif, uint8_t *pp, tmsize_t cc,
413 uint16_t s);
414 extern int _TIFFNoStripDecode(TIFF *tif, uint8_t *pp, tmsize_t cc,
415 uint16_t s);
416 extern int _TIFFNoTileDecode(TIFF *, uint8_t *pp, tmsize_t cc, uint16_t s);
417 extern void _TIFFNoPostDecode(TIFF *tif, uint8_t *buf, tmsize_t cc);
418 extern int _TIFFNoPreCode(TIFF *tif, uint16_t s);
419 extern int _TIFFNoSeek(TIFF *tif, uint32_t off);
420 extern void _TIFFSwab16BitData(TIFF *tif, uint8_t *buf, tmsize_t cc);
421 extern void _TIFFSwab24BitData(TIFF *tif, uint8_t *buf, tmsize_t cc);
422 extern void _TIFFSwab32BitData(TIFF *tif, uint8_t *buf, tmsize_t cc);
423 extern void _TIFFSwab64BitData(TIFF *tif, uint8_t *buf, tmsize_t cc);
424 extern int TIFFFlushData1(TIFF *tif);
425 extern int TIFFDefaultDirectory(TIFF *tif);
426 extern void _TIFFSetDefaultCompressionState(TIFF *tif);
428 void *);
429 extern int TIFFSetCompressionScheme(TIFF *tif, int scheme);
430 extern int TIFFSetDefaultCompressionState(TIFF *tif);
432 extern void _TIFFDefaultTileSize(TIFF *tif, uint32_t *tw, uint32_t *th);
433
434 extern void _TIFFsetByteArray(void **, const void *, uint32_t);
435 extern void _TIFFsetByteArrayExt(TIFF *, void **, const void *, uint32_t);
436 extern void _TIFFsetShortArray(uint16_t **, const uint16_t *, uint32_t);
437 extern void _TIFFsetShortArrayExt(TIFF *, uint16_t **, const uint16_t *,
438 uint32_t);
439 extern void _TIFFsetLongArray(uint32_t **, const uint32_t *, uint32_t);
440 extern void _TIFFsetLongArrayExt(TIFF *, uint32_t **, const uint32_t *,
441 uint32_t);
442 extern void _TIFFsetFloatArray(float **, const float *, uint32_t);
443 extern void _TIFFsetFloatArrayExt(TIFF *, float **, const float *,
444 uint32_t);
445 extern void _TIFFsetDoubleArray(double **, const double *, uint32_t);
446 extern void _TIFFsetDoubleArrayExt(TIFF *, double **, const double *,
447 uint32_t);
448
449 extern void _TIFFprintAscii(FILE *, const char *);
450 extern void _TIFFprintAsciiTag(FILE *, const char *, const char *);
451
456 void _TIFFErrorEarly(TIFFOpenOptions *opts, thandle_t clientdata,
457 const char *module, const char *fmt, ...)
458 TIFF_ATTRIBUTE((__format__(__printf__, 4, 5)));
459
463 const char *);
465 extern void *_TIFFCheckMalloc(TIFF *, tmsize_t, tmsize_t, const char *);
466 extern void *_TIFFCheckRealloc(TIFF *, void *, tmsize_t, tmsize_t,
467 const char *);
468
469 extern float _TIFFClampDoubleToFloat(double);
470 extern uint32_t _TIFFClampDoubleToUInt32(double);
471
473
475 uint32_t strip,
476 void **buf,
477 tmsize_t bufsizetoalloc,
478 tmsize_t size_to_read);
480 void **buf,
481 tmsize_t bufsizetoalloc,
482 tmsize_t size_to_read);
483 extern tmsize_t _TIFFReadTileAndAllocBuffer(TIFF *tif, void **buf,
484 tmsize_t bufsizetoalloc,
487 extern int _TIFFSeekOK(TIFF *tif, toff_t off);
489 extern int TIFFInitDumpMode(TIFF *, int);
490#ifdef PACKBITS_SUPPORT
491 extern int TIFFInitPackBits(TIFF *, int);
492#endif
493#ifdef CCITT_SUPPORT
494 extern int TIFFInitCCITTRLE(TIFF *, int), TIFFInitCCITTRLEW(TIFF *, int);
495 extern int TIFFInitCCITTFax3(TIFF *, int), TIFFInitCCITTFax4(TIFF *, int);
496#endif
497#ifdef THUNDER_SUPPORT
498 extern int TIFFInitThunderScan(TIFF *, int);
499#endif
500#ifdef NEXT_SUPPORT
501 extern int TIFFInitNeXT(TIFF *, int);
502#endif
503#ifdef LZW_SUPPORT
504 extern int TIFFInitLZW(TIFF *, int);
505#endif
506#ifdef OJPEG_SUPPORT
507 extern int TIFFInitOJPEG(TIFF *, int);
508#endif
509#ifdef JPEG_SUPPORT
510 extern int TIFFInitJPEG(TIFF *, int);
511 extern int TIFFJPEGIsFullStripRequired(TIFF *);
512#endif
513#ifdef JBIG_SUPPORT
514 extern int TIFFInitJBIG(TIFF *, int);
515#endif
516#ifdef ZIP_SUPPORT
517 extern int TIFFInitZIP(TIFF *, int);
518#endif
519#ifdef PIXARLOG_SUPPORT
520 extern int TIFFInitPixarLog(TIFF *, int);
521#endif
522#ifdef LOGLUV_SUPPORT
523 extern int TIFFInitSGILog(TIFF *, int);
524#endif
525#ifdef LERC_SUPPORT
526 extern int TIFFInitLERC(TIFF *tif, int);
527#endif
528#ifdef LZMA_SUPPORT
529 extern int TIFFInitLZMA(TIFF *, int);
530#endif
531#ifdef ZSTD_SUPPORT
532 extern int TIFFInitZSTD(TIFF *, int);
533#endif
534#ifdef WEBP_SUPPORT
535 extern int TIFFInitWebP(TIFF *, int);
536#endif
537 extern const TIFFCodec _TIFFBuiltinCODECS[];
539 int32_t b, float *, float *, float *);
540
541 extern void *_TIFFmallocExt(TIFF *tif, tmsize_t s);
542 extern void *_TIFFcallocExt(TIFF *tif, tmsize_t nmemb, tmsize_t siz);
543 extern void *_TIFFreallocExt(TIFF *tif, void *p, tmsize_t s);
544 extern void _TIFFfreeExt(TIFF *tif, void *p);
545
546#if defined(__cplusplus)
547}
548#endif
549#endif /* _TIFFIOP_ */
r l[0]
Definition: byte_order.h:168
INT32 int32_t
Definition: types.h:71
UINT32 uint32_t
Definition: types.h:75
UINT64 uint64_t
Definition: types.h:77
unsigned short uint16_t
Definition: stdint.h:35
unsigned char uint8_t
Definition: stdint.h:33
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizeiptr size
Definition: glext.h:5919
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum mode
Definition: glext.h:6217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLdouble GLdouble z
Definition: glext.h:5874
uint32_t cc
Definition: isohybrid.c:75
#define uint32_t
Definition: nsiface.idl:61
#define uint16_t
Definition: nsiface.idl:60
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
DWORD scheme
static int fd
Definition: io.c:51
void * errorhandler_user_data
Definition: tiffiop.h:264
tmsize_t max_cumulated_mem_alloc
Definition: tiffiop.h:268
TIFFErrorHandlerExtR errorhandler
Definition: tiffiop.h:263
int warn_about_unknown_tags
Definition: tiffiop.h:269
TIFFErrorHandlerExtR warnhandler
Definition: tiffiop.h:265
void * warnhandler_user_data
Definition: tiffiop.h:266
tmsize_t max_single_mem_alloc
Definition: tiffiop.h:267
void * data
Definition: tiffiop.h:77
struct client_info * next
Definition: tiffiop.h:76
char * name
Definition: tiffiop.h:78
Definition: dsound.c:943
Definition: tiffiop.h:113
uint32_t tif_col
Definition: tiffiop.h:193
uint32_t tif_curtile
Definition: tiffiop.h:194
TIFFReadWriteProc tif_readproc
Definition: tiffiop.h:233
int tif_warn_about_unknown_tags
Definition: tiffiop.h:258
TIFFReadWriteProc tif_writeproc
Definition: tiffiop.h:234
uint64_t tif_subifdoff
Definition: tiffiop.h:191
const TIFFField * tif_foundfield
Definition: tiffiop.h:243
tdir_t tif_curdircount
Definition: tiffiop.h:183
TIFFTileMethod tif_deftilesize
Definition: tiffiop.h:215
tmsize_t tif_max_single_mem_alloc
Definition: tiffiop.h:255
TIFFCodeMethod tif_encodestrip
Definition: tiffiop.h:208
uint64_t tif_lastvalidoff
Definition: tiffiop.h:186
TIFFUnmapFileProc tif_unmapproc
Definition: tiffiop.h:230
TIFFSeekProc tif_seekproc
Definition: tiffiop.h:235
TIFFSeekMethod tif_seek
Definition: tiffiop.h:212
TIFFCodeMethod tif_encodetile
Definition: tiffiop.h:210
TIFFTagMethods tif_tagmethods
Definition: tiffiop.h:244
int tif_setdirectory_force_absolute
Definition: tiffiop.h:155
TIFFErrorHandlerExtR tif_errorhandler
Definition: tiffiop.h:251
tmsize_t tif_scanlinesize
Definition: tiffiop.h:218
uint16_t tif_nsubifd
Definition: tiffiop.h:190
TIFFPreMethod tif_preencode
Definition: tiffiop.h:203
TIFFBoolMethod tif_fixuptags
Definition: tiffiop.h:198
TIFFHashSet * tif_map_dir_number_to_offset
Definition: tiffiop.h:154
TIFFDirectory tif_customdir
Definition: tiffiop.h:159
tmsize_t tif_rawdataloaded
Definition: tiffiop.h:223
tmsize_t tif_rawcc
Definition: tiffiop.h:225
TIFFPreMethod tif_predecode
Definition: tiffiop.h:200
uint64_t tif_curoff
Definition: tiffiop.h:185
size_t tif_nfields
Definition: tiffiop.h:242
uint64_t tif_nextdiroff
Definition: tiffiop.h:151
void * tif_errorhandler_user_data
Definition: tiffiop.h:252
TIFFCodeMethod tif_decodestrip
Definition: tiffiop.h:207
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:236
TIFFClientInfoLink * tif_clientinfo
Definition: tiffiop.h:245
TIFFField ** tif_fields
Definition: tiffiop.h:241
TIFFHashSet * tif_map_dir_offset_to_number
Definition: tiffiop.h:153
TIFFPostMethod tif_postdecode
Definition: tiffiop.h:239
thandle_t tif_clientdata
Definition: tiffiop.h:232
uint64_t tif_diroff
Definition: tiffiop.h:150
TIFFStripMethod tif_defstripsize
Definition: tiffiop.h:214
char * tif_name
Definition: tiffiop.h:114
TIFFCodeMethod tif_decoderow
Definition: tiffiop.h:205
TIFFBoolMethod tif_setupencode
Definition: tiffiop.h:201
TIFFDirectory tif_dir
Definition: tiffiop.h:157
TIFFBoolMethod tif_postencode
Definition: tiffiop.h:204
TIFFErrorHandlerExtR tif_warnhandler
Definition: tiffiop.h:253
tmsize_t tif_scanlineskew
Definition: tiffiop.h:219
tmsize_t tif_size
Definition: tiffiop.h:228
uint16_t tif_header_size
Definition: tiffiop.h:161
TIFFCodeMethod tif_encoderow
Definition: tiffiop.h:206
TIFFVoidMethod tif_close
Definition: tiffiop.h:211
uint64_t tif_dataoff
Definition: tiffiop.h:188
tdir_t tif_curdir
Definition: tiffiop.h:179
tmsize_t tif_cur_cumulated_mem_alloc
Definition: tiffiop.h:257
int tif_decodestatus
Definition: tiffiop.h:197
int tif_encodestatus
Definition: tiffiop.h:202
int tif_fd
Definition: tiffiop.h:115
TIFFVoidMethod tif_cleanup
Definition: tiffiop.h:213
void * tif_warnhandler_user_data
Definition: tiffiop.h:254
uint8_t * tif_data
Definition: tiffiop.h:216
uint8_t * tif_rawcp
Definition: tiffiop.h:224
TIFFMapFileProc tif_mapproc
Definition: tiffiop.h:229
TIFFBoolMethod tif_setupdecode
Definition: tiffiop.h:199
uint8_t * tif_rawdata
Definition: tiffiop.h:220
TIFFHeaderUnion tif_header
Definition: tiffiop.h:160
tmsize_t tif_rawdatasize
Definition: tiffiop.h:221
tmsize_t tif_tilesize
Definition: tiffiop.h:195
tmsize_t tif_max_cumulated_mem_alloc
Definition: tiffiop.h:256
tmsize_t tif_rawdataoff
Definition: tiffiop.h:222
uint32_t tif_flags
Definition: tiffiop.h:117
uint32_t tif_row
Definition: tiffiop.h:162
size_t tif_nfieldscompat
Definition: tiffiop.h:249
uint64_t tif_lastdiroff
Definition: tiffiop.h:152
uint32_t tif_curstrip
Definition: tiffiop.h:184
TIFFCodeMethod tif_decodetile
Definition: tiffiop.h:209
int tif_mode
Definition: tiffiop.h:116
TIFFFieldArray * tif_fieldscompat
Definition: tiffiop.h:248
TIFFSizeProc tif_sizeproc
Definition: tiffiop.h:237
uint8_t * tif_base
Definition: tiffiop.h:227
#define TIFFInitCCITTRLEW
Definition: tif_codec.c:54
#define TIFFInitLZW
Definition: tif_codec.c:35
#define TIFFInitPixarLog
Definition: tif_codec.c:65
#define TIFFInitJPEG
Definition: tif_codec.c:47
#define TIFFInitCCITTFax4
Definition: tif_codec.c:56
#define TIFFInitPackBits
Definition: tif_codec.c:38
#define TIFFInitNeXT
Definition: tif_codec.c:44
#define TIFFInitZSTD
Definition: tif_codec.c:77
#define TIFFInitJBIG
Definition: tif_codec.c:59
#define TIFFInitCCITTFax3
Definition: tif_codec.c:55
#define TIFFInitLZMA
Definition: tif_codec.c:74
#define TIFFInitSGILog
Definition: tif_codec.c:68
#define TIFFInitCCITTRLE
Definition: tif_codec.c:53
#define TIFFInitZIP
Definition: tif_codec.c:62
#define TIFFInitWebP
Definition: tif_codec.c:80
#define TIFFInitThunderScan
Definition: tif_codec.c:41
#define TIFFInitOJPEG
Definition: tif_codec.c:50
#define TIFFInitLERC
Definition: tif_codec.c:71
TIFFDataType
Definition: tiff.h:146
#define TIFF_ATTRIBUTE(x)
Definition: tiffio.h:294
int(* TIFFMapFileProc)(thandle_t, void **base, toff_t *size)
Definition: tiffio.h:310
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:67
void(* TIFFErrorHandler)(const char *, const char *, va_list)
Definition: tiffio.h:301
int(* TIFFErrorHandlerExtR)(TIFF *, void *user_data, const char *, const char *, va_list)
Definition: tiffio.h:304
void(* TIFFUnmapFileProc)(thandle_t, void *base, toff_t size)
Definition: tiffio.h:311
toff_t(* TIFFSizeProc)(thandle_t)
Definition: tiffio.h:309
uint64_t toff_t
Definition: tiffio.h:70
void(* TIFFErrorHandlerExt)(thandle_t, const char *, const char *, va_list)
Definition: tiffio.h:302
uint32_t tdir_t
Definition: tiffio.h:71
tmsize_t(* TIFFReadWriteProc)(thandle_t, void *, tmsize_t)
Definition: tiffio.h:306
toff_t(* TIFFSeekProc)(thandle_t, toff_t, int)
Definition: tiffio.h:307
int(* TIFFCloseProc)(thandle_t)
Definition: tiffio.h:308
void _TIFFprintAsciiTag(FILE *, const char *, const char *)
Definition: tif_print.c:751
void _TIFFDefaultTileSize(TIFF *tif, uint32_t *tw, uint32_t *th)
Definition: tif_tile.c:272
void _TIFFfreeExt(TIFF *tif, void *p)
Definition: tif_open.c:275
tmsize_t _TIFFReadEncodedTileAndAllocBuffer(TIFF *tif, uint32_t tile, void **buf, tmsize_t bufsizetoalloc, tmsize_t size_to_read)
Definition: tif_read.c:1029
tmsize_t _TIFFCastUInt64ToSSize(TIFF *, uint64_t, const char *)
Definition: tif_aux.c:84
void _TIFFprintAscii(FILE *, const char *)
Definition: tif_print.c:725
int _TIFFSeekOK(TIFF *tif, toff_t off)
Definition: tif_aux.c:409
int(* TIFFSeekMethod)(TIFF *, uint32_t)
Definition: tiffiop.h:93
uint32_t _TIFFClampDoubleToUInt32(double)
Definition: tif_aux.c:400
void _TIFFCleanupIFDOffsetAndNumberMaps(TIFF *tif)
Definition: tif_close.c:127
void(* TIFFVoidMethod)(TIFF *)
Definition: tiffiop.h:88
void _TIFFsetByteArrayExt(TIFF *, void **, const void *, uint32_t)
Definition: tif_dir.c:64
TIFFErrorHandler _TIFFwarningHandler
Definition: tif_unix.c:373
TIFFErrorHandlerExt _TIFFerrorHandlerExt
Definition: tif_error.c:30
uint32_t(* TIFFStripMethod)(TIFF *, uint32_t)
Definition: tiffiop.h:95
void(* TIFFTileMethod)(TIFF *, uint32_t *, uint32_t *)
Definition: tiffiop.h:96
int(* TIFFCodeMethod)(TIFF *tif, uint8_t *buf, tmsize_t size, uint16_t sample)
Definition: tiffiop.h:91
void _TIFFsetLongArrayExt(TIFF *, uint32_t **, const uint32_t *, uint32_t)
Definition: tif_dir.c:88
void _TIFFNoPostDecode(TIFF *tif, uint8_t *buf, tmsize_t cc)
Definition: tif_read.c:1648
tmsize_t _TIFFReadEncodedStripAndAllocBuffer(TIFF *tif, uint32_t strip, void **buf, tmsize_t bufsizetoalloc, tmsize_t size_to_read)
Definition: tif_read.c:584
uint32_t _TIFFDefaultStripSize(TIFF *tif, uint32_t s)
Definition: tif_strip.c:223
void uint32_t _TIFFMultiply32(TIFF *, uint32_t, uint32_t, const char *)
Definition: tif_aux.c:35
int _TIFFNoTileDecode(TIFF *, uint8_t *pp, tmsize_t cc, uint16_t s)
Definition: tif_compress.c:112
TIFFErrorHandlerExt _TIFFwarningHandlerExt
Definition: tif_warning.c:30
tmsize_t _TIFFReadTileAndAllocBuffer(TIFF *tif, void **buf, tmsize_t bufsizetoalloc, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
Definition: tif_read.c:1012
void(* TIFFPostMethod)(TIFF *tif, uint8_t *buf, tmsize_t size)
Definition: tiffiop.h:94
int _TIFFRewriteField(TIFF *, uint16_t, TIFFDataType, tmsize_t, void *)
int TIFFSetCompressionScheme(TIFF *tif, int scheme)
Definition: tif_compress.c:166
int _tiffDummyMapProc(thandle_t fd, void **pbase, toff_t *psize)
Definition: tif_open.c:40
void * _TIFFreallocExt(TIFF *tif, void *p, tmsize_t s)
Definition: tif_open.c:235
void _TIFFsetFloatArrayExt(TIFF *, float **, const float *, uint32_t)
Definition: tif_dir.c:104
int TIFFDefaultDirectory(TIFF *tif)
Definition: tif_dir.c:1752
unsigned char tidataval_t
Definition: tiffiop.h:85
void _TIFFSwab24BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
Definition: tif_read.c:1662
size_t TIFFIOSize_t
Definition: tiffiop.h:374
void _TIFFSetDefaultCompressionState(TIFF *tif)
Definition: tif_compress.c:142
int _TIFFNoTileEncode(TIFF *, uint8_t *pp, tmsize_t cc, uint16_t s)
Definition: tif_compress.c:67
void _TIFFsetFloatArray(float **, const float *, uint32_t)
Definition: tif_dir.c:100
int TIFFJPEGIsFullStripRequired(TIFF *)
int _TIFFgetMode(TIFFOpenOptions *opts, thandle_t clientdata, const char *mode, const char *module)
Definition: tif_open.c:55
void _TIFFSwab16BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
Definition: tif_read.c:1655
void _TIFFsetShortArray(uint16_t **, const uint16_t *, uint32_t)
Definition: tif_dir.c:74
void _TIFFsetLongArray(uint32_t **, const uint32_t *, uint32_t)
Definition: tif_dir.c:84
int _TIFFNoRowDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Definition: tif_compress.c:96
int(* TIFFPreMethod)(TIFF *, uint16_t)
Definition: tiffiop.h:90
void * _TIFFmallocExt(TIFF *tif, tmsize_t s)
Definition: tif_open.c:173
void _TIFFsetDoubleArray(double **, const double *, uint32_t)
Definition: tif_dir.c:109
int TIFFFlushData1(TIFF *tif)
Definition: tif_write.c:931
int(* TIFFBoolMethod)(TIFF *)
Definition: tiffiop.h:89
int _TIFFNoRowEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Definition: tif_compress.c:51
tidataval_t * tidata_t
Definition: tiffiop.h:86
int _TIFFNoStripEncode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Definition: tif_compress.c:59
tmsize_t _TIFFMultiplySSize(TIFF *, tmsize_t, tmsize_t, const char *)
Definition: tif_aux.c:59
int _TIFFNoStripDecode(TIFF *tif, uint8_t *pp, tmsize_t cc, uint16_t s)
Definition: tif_compress.c:104
void _TIFFsetByteArray(void **, const void *, uint32_t)
Definition: tif_dir.c:60
void _TIFFSwab32BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
Definition: tif_read.c:1669
void * _TIFFcallocExt(TIFF *tif, tmsize_t nmemb, tmsize_t siz)
Definition: tif_open.c:201
const TIFFCodec _TIFFBuiltinCODECS[]
Definition: tif_codec.c:86
float _TIFFClampDoubleToFloat(double)
Definition: tif_aux.c:391
int TIFFInitDumpMode(TIFF *, int)
Definition: tif_dumpmode.c:110
struct client_info TIFFClientInfoLink
void _TIFFErrorEarly(TIFFOpenOptions *opts, thandle_t clientdata, const char *module, const char *fmt,...) TIFF_ATTRIBUTE((__format__(__printf__
int _TIFFNoPreCode(TIFF *tif, uint16_t s)
Definition: tif_compress.c:128
void TIFFCIELab16ToXYZ(TIFFCIELabToRGB *, uint32_t l, int32_t a, int32_t b, float *, float *, float *)
Definition: tif_color.c:55
TIFFErrorHandler _TIFFerrorHandler
Definition: tif_unix.c:382
int _TIFFNoSeek(TIFF *tif, uint32_t off)
Definition: tif_compress.c:120
void _TIFFsetDoubleArrayExt(TIFF *, double **, const double *, uint32_t)
Definition: tif_dir.c:113
void _TIFFsetShortArrayExt(TIFF *, uint16_t **, const uint16_t *, uint32_t)
Definition: tif_dir.c:78
void * _TIFFCheckRealloc(TIFF *, void *, tmsize_t, tmsize_t, const char *)
Definition: tif_aux.c:97
void _tiffDummyUnmapProc(thandle_t fd, void *base, toff_t size)
Definition: tif_open.c:48
void * _TIFFCheckMalloc(TIFF *, tmsize_t, tmsize_t, const char *)
Definition: tif_aux.c:122
uint64_t _TIFFMultiply64(TIFF *, uint64_t, uint64_t, const char *)
Definition: tif_aux.c:47
void _TIFFSwab64BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
Definition: tif_read.c:1676
int TIFFSetDefaultCompressionState(TIFF *tif)
TIFFHeaderCommon common
Definition: tiffiop.h:107
TIFFHeaderClassic classic
Definition: tiffiop.h:108
TIFFHeaderBig big
Definition: tiffiop.h:109
#define const
Definition: zconf.h:233