LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
tiffio.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
30#ifndef _TIFFIO_
31#define _TIFFIO_
32
33/*
34 * TIFF I/O Library Definitions.
35 */
36#include "tiff.h"
37#include "tiffvers.h"
38
39/*
40 * TIFF is defined as an incomplete type to hide the
41 * library's internal data structures from clients.
42 */
54typedef struct tiff TIFF;
55
56/*
57 * The following typedefs define the intrinsic size of
58 * data types used in the *exported* interfaces. These
59 * definitions depend on the proper definition of types
60 * in tiff.h. Note also that the varargs interface used
61 * to pass tag types and values uses the types defined in
62 * tiff.h directly.
63 *
64 * NB: ttag_t -> deprecated and replaced by uint32_t
65 * is unsigned int and not unsigned short because
66 * ANSI C requires that the type before the ellipsis be a
67 * promoted type (i.e. one of int, unsigned int, pointer,
68 * or double) and because we defined pseudo-tags that are
69 * outside the range of legal Aldus-assigned tags.
70 * NB: tsize_t -> deprecated and replaced by tmsize_t
71 * is signed and not unsigned because some functions
72 * return -1.
73 * NB: toff_t is not off_t for many reasons; TIFFs max out at
74 * 32-bit file offsets, and BigTIFF maxes out at 64-bit
75 * offsets being the most important, and to ensure use of
76 * a consistently unsigned type across architectures.
77 * Prior to libtiff 4.0, this was an unsigned 32 bit type.
78 */
79/*
80 * this is the machine addressing size type, only it's signed, so make it
81 * int32_t on 32bit machines, int64_t on 64bit machines
82 */
91#define TIFF_TMSIZE_T_MAX (tmsize_t)(SIZE_MAX >> 1)
92
94typedef uint64_t toff_t;
96typedef uint32_t tdir_t;
97
98/* the following are deprecated and should be replaced by their defining
99 counterparts */
102typedef uint32_t ttag_t;
105typedef uint16_t tsample_t;
108typedef uint32_t tstrile_t;
120typedef void *tdata_t;
121
122/*
123 * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
124 * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
125 *
126 * By default tif_unix.c is assumed.
127 */
128
129#if defined(_WIN32)
130#if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && \
131 !defined(USE_WIN32_FILEIO)
136#define AVOID_WIN32_FILEIO
137#endif
138#endif
139
140#if defined(USE_WIN32_FILEIO)
145#define VC_EXTRALEAN
146#include <windows.h>
147#ifdef _WIN32
149DECLARE_HANDLE(thandle_t); /* Win32 file handle */
150#else
152typedef HFILE thandle_t; /* client data handle */
153#endif /* _WIN32 */
154#else
161typedef void *thandle_t; /* client data handle */
162#endif /* USE_WIN32_FILEIO */
163
166/*
167 * Flags to pass to TIFFPrintDirectory to control
168 * printing of data structures that are potentially
169 * very large. Bit-or these flags to enable printing
170 * multiple items.
171 */
180#define TIFFPRINT_NONE 0x0 /* no extra info */
190#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */
199#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */
209#define TIFFPRINT_COLORMAP 0x4 /* colormap */
216#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */
224#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */
232#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */
233
234/*
235 * Colour conversion stuff
236 */
237
238/* reference white */
243#define D65_X0 (95.0470f)
248#define D65_Y0 (100.0f)
253#define D65_Z0 (108.8827f)
254
259#define D50_X0 (96.4250f)
264#define D50_Y0 (100.0f)
269#define D50_Z0 (82.4680f)
270
271/* Structure for holding information about a display device. */
272
276typedef unsigned char TIFFRGBValue;
277
286typedef struct
287{
289 float d_mat[3][3];
291 float d_YCR;
293 float d_YCG;
295 float d_YCB;
297 uint32_t d_Vrwr;
299 uint32_t d_Vrwg;
301 uint32_t d_Vrwb;
303 float d_Y0R;
305 float d_Y0G;
307 float d_Y0B;
309 float d_gammaR;
311 float d_gammaG;
313 float d_gammaB;
315
333typedef struct
334{ /* YCbCr->RGB support */
345 int32_t *Cr_g_tab;
347 int32_t *Cb_g_tab;
349 int32_t *Y_tab;
351
360typedef struct
361{ /* CIE Lab 1976->RGB support */
363 int range;
370#define CIELABTORGB_TABLE_RANGE 1500
372 float rstep;
378 float gstep;
384 float bstep;
386 float X0;
388 float Y0;
390 float Z0;
394 float Yr2r[CIELABTORGB_TABLE_RANGE + 1];
396 float Yg2g[CIELABTORGB_TABLE_RANGE + 1];
398 float Yb2b[CIELABTORGB_TABLE_RANGE + 1];
400
401/*
402 * RGBA-style image support.
403 */
408/*
409 * The image reading and conversion routines invoke
410 * ``put routines'' to copy/image/whatever tiles of
411 * raw image data. A default set of routines are
412 * provided to convert/copy raw image data to 8-bit
413 * packed ABGR format rasters. Applications can supply
414 * alternate routines that unpack the data into a
415 * different format or, for example, unpack the data
416 * and draw the unpacked raster on the display.
417 */
453typedef void (*tileContigRoutine)(TIFFRGBAImage *img, uint32_t *cp, uint32_t x,
454 uint32_t y, uint32_t w, uint32_t h,
455 int32_t fromskew, int32_t toskew,
456 unsigned char *pp);
496typedef void (*tileSeparateRoutine)(TIFFRGBAImage *img, uint32_t *cp,
497 uint32_t x, uint32_t y, uint32_t w,
498 uint32_t h, int32_t fromskew,
499 int32_t toskew, unsigned char *r,
500 unsigned char *g, unsigned char *b,
501 unsigned char *a);
502/*
503 * RGBA-reader state.
504 */
517{
529 int alpha;
531 uint32_t width;
533 uint32_t height;
539 uint16_t orientation;
543 uint16_t photometric;
545 uint16_t *redcmap;
547 uint16_t *greencmap;
549 uint16_t *bluecmap;
550 /* get image data routine */
570 int (*get)(TIFFRGBAImage *img, uint32_t *raster, uint32_t rwidth,
571 uint32_t rheight);
572 /* put decoded strip/tile */
575 union
576 {
587 void (*any)(TIFFRGBAImage *img);
592 } put;
597 uint32_t **BWmap;
599 uint32_t **PALmap;
604
609 uint8_t *UaToAa;
612
617};
618
619/*
620 * Macros for extracting components from the
621 * packed ABGR form returned by TIFFReadRGBAImage.
622 */
634#define TIFFGetR(abgr) ((abgr) & 0xff)
646#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
658#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
670#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
671
672/*
673 * A CODEC is a software package that implements decoding,
674 * encoding, or decoding+encoding of a compression algorithm.
675 * The library provides a collection of builtin codecs.
676 * More codecs may be registered through calls to the library
677 * and/or the builtin implementations may be overridden.
678 */
697typedef int (*TIFFInitMethod)(TIFF *tif, int scheme);
705typedef struct
706{
711 const char *name;
713 uint16_t scheme;
716} TIFFCodec;
717
725typedef struct
726{
728 uint32_t uNum;
733 uint32_t uDenom;
735
736#include <stdarg.h>
737#include <stdio.h>
738
739/* share internal LogLuv conversion routines? */
740#ifndef LOGLUV_PUBLIC
748#define LOGLUV_PUBLIC 1
749#endif
750
761#if defined(__GNUC__) || defined(__clang__) || defined(__attribute__)
762#define TIFF_ATTRIBUTE(x) __attribute__(x)
763#else
764#define TIFF_ATTRIBUTE(x) /*nothing*/
765#endif
766
767/*
768 * Attributes describing memory allocation functions to the compiler.
769 *
770 * TIFF_ATTRIBUTE_MALLOC: the function returns a new block of memory, or NULL.
771 * TIFF_ATTRIBUTE_ALLOC_SIZE(n): the size in bytes of the returned block is
772 * given by argument n.
773 * TIFF_ATTRIBUTE_ALLOC_SIZE2(n, m): the size in bytes is the product of
774 * arguments n and m.
775 * TIFF_ATTRIBUTE_DEALLOC(f, n): the returned block must be released by
776 * passing it as argument n of function f.
777 *
778 * GCC and Clang use them for diagnostics such as -Warray-bounds and
779 * -Wstringop-overflow, and for the run-time checks of _FORTIFY_SOURCE and
780 * -fsanitize=object-size. GCC 11 or later also diagnoses a block released
781 * with the wrong function (-Wmismatched-dealloc) or used after it has been
782 * released (-Wuse-after-free).
783 */
784#if defined(__has_attribute)
785#if __has_attribute(__malloc__)
786#define TIFF_ATTRIBUTE_MALLOC __attribute__((__malloc__))
787#endif
788#if __has_attribute(__alloc_size__)
789#define TIFF_ATTRIBUTE_ALLOC_SIZE(n) __attribute__((__alloc_size__(n)))
790#define TIFF_ATTRIBUTE_ALLOC_SIZE2(n, m) __attribute__((__alloc_size__(n, m)))
791#endif
792#endif
793/* The two-argument malloc form is GCC-specific; compilers that only emulate
794 * GCC (Clang, Intel classic, NVIDIA HPC) may not support it. */
795#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && \
796 !defined(__NVCOMPILER)
797#if __GNUC__ >= 11
798#define TIFF_ATTRIBUTE_DEALLOC(f, n) __attribute__((__malloc__(f, n)))
799#endif
800#endif
801#ifndef TIFF_ATTRIBUTE_MALLOC
802#define TIFF_ATTRIBUTE_MALLOC
803#endif
804#ifndef TIFF_ATTRIBUTE_ALLOC_SIZE
805#define TIFF_ATTRIBUTE_ALLOC_SIZE(n)
806#define TIFF_ATTRIBUTE_ALLOC_SIZE2(n, m)
807#endif
808#ifndef TIFF_ATTRIBUTE_DEALLOC
809#define TIFF_ATTRIBUTE_DEALLOC(f, n)
810#endif
811
812#if defined(c_plusplus) || defined(__cplusplus)
813extern "C"
814{
815#endif
816
835 typedef void (*TIFFErrorHandler)(const char *module, const char *fmt,
836 va_list ap);
837
858 typedef void (*TIFFErrorHandlerExt)(thandle_t fd, const char *module,
859 const char *fmt, va_list ap);
884 typedef int (*TIFFErrorHandlerExtR)(TIFF *tif, void *user_data,
885 const char *module, const char *fmt,
886 va_list ap);
911 typedef tmsize_t (*TIFFReadWriteProc)(thandle_t fd, void *buf,
912 tmsize_t size);
933 typedef toff_t (*TIFFSeekProc)(thandle_t fd, toff_t off, int whence);
951 typedef int (*TIFFCloseProc)(thandle_t fd);
989 typedef int (*TIFFMapFileProc)(thandle_t fd, void **base, toff_t *size);
1008 typedef void (*TIFFUnmapFileProc)(thandle_t fd, void *base, toff_t size);
1026 typedef void (*TIFFExtendProc)(TIFF *tif);
1027
1041 extern const char *TIFFGetVersion(void);
1042
1058 extern const TIFFCodec *TIFFFindCODEC(uint16_t scheme);
1081 extern TIFFCodec *TIFFRegisterCODEC(uint16_t scheme, const char *name,
1082 TIFFInitMethod init);
1099 extern void TIFFUnRegisterCODEC(TIFFCodec *c);
1115 extern int TIFFIsCODECConfigured(uint16_t scheme);
1135 extern TIFFCodec *TIFFGetConfiguredCODECs(void);
1136
1137 /*
1138 * Auxiliary functions.
1139 */
1140#ifndef TIFF_DO_NOT_USE_NON_EXT_ALLOC_FUNCTIONS
1141
1153 extern void _TIFFfree(void *p);
1154
1169 extern void *_TIFFmalloc(tmsize_t s) TIFF_ATTRIBUTE_MALLOC
1170 TIFF_ATTRIBUTE_ALLOC_SIZE(1) TIFF_ATTRIBUTE_DEALLOC(_TIFFfree, 1);
1171
1187 extern void *_TIFFcalloc(tmsize_t nmemb, tmsize_t siz) TIFF_ATTRIBUTE_MALLOC
1188 TIFF_ATTRIBUTE_ALLOC_SIZE2(1, 2) TIFF_ATTRIBUTE_DEALLOC(_TIFFfree, 1);
1189
1208 extern void *_TIFFrealloc(void *p, tmsize_t s) TIFF_ATTRIBUTE_ALLOC_SIZE(2)
1209 TIFF_ATTRIBUTE_DEALLOC(_TIFFfree, 1);
1210#endif
1211
1224 extern void _TIFFmemset(void *p, int v, tmsize_t c);
1225
1239 extern void _TIFFmemcpy(void *d, const void *s, tmsize_t c);
1240
1255 extern int _TIFFmemcmp(const void *p1, const void *p2, tmsize_t c);
1256
1257 /*
1258 ** Stuff, related to tag handling and creating custom tags.
1259 */
1271 extern int TIFFGetTagListCount(TIFF *tif);
1283 extern uint32_t TIFFGetTagListEntry(TIFF *tif, int tag_index);
1284
1289#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
1297#define TIFF_VARIABLE -1 /* marker for variable length tags */
1302#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */
1310#define TIFF_VARIABLE2 -3 /* marker for uint32_t var-length tags */
1311
1316#define FIELD_CUSTOM 65
1317
1325 typedef struct _TIFFField TIFFField;
1334
1351 extern const TIFFField *TIFFFindField(TIFF *tif, uint32_t tag,
1352 TIFFDataType dt);
1368 extern const TIFFField *TIFFFieldWithTag(TIFF *tif, uint32_t tag);
1385 extern const TIFFField *TIFFFieldWithName(TIFF *tif,
1386 const char *field_name);
1387
1398 extern uint32_t TIFFFieldTag(const TIFFField *fip);
1410 extern const char *TIFFFieldName(const TIFFField *fip);
1422 extern TIFFDataType TIFFFieldDataType(const TIFFField *fip);
1434 extern int TIFFFieldPassCount(const TIFFField *fip);
1446 extern int TIFFFieldReadCount(const TIFFField *fip);
1458 extern int TIFFFieldWriteCount(const TIFFField *fip);
1473 extern int TIFFFieldSetGetSize(const TIFFField *fip);
1487 extern int TIFFFieldSetGetCountSize(const TIFFField *fip);
1499 extern int TIFFFieldIsAnonymous(const TIFFField *fip);
1500
1521 typedef int (*TIFFVSetMethod)(TIFF *tif, uint32_t tag, va_list ap);
1540 typedef int (*TIFFVGetMethod)(TIFF *tif, uint32_t tag, va_list ap);
1561 typedef void (*TIFFPrintMethod)(TIFF *tif, FILE *fd, long flags);
1562
1581
1598
1614 extern void *TIFFGetClientInfo(TIFF *tif, const char *name);
1615
1637 extern void TIFFSetClientInfo(TIFF *tif, void *data, const char *name);
1638
1661 extern void TIFFCleanup(TIFF *tif);
1662
1681 extern void TIFFClose(TIFF *tif);
1682
1701 extern int TIFFFlush(TIFF *tif);
1702
1720 extern int TIFFFlushData(TIFF *tif);
1744 extern int TIFFGetField(TIFF *tif, uint32_t tag, ...);
1768 extern int TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap);
1797 extern int TIFFGetFieldDefaulted(TIFF *tif, uint32_t tag, ...);
1826 extern int TIFFVGetFieldDefaulted(TIFF *tif, uint32_t tag, va_list ap);
1853 extern int TIFFReadDirectory(TIFF *tif);
1883 extern int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff,
1884 const TIFFFieldArray *infoarray);
1901 extern int TIFFReadEXIFDirectory(TIFF *tif, toff_t diroff);
1918 extern int TIFFReadGPSDirectory(TIFF *tif, toff_t diroff);
1944 extern uint64_t TIFFScanlineSize64(TIFF *tif);
1973 extern tmsize_t TIFFScanlineSize(TIFF *tif);
1994 extern uint64_t TIFFRasterScanlineSize64(TIFF *tif);
2038 extern uint64_t TIFFStripSize64(TIFF *tif);
2061 extern tmsize_t TIFFStripSize(TIFF *tif);
2081 extern uint64_t TIFFRawStripSize64(TIFF *tif, uint32_t strip);
2107 extern tmsize_t TIFFRawStripSize(TIFF *tif, uint32_t strip);
2133 extern uint64_t TIFFVStripSize64(TIFF *tif, uint32_t nrows);
2161 extern tmsize_t TIFFVStripSize(TIFF *tif, uint32_t nrows);
2189 extern uint64_t TIFFTileRowSize64(TIFF *tif);
2215 extern tmsize_t TIFFTileRowSize(TIFF *tif);
2238 extern uint64_t TIFFTileSize64(TIFF *tif);
2263 extern tmsize_t TIFFTileSize(TIFF *tif);
2288 extern uint64_t TIFFVTileSize64(TIFF *tif, uint32_t nrows);
2315 extern tmsize_t TIFFVTileSize(TIFF *tif, uint32_t nrows);
2335 extern uint32_t TIFFDefaultStripSize(TIFF *tif, uint32_t request);
2352 extern void TIFFDefaultTileSize(TIFF *tif, uint32_t *tw, uint32_t *th);
2353
2368 extern int TIFFFileno(TIFF *tif);
2369
2383 extern int TIFFSetFileno(TIFF *tif, int fd);
2384
2397 extern thandle_t TIFFClientdata(TIFF *tif);
2398
2415 extern thandle_t TIFFSetClientdata(TIFF *tif, thandle_t newvalue);
2416
2430 extern int TIFFGetMode(TIFF *tif);
2431
2447 extern int TIFFSetMode(TIFF *tif, int mode);
2448
2461 extern int TIFFIsTiled(TIFF *tif);
2462
2475 extern int TIFFIsByteSwapped(TIFF *tif);
2476
2489 extern int TIFFIsUpSampled(TIFF *tif);
2490
2504 extern int TIFFIsMSB2LSB(TIFF *tif);
2505
2519 extern int TIFFIsBigEndian(TIFF *tif);
2520
2533 extern int TIFFIsBigTIFF(TIFF *tif);
2534
2551
2568
2584 extern TIFFSeekProc TIFFGetSeekProc(TIFF *tif);
2585
2601 extern TIFFCloseProc TIFFGetCloseProc(TIFF *tif);
2602
2618 extern TIFFSizeProc TIFFGetSizeProc(TIFF *tif);
2619
2636
2672 extern uint32_t TIFFCurrentRow(TIFF *tif);
2689 extern tdir_t TIFFCurrentDirectory(TIFF *tif);
2710 extern tdir_t TIFFNumberOfDirectories(TIFF *tif);
2725 extern uint64_t TIFFCurrentDirOffset(TIFF *tif);
2741 extern uint32_t TIFFCurrentStrip(TIFF *tif);
2757 extern uint32_t TIFFCurrentTile(TIFF *tif);
2792 extern int TIFFReadBufferSetup(TIFF *tif, void *bp, tmsize_t size);
2822 extern int TIFFWriteBufferSetup(TIFF *tif, void *bp, tmsize_t size);
2841 extern int TIFFSetupStrips(TIFF *tif);
2869 extern int TIFFWriteCheck(TIFF *tif, int tiles, const char *module);
2885 extern void TIFFFreeDirectory(TIFF *tif);
2905 extern int TIFFCreateDirectory(TIFF *tif);
2936 extern int TIFFCreateCustomDirectory(TIFF *tif,
2937 const TIFFFieldArray *infoarray);
2951 extern int TIFFCreateEXIFDirectory(TIFF *tif);
2966 extern int TIFFCreateGPSDirectory(TIFF *tif);
2978 extern int TIFFLastDirectory(TIFF *tif);
3002 extern int TIFFSetDirectory(TIFF *tif, tdir_t dirn);
3033 extern int TIFFSetSubDirectory(TIFF *tif, uint64_t diroff);
3060 extern int TIFFUnlinkDirectory(TIFF *tif, tdir_t dirn);
3086 extern int TIFFSetField(TIFF *tif, uint32_t tag, ...);
3112 extern int TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap);
3132 extern int TIFFUnsetField(TIFF *tif, uint32_t tag);
3161 extern int TIFFWriteDirectory(TIFF *tif);
3191 extern int TIFFWriteCustomDirectory(TIFF *tif, uint64_t *pdiroff);
3222 extern int TIFFCheckpointDirectory(TIFF *tif);
3253 extern int TIFFRewriteDirectory(TIFF *tif);
3273 extern int TIFFDeferStrileArrayWriting(TIFF *tif);
3294 extern int TIFFForceStrileArrayWriting(TIFF *tif);
3295
3296#if defined(c_plusplus) || defined(__cplusplus)
3297 extern void TIFFPrintDirectory(TIFF *tif, FILE *fd, long flags = 0);
3298 extern int TIFFReadScanline(TIFF *tif, void *buf, uint32_t row,
3299 uint16_t sample = 0);
3300 extern int TIFFWriteScanline(TIFF *tif, void *buf, uint32_t row,
3301 uint16_t sample = 0);
3302 extern int TIFFReadRGBAImage(TIFF *, uint32_t, uint32_t, uint32_t *,
3303 int = 0);
3304 extern int TIFFReadRGBAImageOriented(TIFF *, uint32_t, uint32_t, uint32_t *,
3305 int = ORIENTATION_BOTLEFT, int = 0);
3306#else
3344extern void TIFFPrintDirectory(TIFF *tif, FILE *fd, long flags);
3375extern int TIFFReadScanline(TIFF *tif, void *buf, uint32_t row,
3376 uint16_t sample);
3408extern int TIFFWriteScanline(TIFF *tif, void *buf, uint32_t row,
3409 uint16_t sample);
3435extern int TIFFReadRGBAImage(TIFF *tif, uint32_t rwidth, uint32_t rheight,
3436 uint32_t *raster, int stop);
3465extern int TIFFReadRGBAImageOriented(TIFF *tif, uint32_t rwidth,
3466 uint32_t rheight, uint32_t *raster,
3467 int orientation, int stop);
3468#endif
3469
3494 extern int TIFFReadRGBAStrip(TIFF *tif, uint32_t row, uint32_t *raster);
3522 extern int TIFFReadRGBATile(TIFF *tif, uint32_t col, uint32_t row,
3523 uint32_t *raster);
3550 extern int TIFFReadRGBAStripExt(TIFF *tif, uint32_t row, uint32_t *raster,
3551 int stop_on_error);
3581 extern int TIFFReadRGBATileExt(TIFF *tif, uint32_t col, uint32_t row,
3582 uint32_t *raster, int stop_on_error);
3603 extern int TIFFRGBAImageOK(TIFF *tif, char emsg[1024]);
3632 extern int TIFFRGBAImageBegin(TIFFRGBAImage *img, TIFF *tif, int stop,
3633 char emsg[1024]);
3666 extern int TIFFRGBAImageGet(TIFFRGBAImage *img, uint32_t *raster,
3667 uint32_t rwidth, uint32_t rheight);
3682 extern void TIFFRGBAImageEnd(TIFFRGBAImage *img);
3683
3699 extern const char *TIFFFileName(TIFF *tif);
3700
3717 extern const char *TIFFSetFileName(TIFF *tif, const char *name);
3718
3740 extern void TIFFError(const char *module, const char *fmt, ...)
3741 TIFF_ATTRIBUTE((__format__(__printf__, 2, 3)));
3742
3765 extern void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,
3766 ...)
3767 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
3768
3790 extern void TIFFWarning(const char *module, const char *fmt, ...)
3791 TIFF_ATTRIBUTE((__format__(__printf__, 2, 3)));
3792
3815 extern void TIFFWarningExt(thandle_t fd, const char *module,
3816 const char *fmt, ...)
3817 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
3818
3836
3853 extern TIFFErrorHandlerExt
3855
3873
3890 extern TIFFErrorHandlerExt
3892
3917 extern void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,
3918 ...)
3919 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
3920
3945 extern void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,
3946 ...)
3947 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
3948
3957
3971
3983 extern void TIFFOpenOptionsFree(TIFFOpenOptions *opts);
3984
4003 extern void
4005 tmsize_t max_single_mem_alloc);
4006
4026 extern void
4028 tmsize_t max_cumulated_mem_alloc);
4029
4043 extern void
4045 int warn_about_unknown_tags);
4046
4070 extern void
4072 TIFFErrorHandlerExtR handler,
4073 void *errorhandler_user_data);
4074
4098 extern void
4100 TIFFErrorHandlerExtR handler,
4101 void *warnhandler_user_data);
4102
4125 extern TIFF *TIFFOpen(const char *name, const char *mode);
4126
4153 extern TIFF *TIFFOpenExt(const char *name, const char *mode,
4154 TIFFOpenOptions *opts);
4155#ifdef _WIN32
4156 /*
4157 * TIFFOpenW() and TIFFOpenWExt() are documented with their definitions in
4158 * tif_win32.c: the reference is not generated for Windows, so these
4159 * Windows-only declarations are not visible to Doxygen.
4160 */
4161 extern TIFF *TIFFOpenW(const wchar_t *name, const char *mode);
4162
4163 extern TIFF *TIFFOpenWExt(const wchar_t *name, const char *mode,
4164 TIFFOpenOptions *opts);
4165#endif /* _WIN32 */
4166
4193 extern TIFF *TIFFFdOpen(int fd, const char *name, const char *mode);
4194
4223 extern TIFF *TIFFFdOpenExt(int fd, const char *name, const char *mode,
4224 TIFFOpenOptions *opts);
4225
4269 extern TIFF *TIFFClientOpen(const char *name, const char *mode,
4270 thandle_t clientdata,
4271 TIFFReadWriteProc readproc,
4272 TIFFReadWriteProc writeproc,
4273 TIFFSeekProc seekproc, TIFFCloseProc closeproc,
4274 TIFFSizeProc sizeproc, TIFFMapFileProc mapproc,
4275 TIFFUnmapFileProc unmapproc);
4276
4322 extern TIFF *
4323 TIFFClientOpenExt(const char *name, const char *mode, thandle_t clientdata,
4324 TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc,
4325 TIFFSeekProc seekproc, TIFFCloseProc closeproc,
4326 TIFFSizeProc sizeproc, TIFFMapFileProc mapproc,
4327 TIFFUnmapFileProc unmapproc, TIFFOpenOptions *opts);
4369 extern uint32_t TIFFComputeTile(TIFF *tif, uint32_t x, uint32_t y,
4370 uint32_t z, uint16_t s);
4393 extern int TIFFCheckTile(TIFF *tif, uint32_t x, uint32_t y, uint32_t z,
4394 uint16_t s);
4412 extern uint32_t TIFFNumberOfTiles(TIFF *tif);
4441 extern tmsize_t TIFFReadTile(TIFF *tif, void *buf, uint32_t x, uint32_t y,
4442 uint32_t z, uint16_t s);
4475 extern tmsize_t TIFFWriteTile(TIFF *tif, void *buf, uint32_t x, uint32_t y,
4476 uint32_t z, uint16_t s);
4498 extern uint32_t TIFFComputeStrip(TIFF *tif, uint32_t row, uint16_t sample);
4517 extern uint32_t TIFFNumberOfStrips(TIFF *tif);
4549 extern tmsize_t TIFFReadEncodedStrip(TIFF *tif, uint32_t strip, void *buf,
4550 tmsize_t size);
4582 extern tmsize_t TIFFReadRawStrip(TIFF *tif, uint32_t strip, void *buf,
4583 tmsize_t size);
4615 extern tmsize_t TIFFReadEncodedTile(TIFF *tif, uint32_t tile, void *buf,
4616 tmsize_t size);
4647 extern tmsize_t TIFFReadRawTile(TIFF *tif, uint32_t tile, void *buf,
4648 tmsize_t size);
4687 extern int TIFFReadFromUserBuffer(TIFF *tif, uint32_t strile, void *inbuf,
4688 tmsize_t insize, void *outbuf,
4689 tmsize_t outsize);
4726 extern tmsize_t TIFFWriteEncodedStrip(TIFF *tif, uint32_t strip, void *data,
4727 tmsize_t cc);
4758 extern tmsize_t TIFFWriteRawStrip(TIFF *tif, uint32_t strip, void *data,
4759 tmsize_t cc);
4794 extern tmsize_t TIFFWriteEncodedTile(TIFF *tif, uint32_t tile, void *data,
4795 tmsize_t cc);
4823 extern tmsize_t TIFFWriteRawTile(TIFF *tif, uint32_t tile, void *data,
4824 tmsize_t cc);
4841 extern uint64_t TIFFGetMaxCompressionRatio(TIFF *tif);
4854 extern int TIFFDataWidth(
4855 TIFFDataType type); /* table of tag datatype widths within TIFF file. */
4878 extern void TIFFSetWriteOffset(TIFF *tif, toff_t off);
4891 extern void TIFFSwabShort(uint16_t *wp);
4904 extern void TIFFSwabLong(uint32_t *lp);
4917 extern void TIFFSwabLong8(uint64_t *lp);
4930 extern void TIFFSwabFloat(float *fp);
4943 extern void TIFFSwabDouble(double *dp);
4958 extern void TIFFSwabArrayOfShort(uint16_t *wp, tmsize_t n);
4974 extern void TIFFSwabArrayOfTriples(uint8_t *tp, tmsize_t n);
4989 extern void TIFFSwabArrayOfLong(uint32_t *lp, tmsize_t n);
5004 extern void TIFFSwabArrayOfLong8(uint64_t *lp, tmsize_t n);
5019 extern void TIFFSwabArrayOfFloat(float *fp, tmsize_t n);
5034 extern void TIFFSwabArrayOfDouble(double *dp, tmsize_t n);
5046 extern void TIFFReverseBits(uint8_t *cp, tmsize_t n);
5058 extern const unsigned char *TIFFGetBitRevTable(int reversed);
5059
5083 extern uint64_t TIFFGetStrileOffset(TIFF *tif, uint32_t strile);
5107 extern uint64_t TIFFGetStrileByteCount(TIFF *tif, uint32_t strile);
5133 extern uint64_t TIFFGetStrileOffsetWithErr(TIFF *tif, uint32_t strile,
5134 int *pbErr);
5160 extern uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile,
5161 int *pbErr);
5162
5163#if LOGLUV_PUBLIC
5168#define U_NEU 0.210526316
5173#define V_NEU 0.473684211
5178#define UVSCALE 410.
5193 extern double LogL16toY(int p16);
5207 extern double LogL10toY(int p10);
5223 extern void XYZtoRGB24(float *xyz, uint8_t *rgb);
5239 extern int uv_decode(double *up, double *vp, int c);
5256 extern void LogLuv24toXYZ(uint32_t p, float *XYZ);
5273 extern void LogLuv32toXYZ(uint32_t p, float *XYZ);
5274#if defined(c_plusplus) || defined(__cplusplus)
5275 extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
5276 extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
5277 extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
5278 extern uint32_t LogLuv24fromXYZ(float *, int = SGILOGENCODE_NODITHER);
5279 extern uint32_t LogLuv32fromXYZ(float *, int = SGILOGENCODE_NODITHER);
5280#else
5303 extern int LogL16fromY(double Y, int em);
5324 extern int LogL10fromY(double Y, int em);
5348 extern int uv_encode(double u, double v, int em);
5370 extern uint32_t LogLuv24fromXYZ(float *XYZ, int em);
5392 extern uint32_t LogLuv32fromXYZ(float *XYZ, int em);
5393#endif
5394#endif /* LOGLUV_PUBLIC */
5395
5417 extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB *cielab,
5418 const TIFFDisplay *display, float *refWhite);
5442 extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32_t l, int32_t a,
5443 int32_t b, float *X, float *Y, float *Z);
5466 extern void TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z,
5467 uint32_t *r, uint32_t *g, uint32_t *b);
5468
5490 extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *ycbcr, float *luma,
5491 float *refBlackWhite);
5510 extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32_t Y, int32_t Cb,
5511 int32_t Cr, uint32_t *r, uint32_t *g,
5512 uint32_t *b);
5513
5514 /****************************************************************************
5515 * O B S O L E T E D I N T E R F A C E S
5516 *
5517 * Don't use this stuff in your applications, it may be removed in the
5518 *future libtiff versions.
5519 ****************************************************************************/
5530 typedef struct
5531 {
5533 uint32_t field_tag;
5546 unsigned short field_bit;
5548 unsigned char field_oktochange;
5553 unsigned char field_passcount;
5558 const char *field_name;
5559 } TIFFFieldInfo;
5560
5585 extern int TIFFMergeFieldInfo(TIFF *tif, const TIFFFieldInfo info[],
5586 uint32_t n);
5587
5588#if defined(c_plusplus) || defined(__cplusplus)
5589}
5590#endif
5591
5592#endif /* _TIFFIO_ */
void TIFFSetClientInfo(TIFF *tif, void *data, const char *name)
Add or replace a handle-local named borrowed payload.
void * TIFFGetClientInfo(TIFF *tif, const char *name)
Look up a borrowed payload by its handle-local name.
TIFFCodec * TIFFRegisterCODEC(uint16_t scheme, const char *name, TIFFInitMethod init)
Register a codec descriptor ahead of built-in and older entries.
const TIFFCodec * TIFFFindCODEC(uint16_t scheme)
Find the highest-priority descriptor for a compression scheme.
int(* TIFFInitMethod)(TIFF *tif, int scheme)
Install compression methods and private state on a handle.
Definition tiffio.h:697
int TIFFIsCODECConfigured(uint16_t scheme)
Check whether the selected descriptor has a configured initialiser.
Definition tif_codec.c:171
TIFFCodec * TIFFGetConfiguredCODECs(void)
Allocate a terminated snapshot of registered and configured codec descriptors.
void TIFFUnRegisterCODEC(TIFFCodec *c)
Remove and free an exact registered codec descriptor.
#define TIFF_SSIZE_T
Define the signed addressing-size type used for tmsize_t.
Definition tiffconf.h:63
void TIFFSwabArrayOfLong8(uint64_t *lp, tmsize_t n)
Reverse the byte order of each array element.
Definition tif_swab.c:144
void TIFFSwabFloat(float *fp)
Reverse the byte order of one value.
Definition tif_swab.c:171
void TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32_t l, int32_t a, int32_t b, float *X, float *Y, float *Z)
Convert 8-bit TIFF CIE L*a*b* samples to XYZ.
Definition tif_color.c:50
void TIFFSwabDouble(double *dp)
Reverse the byte order of one value.
Definition tif_swab.c:207
void TIFFSwabArrayOfTriples(uint8_t *tp, tmsize_t n)
Reverse the byte order of each array element.
Definition tif_swab.c:105
void TIFFSwabArrayOfDouble(double *dp, tmsize_t n)
Reverse the byte order of each array element.
Definition tif_swab.c:228
void TIFFSwabArrayOfShort(uint16_t *wp, tmsize_t n)
Reverse the byte order of each array element.
Definition tif_swab.c:87
void TIFFSwabLong8(uint64_t *lp)
Reverse the byte order of one value.
Definition tif_swab.c:66
void TIFFSwabShort(uint16_t *wp)
Reverse the byte order of one value.
Definition tif_swab.c:39
void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32_t Y, int32_t Cb, int32_t Cr, uint32_t *r, uint32_t *g, uint32_t *b)
Convert an 8-bit YCbCr sample triplet to clipped RGB.
Definition tif_color.c:289
const unsigned char * TIFFGetBitRevTable(int reversed)
Select the immutable byte reversal or identity lookup table.
Definition tif_swab.c:325
void TIFFSwabArrayOfLong(uint32_t *lp, tmsize_t n)
Reverse the byte order of each array element.
Definition tif_swab.c:123
int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *ycbcr, float *luma, float *refBlackWhite)
Initialise caller-allocated 8-bit YCbCr conversion tables.
Definition tif_color.c:354
void TIFFReverseBits(uint8_t *cp, tmsize_t n)
Reverse the bit order within each byte of a buffer.
Definition tif_swab.c:330
int TIFFCIELabToRGBInit(TIFFCIELabToRGB *cielab, const TIFFDisplay *display, float *refWhite)
Initialise caller-owned CIE Lab conversion tables and reference white.
Definition tif_color.c:162
void TIFFSwabLong(uint32_t *lp)
Reverse the byte order of one value.
Definition tif_swab.c:51
void TIFFSwabArrayOfFloat(float *fp, tmsize_t n)
Reverse the byte order of each array element.
Definition tif_swab.c:186
void TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z, uint32_t *r, uint32_t *g, uint32_t *b)
Convert XYZ tristimulus values to display RGB channels.
Definition tif_color.c:112
#define TIFF_ATTRIBUTE(x)
Expand a compiler attribute in a public declaration when supported.
Definition tiffio.h:764
unsigned char TIFFRGBValue
Represent an 8-bit RGB channel value.
Definition tiffio.h:276
#define CIELABTORGB_TABLE_RANGE
Define the largest CIE L*a*b*-to-RGB lookup-table index.
Definition tiffio.h:370
void(* TIFFErrorHandlerExt)(thandle_t fd, const char *module, const char *fmt, va_list ap)
Handle a library-wide error or warning diagnostic.
Definition tiffio.h:858
TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt handler)
Replace the library-wide error extended handler.
Definition tif_error.c:44
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Dispatch a error diagnostic to the configured handlers.
Definition tif_error.c:68
void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,...)
Dispatch a warning diagnostic to the configured handlers.
Definition tif_warning.c:85
void TIFFWarningExt(thandle_t fd, const char *module, const char *fmt,...)
Dispatch a warning diagnostic to the configured handlers.
Definition tif_warning.c:68
void TIFFWarning(const char *module, const char *fmt,...)
Dispatch a warning diagnostic to the configured handlers.
Definition tif_warning.c:51
TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt handler)
Replace the library-wide warning extended handler.
Definition tif_warning.c:44
void TIFFError(const char *module, const char *fmt,...)
Dispatch a error diagnostic to the configured handlers.
Definition tif_error.c:51
void(* TIFFErrorHandler)(const char *module, const char *fmt, va_list ap)
Handle a library-wide error or warning diagnostic.
Definition tiffio.h:835
TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler handler)
Replace the library-wide error handler.
Definition tif_error.c:37
TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler handler)
Replace the library-wide warning handler.
Definition tif_warning.c:37
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,...)
Dispatch a error diagnostic to the configured handlers.
Definition tif_error.c:112
tdir_t TIFFNumberOfDirectories(TIFF *tif)
Count reachable main-chain directories from the cached file header.
Definition tif_dir.c:2623
int TIFFSetSubDirectory(TIFF *tif, uint64_t diroff)
Select and read an image directory at a file offset.
Definition tif_dir.c:2744
void TIFFFreeDirectory(TIFF *tif)
Release the current directory's owned values and codec state.
Definition tif_dir.c:2165
int TIFFLastDirectory(TIFF *tif)
Test whether the cached next-directory link is zero.
Definition tif_dir.c:2820
int TIFFCreateGPSDirectory(TIFF *tif)
Create a fresh in-memory EXIF GPS metadata directory.
Definition tif_dir.c:2306
tdir_t TIFFCurrentDirectory(TIFF *tif)
Read the cached index of the current directory.
Definition tif_open.c:906
int TIFFSetDirectory(TIFF *tif, tdir_t dirn)
Select and read an image directory by its main-chain index.
Definition tif_dir.c:2648
int TIFFUnlinkDirectory(TIFF *tif, tdir_t dirn)
Remove an image directory from the on-file main chain.
Definition tif_dir.c:2828
int TIFFCreateDirectory(TIFF *tif)
Replace current values with a fresh in-memory image directory.
Definition tif_dir.c:2246
int TIFFCreateCustomDirectory(TIFF *tif, const TIFFFieldArray *infoarray)
Replace current values with a fresh custom metadata directory.
Definition tif_dir.c:2258
int TIFFCreateEXIFDirectory(TIFF *tif)
Create a fresh in-memory EXIF metadata directory.
Definition tif_dir.c:2296
uint64_t TIFFCurrentDirOffset(TIFF *tif)
Read the cached file offset of the current directory.
Definition tif_dir.c:2814
void TIFFPrintDirectory(TIFF *tif, FILE *fd, long flags)
Print a human-readable description of the current directory.
Definition tif_print.c:365
uint32_t TIFFGetTagListEntry(TIFF *tif, int tag_index)
Look up a tag number by its custom-value list index.
int TIFFFieldIsAnonymous(const TIFFField *fip)
Test whether a field was registered as an unknown tag.
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32_t tag)
Find a registered field by tag number.
int TIFFDataWidth(TIFFDataType type)
Report the on-disk byte width of a TIFF data type.
int TIFFMergeFieldInfo(TIFF *tif, const TIFFFieldInfo info[], uint32_t n)
Register legacy application field definitions on a handle.
const TIFFField * TIFFFieldWithName(TIFF *tif, const char *field_name)
Find a registered field by name.
int TIFFFieldReadCount(const TIFFField *fip)
Read a field descriptor's getter count rule.
void(* TIFFExtendProc)(TIFF *tif)
Extend the image-directory field table during default initialisation.
Definition tiffio.h:1026
TIFFDataType TIFFFieldDataType(const TIFFField *fip)
Read a field descriptor's on-disk data type.
int TIFFFieldWriteCount(const TIFFField *fip)
Read a field descriptor's setter count rule.
uint32_t TIFFFieldTag(const TIFFField *fip)
Read a field descriptor's tag number.
int TIFFGetTagListCount(TIFF *tif)
Count values stored in the current custom-tag list.
TIFFTagMethods * TIFFAccessTagMethods(TIFF *tif)
Expose a handle's mutable tag-method table.
const TIFFField * TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)
Find a registered field by tag number and file data type.
int TIFFFieldPassCount(const TIFFField *fip)
Test whether a field passes an explicit count argument.
const char * TIFFFieldName(const TIFFField *fip)
Read a field descriptor's name.
TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc extender)
Replace the process-wide image-directory extension callback.
Definition tif_dir.c:2232
int TIFFFieldSetGetCountSize(const TIFFField *fip)
Report the count width encoded by a field's set/get representation.
int TIFFFieldSetGetSize(const TIFFField *fip)
Report the internal element storage width of a field.
int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff, const TIFFFieldArray *infoarray)
Read metadata using an explicit custom field schema.
int TIFFReadGPSDirectory(TIFF *tif, toff_t diroff)
Read a EXIF GPS metadata directory.
int TIFFReadEXIFDirectory(TIFF *tif, toff_t diroff)
Read a EXIF metadata directory.
int TIFFReadDirectory(TIFF *tif)
Read and install the next image directory.
int TIFFCheckpointDirectory(TIFF *tif)
Write the current image directory while retaining its values.
int TIFFForceStrileArrayWriting(TIFF *tif)
Patch on-file strile offset and byte-count payloads.
Definition tif_flush.c:81
int TIFFRewriteDirectory(TIFF *tif)
Relocate the current image IFD and repair its main-chain link.
int TIFFDeferStrileArrayWriting(TIFF *tif)
Reserve strile-array entries for deferred payload writing.
int TIFFWriteDirectory(TIFF *tif)
Finish the current image directory and prepare a fresh one.
int TIFFWriteCustomDirectory(TIFF *tif, uint64_t *pdiroff)
Write current custom values and return their IFD offset.
int TIFFReadBufferSetup(TIFF *tif, void *bp, tmsize_t size)
Replace the handle's raw reading buffer.
Definition tif_read.c:1802
uint64_t TIFFGetMaxCompressionRatio(TIFF *tif)
Query the codec's allocation-recovery compression-ratio heuristic.
int TIFFWriteBufferSetup(TIFF *tif, void *bp, tmsize_t size)
Replace the handle's encoding buffer.
Definition tif_write.c:860
int TIFFWriteCheck(TIFF *tif, int tiles, const char *module)
Validate and prepare geometry for image writing.
Definition tif_write.c:783
int TIFFSetupStrips(TIFF *tif)
Replace strile offset/count arrays from current geometry.
Definition tif_write.c:729
tmsize_t TIFFTileSize(TIFF *tif)
Compute the decoded-size estimate for the configured tile height.
Definition tif_tile.c:307
tmsize_t TIFFStripSize(TIFF *tif)
Compute the decoded-size estimate for a nominal strip.
Definition tif_strip.c:244
uint64_t TIFFRawStripSize64(TIFF *tif, uint32_t strip)
Query the stored byte count for one raw strip.
Definition tif_strip.c:193
tmsize_t TIFFScanlineSize(TIFF *tif)
Compute the current scanline I/O byte estimate.
Definition tif_strip.c:383
tmsize_t TIFFVStripSize(TIFF *tif, uint32_t nrows)
Compute the decoded-size estimate for a requested strip height.
Definition tif_strip.c:182
uint64_t TIFFVTileSize64(TIFF *tif, uint32_t nrows)
Compute the decoded-size estimate for a requested tile height.
Definition tif_tile.c:287
uint64_t TIFFScanlineSize64(TIFF *tif)
Compute the current scanline I/O byte estimate.
Definition tif_strip.c:297
uint32_t TIFFNumberOfStrips(TIFF *tif)
Compute the strip count from current image geometry.
Definition tif_strip.c:82
tmsize_t TIFFTileRowSize(TIFF *tif)
Compute the packed byte count of one tile row.
Definition tif_tile.c:276
uint32_t TIFFComputeStrip(TIFF *tif, uint32_t row, uint16_t sample)
Compute a strip index from a row and optional sample plane.
Definition tif_strip.c:41
uint64_t TIFFVStripSize64(TIFF *tif, uint32_t nrows)
Compute the decoded-size estimate for a requested strip height.
Definition tif_strip.c:177
uint32_t TIFFCurrentTile(TIFF *tif)
Read the cached current tile index.
Definition tif_open.c:916
uint64_t TIFFTileSize64(TIFF *tif)
Compute the decoded-size estimate for the configured tile height.
Definition tif_tile.c:303
tmsize_t TIFFVTileSize(TIFF *tif, uint32_t nrows)
Compute the decoded-size estimate for a requested tile height.
Definition tif_tile.c:292
tmsize_t TIFFRawStripSize(TIFF *tif, uint32_t strip)
Convert one raw-strip byte count to the legacy signed-size result.
Definition tif_strip.c:208
uint32_t TIFFCurrentRow(TIFF *tif)
Read the cached current scanline index.
Definition tif_open.c:901
uint32_t TIFFComputeTile(TIFF *tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
Compute a tile index from pixel and sample coordinates.
Definition tif_tile.c:40
int TIFFCheckTile(TIFF *tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
Check pixel and separate-sample coordinates against image bounds.
Definition tif_tile.c:118
uint64_t TIFFStripSize64(TIFF *tif)
Compute the decoded-size estimate for a nominal strip.
Definition tif_strip.c:236
uint32_t TIFFDefaultStripSize(TIFF *tif, uint32_t request)
Ask the installed sizing method for a RowsPerStrip recommendation.
Definition tif_strip.c:258
uint32_t TIFFNumberOfTiles(TIFF *tif)
Compute the tile count across image depth and sample planes.
Definition tif_tile.c:155
void TIFFDefaultTileSize(TIFF *tif, uint32_t *tw, uint32_t *th)
Ask the installed sizing method to adjust tile width and height.
Definition tif_tile.c:321
uint64_t TIFFRasterScanlineSize64(TIFF *tif)
Compute the packed full-raster row byte count.
Definition tif_strip.c:397
uint64_t TIFFTileRowSize64(TIFF *tif)
Compute the packed byte count of one tile row.
Definition tif_tile.c:187
tmsize_t TIFFRasterScanlineSize(TIFF *tif)
Compute the packed full-raster row byte count.
Definition tif_strip.c:415
uint32_t TIFFCurrentStrip(TIFF *tif)
Read the cached current strip index.
Definition tif_open.c:911
int TIFFReadScanline(TIFF *tif, void *buf, uint32_t row, uint16_t sample)
Decode one image scanline into caller storage.
Definition tif_read.c:602
int TIFFReadFromUserBuffer(TIFF *tif, uint32_t strile, void *inbuf, tmsize_t insize, void *outbuf, tmsize_t outsize)
Decode one strile from caller-provided stored bytes.
Definition tif_read.c:2081
tmsize_t TIFFReadRawStrip(TIFF *tif, uint32_t strip, void *buf, tmsize_t size)
Read stored bytes from one strip.
Definition tif_read.c:974
tmsize_t TIFFReadRawTile(TIFF *tif, uint32_t tile, void *buf, tmsize_t size)
Read stored bytes from one tile.
Definition tif_read.c:1549
tmsize_t TIFFReadEncodedStrip(TIFF *tif, uint32_t strip, void *buf, tmsize_t size)
Read decoded samples from one strip.
Definition tif_read.c:708
tmsize_t TIFFReadTile(TIFF *tif, void *buf, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
Decode the tile containing image coordinates.
Definition tif_read.c:1265
tmsize_t TIFFReadEncodedTile(TIFF *tif, uint32_t tile, void *buf, tmsize_t size)
Read decoded samples from one tile.
Definition tif_read.c:1284
tmsize_t TIFFWriteRawTile(TIFF *tif, uint32_t tile, void *data, tmsize_t cc)
Write raw stored bytes to one tile.
Definition tif_write.c:692
tmsize_t TIFFWriteRawStrip(TIFF *tif, uint32_t strip, void *data, tmsize_t cc)
Write raw stored bytes to one strip.
Definition tif_write.c:458
void TIFFSetWriteOffset(TIFF *tif, toff_t off)
Change the cached next payload write offset.
Definition tif_write.c:1244
int TIFFWriteScanline(TIFF *tif, void *buf, uint32_t row, uint16_t sample)
Encode and buffer one image scanline.
Definition tif_write.c:99
tmsize_t TIFFWriteEncodedTile(TIFF *tif, uint32_t tile, void *data, tmsize_t cc)
Write encoded samples to one tile.
Definition tif_write.c:565
tmsize_t TIFFWriteTile(TIFF *tif, void *buf, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
Encode the tile containing image coordinates.
Definition tif_write.c:532
tmsize_t TIFFWriteEncodedStrip(TIFF *tif, uint32_t strip, void *data, tmsize_t cc)
Write encoded samples to one strip.
Definition tif_write.c:331
toff_t(* TIFFSeekProc)(thandle_t fd, toff_t off, int whence)
Change the current position of a client I/O resource.
Definition tiffio.h:933
int(* TIFFCloseProc)(thandle_t fd)
Release a client I/O resource or its adapter context.
Definition tiffio.h:951
void(* TIFFUnmapFileProc)(thandle_t fd, void *base, toff_t size)
Release a whole-file view supplied by a mapping callback.
Definition tiffio.h:1008
toff_t(* TIFFSizeProc)(thandle_t fd)
Query the byte length of a client I/O resource.
Definition tiffio.h:968
tmsize_t(* TIFFReadWriteProc)(thandle_t fd, void *buf, tmsize_t size)
Transfer bytes at the current position of a client I/O resource.
Definition tiffio.h:911
int(* TIFFMapFileProc)(thandle_t fd, void **base, toff_t *size)
Provide a readable whole-file view of a client resource.
Definition tiffio.h:989
int TIFFGetMode(TIFF *tif)
Return the stored library access mode.
Definition tif_open.c:880
int TIFFFileno(TIFF *tif)
Return the handle's file-descriptor metadata.
Definition tif_open.c:850
TIFF * TIFFClientOpenExt(const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc, TIFFOpenOptions *opts)
Initialise a TIFF handle using client-supplied I/O callbacks.
Definition tif_open.c:326
TIFF * TIFFClientOpen(const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
Initialise a TIFF handle using client-supplied I/O callbacks.
Definition tif_open.c:315
TIFFReadWriteProc TIFFGetReadProc(TIFF *tif)
Return the installed client read callback.
Definition tif_open.c:949
int TIFFSetFileno(TIFF *tif, int fd)
Replace descriptor metadata without changing client I/O routing.
Definition tif_open.c:855
TIFF * TIFFOpenExt(const char *name, const char *mode, TIFFOpenOptions *opts)
Open a TIFF file by pathname.
Definition tif_unix.c:379
TIFFCloseProc TIFFGetCloseProc(TIFF *tif)
Return the installed client close callback.
Definition tif_open.c:964
const char * TIFFFileName(TIFF *tif)
Return the handle's diagnostic filename.
Definition tif_open.c:835
TIFF * TIFFFdOpenExt(int fd, const char *name, const char *mode, TIFFOpenOptions *opts)
Attach a TIFF handle to an already-open platform resource.
Definition tif_unix.c:356
TIFFSizeProc TIFFGetSizeProc(TIFF *tif)
Return the installed client file-size callback.
Definition tif_open.c:969
TIFF * TIFFOpen(const char *name, const char *mode)
Open a TIFF file by pathname.
Definition tif_unix.c:374
int TIFFSetMode(TIFF *tif, int mode)
Replace the stored library access mode without reopening the resource.
Definition tif_open.c:885
int TIFFFlushData(TIFF *tif)
Flush pending encoded image data without committing directory changes.
Definition tif_flush.c:151
int TIFFIsMSB2LSB(TIFF *tif)
Test the selected data bit-fill-order flag.
Definition tif_open.c:931
void TIFFClose(TIFF *tif)
Release a TIFF handle and invoke its client close callback.
Definition tif_close.c:145
int TIFFIsByteSwapped(TIFF *tif)
Test whether file values require byte swapping for this host.
Definition tif_open.c:921
TIFFMapFileProc TIFFGetMapFileProc(TIFF *tif)
Return the installed client mapping callback.
Definition tif_open.c:974
int TIFFFlush(TIFF *tif)
Flush pending image data and dirty directory information.
Definition tif_flush.c:35
TIFF * TIFFOpenW(const wchar_t *name, const char *mode)
Open a TIFF file using a wide Windows pathname.
Definition tif_win32.c:458
int TIFFIsTiled(TIFF *tif)
Test whether the current image uses tiles.
Definition tif_open.c:896
const char * TIFFSetFileName(TIFF *tif, const char *name)
Replace the diagnostic filename pointer without copying it.
Definition tif_open.c:840
TIFF * TIFFFdOpen(int fd, const char *name, const char *mode)
Attach a TIFF handle to an already-open platform resource.
Definition tif_unix.c:351
void TIFFCleanup(TIFF *tif)
Release library state without invoking the client close callback.
Definition tif_close.c:40
TIFFSeekProc TIFFGetSeekProc(TIFF *tif)
Return the installed client seek callback.
Definition tif_open.c:959
int TIFFIsBigTIFF(TIFF *tif)
Test whether the handle uses the BigTIFF format.
Definition tif_open.c:944
thandle_t TIFFSetClientdata(TIFF *tif, thandle_t newvalue)
Replace the context passed to all client I/O callbacks.
Definition tif_open.c:870
TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF *tif)
Return the installed client unmapping callback.
Definition tif_open.c:979
int TIFFIsBigEndian(TIFF *tif)
Test whether the stored file signature is TIFF_BIGENDIAN.
Definition tif_open.c:936
int TIFFIsUpSampled(TIFF *tif)
Test whether the active codec supplies upsampled data.
Definition tif_open.c:926
TIFFReadWriteProc TIFFGetWriteProc(TIFF *tif)
Return the installed client write callback.
Definition tif_open.c:954
thandle_t TIFFClientdata(TIFF *tif)
Return the context passed to client I/O callbacks.
Definition tif_open.c:865
TIFF * TIFFOpenWExt(const wchar_t *name, const char *mode, TIFFOpenOptions *opts)
Open a TIFF file using a wide Windows pathname.
Definition tif_win32.c:497
int LogL10fromY(double Y, int em)
Encode linear luminance as a 10-bit logarithmic value.
Definition tif_luv.c:1567
int uv_decode(double *up, double *vp, int c)
Decode a quantised chromaticity index to a bin-centre pair.
Definition tif_luv.c:1686
void LogLuv32toXYZ(uint32_t p, float *XYZ)
Decode one packed 32-bit LogLuv pixel to linear XYZ.
Definition tif_luv.c:1970
double LogL10toY(int p10)
Decode 10-bit logarithmic luminance to a linear value.
Definition tif_luv.c:1557
int LogL16fromY(double Y, int em)
Encode linear luminance as a 16-bit logarithmic value.
Definition tif_luv.c:1213
void XYZtoRGB24(float *xyz, uint8_t *rgb)
Convert a linear XYZ triplet to display RGB bytes.
Definition tif_luv.c:1537
void LogLuv24toXYZ(uint32_t p, float *XYZ)
Decode one packed 24-bit LogLuv pixel to linear XYZ.
Definition tif_luv.c:1720
uint32_t LogLuv32fromXYZ(float *XYZ, int em)
Encode linear XYZ as one packed 32-bit LogLuv pixel.
Definition tif_luv.c:1995
uint32_t LogLuv24fromXYZ(float *XYZ, int em)
Encode linear XYZ as one packed 24-bit LogLuv pixel.
Definition tif_luv.c:1750
double LogL16toY(int p16)
Decode 16-bit logarithmic luminance to a linear value.
Definition tif_luv.c:1199
int uv_encode(double u, double v, int em)
Encode chromaticity using the irregular LogLuv quantisation table.
Definition tif_luv.c:1655
void _TIFFfree(void *p)
Release a block allocated by the public allocation family.
Definition tif_unix.c:491
void * _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
Allocate a zero-filled array through the public allocator.
Definition tif_unix.c:483
void _TIFFmemset(void *p, int v, tmsize_t c)
Fill a byte range with one repeated byte.
Definition tif_unix.c:495
void * _TIFFmalloc(tmsize_t s)
Allocate an uninitialised block through the public allocator.
Definition tif_unix.c:475
int _TIFFmemcmp(const void *p1, const void *p2, tmsize_t c)
Compare two byte ranges lexicographically.
Definition tif_unix.c:502
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
Copy a non-overlapping byte range.
Definition tif_unix.c:497
void * _TIFFrealloc(void *p, tmsize_t s)
Resize a public-allocator block using platform realloc semantics.
Definition tif_unix.c:493
void TIFFOpenOptionsSetWarningHandlerExtR(TIFFOpenOptions *opts, TIFFErrorHandlerExtR handler, void *warnhandler_user_data)
Set the per-handle warning callback for subsequent opens.
Definition tif_open.c:120
void TIFFOpenOptionsSetErrorHandlerExtR(TIFFOpenOptions *opts, TIFFErrorHandlerExtR handler, void *errorhandler_user_data)
Set the per-handle error callback for subsequent opens.
Definition tif_open.c:112
void TIFFOpenOptionsSetMaxCumulatedMemAlloc(TIFFOpenOptions *opts, tmsize_t max_cumulated_mem_alloc)
Set the cumulative checked allocation limit for subsequent opens.
Definition tif_open.c:100
void TIFFOpenOptionsSetWarnAboutUnknownTags(TIFFOpenOptions *opts, int warn_about_unknown_tags)
Select whether subsequent opens warn about unknown tags.
Definition tif_open.c:106
int(* TIFFErrorHandlerExtR)(TIFF *tif, void *user_data, const char *module, const char *fmt, va_list ap)
Handle a diagnostic using a per-handle borrowed context.
Definition tiffio.h:884
TIFFOpenOptions * TIFFOpenOptionsAlloc(void)
Allocate default options for opening a TIFF handle.
Definition tif_open.c:85
void TIFFOpenOptionsSetMaxSingleMemAlloc(TIFFOpenOptions *opts, tmsize_t max_single_mem_alloc)
Set the single checked allocation limit for subsequent opens.
Definition tif_open.c:94
void TIFFOpenOptionsFree(TIFFOpenOptions *opts)
Release an open-options object.
Definition tif_open.c:92
#define SGILOGENCODE_NODITHER
Do not dither encoded values.
Definition tiff.h:1629
void(* tileSeparateRoutine)(TIFFRGBAImage *img, uint32_t *cp, uint32_t x, uint32_t y, uint32_t w, uint32_t h, int32_t fromskew, int32_t toskew, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a)
Convert a decoded separate-plane region through a caller-selectable packer.
Definition tiffio.h:496
void(* tileContigRoutine)(TIFFRGBAImage *img, uint32_t *cp, uint32_t x, uint32_t y, uint32_t w, uint32_t h, int32_t fromskew, int32_t toskew, unsigned char *pp)
Convert a decoded contiguous region through a caller-selectable packer.
Definition tiffio.h:453
int TIFFReadRGBAImage(TIFF *tif, uint32_t rwidth, uint32_t rheight, uint32_t *raster, int stop)
Read the current image into a packed RGBA raster.
int TIFFReadRGBAStrip(TIFF *tif, uint32_t row, uint32_t *raster)
Read and convert one whole strip to packed RGBA.
int TIFFReadRGBATile(TIFF *tif, uint32_t col, uint32_t row, uint32_t *raster)
Read and convert one whole tile to packed RGBA.
int TIFFRGBAImageBegin(TIFFRGBAImage *img, TIFF *tif, int stop, char emsg[1024])
Initialise an RGBA reader and select conversion methods.
void TIFFRGBAImageEnd(TIFFRGBAImage *img)
Release RGBA conversion tables and copied colormaps.
int TIFFReadRGBAStripExt(TIFF *tif, uint32_t row, uint32_t *raster, int stop_on_error)
Read and convert one whole strip to packed RGBA.
int TIFFReadRGBATileExt(TIFF *tif, uint32_t col, uint32_t row, uint32_t *raster, int stop_on_error)
Read and convert one whole tile to packed RGBA.
int TIFFRGBAImageOK(TIFF *tif, char emsg[1024])
Check preliminary RGBA compatibility of the current directory.
int TIFFReadRGBAImageOriented(TIFF *tif, uint32_t rwidth, uint32_t rheight, uint32_t *raster, int orientation, int stop)
Read the current image into a packed RGBA raster.
int TIFFRGBAImageGet(TIFFRGBAImage *img, uint32_t *raster, uint32_t rwidth, uint32_t rheight)
Read and convert a selected image area through installed callbacks.
uint64_t TIFFGetStrileOffset(TIFF *tif, uint32_t strile)
Query one logical strile file offset.
uint64_t TIFFGetStrileOffsetWithErr(TIFF *tif, uint32_t strile, int *pbErr)
Query one logical strile file offset.
uint64_t TIFFGetStrileByteCount(TIFF *tif, uint32_t strile)
Query one logical strile byte count.
uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile, int *pbErr)
Query one logical strile byte count.
int TIFFVGetFieldDefaulted(TIFF *tif, uint32_t tag, va_list ap)
Query a present tag or a supported default.
Definition tif_aux.c:422
int(* TIFFVGetMethod)(TIFF *tif, uint32_t tag, va_list ap)
Implement a handle's variadic tag getter.
Definition tiffio.h:1540
int TIFFUnsetField(TIFF *tif, uint32_t tag)
Clear tag presence or remove a stored custom value.
Definition tif_dir.c:1641
int TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
Query a present tag in the current directory.
Definition tif_dir.c:2116
int TIFFSetField(TIFF *tif, uint32_t tag,...)
Set a tag value in the current in-memory directory.
Definition tif_dir.c:1627
void(* TIFFPrintMethod)(TIFF *tif, FILE *fd, long flags)
Append extension-specific directory information to a stream.
Definition tiffio.h:1561
int TIFFGetFieldDefaulted(TIFF *tif, uint32_t tag,...)
Query a present tag or a supported default.
Definition tif_aux.c:591
int(* TIFFVSetMethod)(TIFF *tif, uint32_t tag, va_list ap)
Implement a handle's variadic tag setter.
Definition tiffio.h:1521
int TIFFGetField(TIFF *tif, uint32_t tag,...)
Query a present tag in the current directory.
Definition tif_dir.c:2099
int TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
Set a tag value in the current in-memory directory.
Definition tif_dir.c:1686
#define ORIENTATION_BOTLEFT
Row 0 bottom, col 0 lhs.
Definition tiff.h:446
tstrile_t tstrip_t
Represent a legacy strip index.
Definition tiffio.h:111
TIFF_SSIZE_T tmsize_t
Represent a signed memory or I/O size in bytes.
Definition tiffio.h:89
tstrile_t ttile_t
Represent a legacy tile index.
Definition tiffio.h:114
uint32_t tstrile_t
Represent a legacy strip or tile index.
Definition tiffio.h:108
TIFFDataType
Identify the on-disk representation of a TIFF directory field.
Definition tiff.h:229
void * tdata_t
Represent a legacy untyped image-data pointer.
Definition tiffio.h:120
uint16_t tsample_t
Represent a legacy sample index.
Definition tiffio.h:105
uint64_t toff_t
Represent an unsigned file byte offset independently of off_t.
Definition tiffio.h:94
uint32_t tdir_t
Represent a zero-based directory index, rather than a file offset.
Definition tiffio.h:96
uint32_t ttag_t
Represent a legacy directory tag identifier.
Definition tiffio.h:102
tmsize_t tsize_t
Represent a legacy signed I/O byte count.
Definition tiffio.h:117
void * thandle_t
Carry an opaque client I/O context through library callbacks.
Definition tiffio.h:161
const char * TIFFGetVersion(void)
Return the version and copyright banner of the loaded library.
Definition tif_version.c:41
Hold CIE L*a*b*-to-RGB conversion parameters and tables.
Definition tiffio.h:361
int range
Largest table index; initialised to CIELABTORGB_TABLE_RANGE.
Definition tiffio.h:363
float bstep
Blue luminance increment per lookup-table interval. Currently initialised from the red-channel d_YCR/...
Definition tiffio.h:384
float X0
Reference-white X coordinate.
Definition tiffio.h:386
float Z0
Reference-white Z coordinate.
Definition tiffio.h:390
TIFFDisplay display
Inline copy of the display description.
Definition tiffio.h:392
float rstep
Red luminance increment per lookup-table interval.
Definition tiffio.h:372
float gstep
Green luminance increment per lookup-table interval. Currently initialised from the red-channel d_YCR...
Definition tiffio.h:378
float Y0
Reference-white Y coordinate.
Definition tiffio.h:388
Describe a named compression scheme and its initialiser.
Definition tiffio.h:706
const char * name
Codec name; storage lifetime follows the API supplying this descriptor.
Definition tiffio.h:711
TIFFInitMethod init
Callback that installs the codec on a TIFF handle.
Definition tiffio.h:715
uint16_t scheme
Compression identifier, such as COMPRESSION_LZW.
Definition tiffio.h:713
Describe the matrix, luminance, and gamma of an RGB display.
Definition tiffio.h:287
float d_gammaG
Green-channel gamma.
Definition tiffio.h:311
float d_YCB
Blue-channel reference-white luminance.
Definition tiffio.h:295
uint32_t d_Vrwr
Red-channel code value at reference white.
Definition tiffio.h:297
float d_Y0R
Red-channel residual luminance at black.
Definition tiffio.h:303
float d_gammaR
Red-channel gamma.
Definition tiffio.h:309
float d_YCG
Green-channel reference-white luminance.
Definition tiffio.h:293
float d_YCR
Red-channel reference-white luminance.
Definition tiffio.h:291
float d_Y0G
Green-channel residual luminance at black.
Definition tiffio.h:305
float d_Y0B
Blue-channel residual luminance at black.
Definition tiffio.h:307
uint32_t d_Vrwg
Green-channel code value at reference white.
Definition tiffio.h:299
float d_gammaB
Blue-channel gamma.
Definition tiffio.h:313
uint32_t d_Vrwb
Blue-channel code value at reference white.
Definition tiffio.h:301
Describe a tag using the legacy field-registration interface.
Definition tiffio.h:5531
uint32_t field_tag
Numeric tag identifier.
Definition tiffio.h:5533
const char * field_name
Borrowed null-terminated tag name; keep valid while registered.
Definition tiffio.h:5558
unsigned char field_passcount
Nonzero if a count argument accompanies the value in field access calls.
Definition tiffio.h:5553
short field_readcount
Expected read count, or a TIFF_VARIABLE, TIFF_VARIABLE2, or TIFF_SPP marker.
Definition tiffio.h:5538
unsigned char field_oktochange
Nonzero if the field may change after writing has begun.
Definition tiffio.h:5548
TIFFDataType field_type
On-disk TIFFDataType.
Definition tiffio.h:5544
unsigned short field_bit
Field-presence bit; use FIELD_CUSTOM for custom fields.
Definition tiffio.h:5546
short field_writecount
Expected write count, or a variable/per-sample count marker.
Definition tiffio.h:5542
Hold allocation limits and diagnostics used when opening a TIFF handle.
Definition tiffiop.h:791
Represent an unsigned TIFF rational as numerator and denominator.
Definition tiffio.h:726
uint32_t uDenom
Unsigned 32-bit denominator; the representation itself performs no validation.
Definition tiffio.h:733
uint32_t uNum
Unsigned 32-bit numerator.
Definition tiffio.h:728
Collect a handle's tag-access and directory-print callbacks.
Definition tiffio.h:1573
TIFFVGetMethod vgetfield
Variadic tag-query implementation for the handle.
Definition tiffio.h:1577
TIFFVSetMethod vsetfield
Variadic tag-setting implementation for the handle.
Definition tiffio.h:1575
TIFFPrintMethod printdir
Optional codec/extension directory-print callback.
Definition tiffio.h:1579
Hold lookup-table pointers for 8-bit YCbCr-to-RGB conversion.
Definition tiffio.h:334
int * Cr_r_tab
256-entry table of Cr contributions to red.
Definition tiffio.h:341
int32_t * Cb_g_tab
256-entry fixed-point table of Cb contributions to green.
Definition tiffio.h:347
int32_t * Y_tab
256-entry table of scaled luminance contributions.
Definition tiffio.h:349
TIFFRGBValue * clamptab
Biased table pointer for clamping channel results to 0 through 255.
Definition tiffio.h:339
int * Cb_b_tab
256-entry table of Cb contributions to blue.
Definition tiffio.h:343
int32_t * Cr_g_tab
256-entry fixed-point table of Cr contributions to green.
Definition tiffio.h:345
Describe a borrowed schema or owned compatibility batch.
Definition tif_dir.h:962
TIFFFieldArrayType type
Namespace/category of the schema.
Definition tif_dir.h:964
Describe a field's file type and internal argument contract.
Definition tif_dir.h:993
Hold the state and selected callbacks for an RGBA image reader.
Definition tiffio.h:517
uint32_t ** PALmap
Reader-owned palette expansion tables, or NULL.
Definition tiffio.h:599
int col_offset
Nonnegative starting source column, measured in pixels.
Definition tiffio.h:616
uint16_t req_orientation
Requested output raster orientation.
Definition tiffio.h:541
uint16_t * bluecmap
Reader-owned blue palette copy, or NULL.
Definition tiffio.h:549
uint16_t photometric
Source PhotometricInterpretation tag value.
Definition tiffio.h:543
TIFF * tif
Borrowed TIFF handle; must outlive this reader state.
Definition tiffio.h:519
tileContigRoutine contig
Put callback for contiguous source samples.
Definition tiffio.h:589
uint16_t * greencmap
Reader-owned green palette copy, or NULL.
Definition tiffio.h:547
uint16_t samplesperpixel
Source samples per pixel.
Definition tiffio.h:537
uint8_t * UaToAa
Reader-owned unassociated-to-associated alpha lookup table, or NULL.
Definition tiffio.h:609
union _TIFFRGBAImage::@3 put
Select the RGBA packer signature matching the image organisation.
TIFFCIELabToRGB * cielab
Reader-owned CIE L*a*b* conversion state, or NULL.
Definition tiffio.h:603
uint16_t bitspersample
Source bits per sample.
Definition tiffio.h:535
int alpha
ExtraSamples alpha interpretation, or zero when none is selected.
Definition tiffio.h:529
uint32_t height
Source image height in pixels.
Definition tiffio.h:533
uint16_t orientation
Source Orientation tag value.
Definition tiffio.h:539
uint16_t * redcmap
Reader-owned red palette copy, or NULL.
Definition tiffio.h:545
uint32_t width
Source image width in pixels.
Definition tiffio.h:531
void(* any)(TIFFRGBAImage *img)
Reserve a generic storage view of the selected packer.
Definition tiffio.h:587
uint8_t * Bitdepth16To8
Reader-owned 16-bit-to-8-bit sample lookup table, or NULL.
Definition tiffio.h:611
uint32_t ** BWmap
Reader-owned black/white expansion tables, or NULL.
Definition tiffio.h:597
TIFFRGBValue * Map
Reader-owned sample mapping table, or NULL.
Definition tiffio.h:595
int isContig
Nonzero for contiguous samples; zero for separate sample planes.
Definition tiffio.h:525
int row_offset
Nonnegative starting source row, measured in pixels.
Definition tiffio.h:614
TIFFYCbCrToRGB * ycbcr
Reader-owned YCbCr conversion block, or NULL.
Definition tiffio.h:601
int stoponerr
Nonzero to stop reading when an error is encountered.
Definition tiffio.h:521
int(* get)(TIFFRGBAImage *img, uint32_t *raster, uint32_t rwidth, uint32_t rheight)
Read and pack a raster through the selected RGBA state.
Definition tiffio.h:570
tileSeparateRoutine separate
Put callback for separate source planes.
Definition tiffio.h:591
Hold private state for one open TIFF library instance.
Definition tiffiop.h:389
Define TIFF file-format types, tag identifiers, and constant values.
Identify the LibTIFF headers used when compiling an application.