1 /* $Id: tiffio.h,v 1.50 2006/03/21 16:37:51 dron Exp $ */
2 
3 /*
4  * Copyright (c) 1988-1997 Sam Leffler
5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
6  *
7  * Permission to use, copy, modify, distribute, and sell this software and
8  * its documentation for any purpose is hereby granted without fee, provided
9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  *
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24  * OF THIS SOFTWARE.
25  */
26 
27 #ifndef _TIFFIO_
28 #define	_TIFFIO_
29 
30 #ifndef __GNUC__
31 # define __DLL_IMPORT__  __declspec(dllimport)
32 # define __DLL_EXPORT__  __declspec(dllexport)
33 #else
34 # define __DLL_IMPORT__  __attribute__((dllimport)) extern
35 # define __DLL_EXPORT__  __attribute__((dllexport)) extern
36 #endif
37 
38 #if (defined __WIN32__) || (defined _WIN32)
39 # ifdef BUILD_LIBTIFF_DLL
40 #  define LIBTIFF_DLL_IMPEXP     __DLL_EXPORT__
41 # elif defined(LIBTIFF_STATIC)
42 #  define LIBTIFF_DLL_IMPEXP
43 # elif defined (USE_LIBTIFF_DLL)
44 #  define LIBTIFF_DLL_IMPEXP     __DLL_IMPORT__
45 # elif defined (USE_LIBTIFF_STATIC)
46 #  define LIBTIFF_DLL_IMPEXP
47 # else /* assume USE_LIBTIFF_DLL */
48 #  define LIBTIFF_DLL_IMPEXP     __DLL_IMPORT__
49 # endif
50 #else /* __WIN32__ */
51 # define LIBTIFF_DLL_IMPEXP
52 #endif
53 
54 /*
55  * TIFF I/O Library Definitions.
56  */
57 #include "tiff.h"
58 #include "tiffvers.h"
59 
60 /*
61  * TIFF is defined as an incomplete type to hide the
62  * library's internal data structures from clients.
63  */
64 typedef	struct tiff TIFF;
65 
66 /*
67  * The following typedefs define the intrinsic size of
68  * data types used in the *exported* interfaces.  These
69  * definitions depend on the proper definition of types
70  * in tiff.h.  Note also that the varargs interface used
71  * to pass tag types and values uses the types defined in
72  * tiff.h directly.
73  *
74  * NB: ttag_t is unsigned int and not unsigned short because
75  *     ANSI C requires that the type before the ellipsis be a
76  *     promoted type (i.e. one of int, unsigned int, pointer,
77  *     or double) and because we defined pseudo-tags that are
78  *     outside the range of legal Aldus-assigned tags.
79  * NB: tsize_t is int32 and not uint32 because some functions
80  *     return -1.
81  * NB: toff_t is not off_t for many reasons; TIFFs max out at
82  *     32-bit file offsets being the most important, and to ensure
83  *     that it is unsigned, rather than signed.
84  */
85 typedef	uint32 ttag_t;		/* directory tag */
86 typedef	uint16 tdir_t;		/* directory index */
87 typedef	uint16 tsample_t;	/* sample number */
88 typedef	uint32 tstrip_t;	/* strip number */
89 typedef uint32 ttile_t;		/* tile number */
90 typedef	int32 tsize_t;		/* i/o size in bytes */
91 typedef	void* tdata_t;		/* image data ref */
92 typedef	uint32 toff_t;		/* file offset */
93 
94 #if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
95 #define __WIN32__
96 #endif
97 
98 /*
99  * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
100  * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
101  *
102  * By default tif_unix.c is assumed.
103  */
104 
105 #if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
106 #  define BINMODE "b"
107 #  if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)
108 #    define AVOID_WIN32_FILEIO
109 #  endif
110 #  include <fcntl.h>
111 #  include <io.h>
112 #  ifdef SET_BINARY
113 #    undef SET_BINARY
114 #  endif /* SET_BINARY */
115 #  define SET_BINARY(f) do {if (!_isatty(f)) _setmode(f,_O_BINARY);} while (0)
116 #else /* Windows */
117 #  define BINMODE
118 #  define SET_BINARY(f) (void)0
119 #endif /* Windows */
120 
121 #if defined(USE_WIN32_FILEIO)
122 # define VC_EXTRALEAN
123 # include <windows.h>
124 # ifdef __WIN32__
125 DECLARE_HANDLE(thandle_t);	/* Win32 file handle */
126 # else
127 typedef	HFILE thandle_t;	/* client data handle */
128 # endif /* __WIN32__ */
129 #else
130 typedef	void* thandle_t;	/* client data handle */
131 #endif /* USE_WIN32_FILEIO */
132 
133 #ifndef NULL
134 # define NULL	(void *)0
135 #endif
136 
137 /*
138  * Flags to pass to TIFFPrintDirectory to control
139  * printing of data structures that are potentially
140  * very large.   Bit-or these flags to enable printing
141  * multiple items.
142  */
143 #define	TIFFPRINT_NONE		0x0		/* no extra info */
144 #define	TIFFPRINT_STRIPS	0x1		/* strips/tiles info */
145 #define	TIFFPRINT_CURVES	0x2		/* color/gray response curves */
146 #define	TIFFPRINT_COLORMAP	0x4		/* colormap */
147 #define	TIFFPRINT_JPEGQTABLES	0x100		/* JPEG Q matrices */
148 #define	TIFFPRINT_JPEGACTABLES	0x200		/* JPEG AC tables */
149 #define	TIFFPRINT_JPEGDCTABLES	0x200		/* JPEG DC tables */
150 
151 /*
152  * Colour conversion stuff
153  */
154 
155 /* reference white */
156 #define D65_X0 (95.0470F)
157 #define D65_Y0 (100.0F)
158 #define D65_Z0 (108.8827F)
159 
160 #define D50_X0 (96.4250F)
161 #define D50_Y0 (100.0F)
162 #define D50_Z0 (82.4680F)
163 
164 /* Structure for holding information about a display device. */
165 
166 typedef	unsigned char TIFFRGBValue;		/* 8-bit samples */
167 
168 typedef struct {
169 	float d_mat[3][3]; 		/* XYZ -> luminance matrix */
170 	float d_YCR;			/* Light o/p for reference white */
171 	float d_YCG;
172 	float d_YCB;
173 	uint32 d_Vrwr;			/* Pixel values for ref. white */
174 	uint32 d_Vrwg;
175 	uint32 d_Vrwb;
176 	float d_Y0R;			/* Residual light for black pixel */
177 	float d_Y0G;
178 	float d_Y0B;
179 	float d_gammaR;			/* Gamma values for the three guns */
180 	float d_gammaG;
181 	float d_gammaB;
182 } TIFFDisplay;
183 
184 typedef struct {				/* YCbCr->RGB support */
185 	TIFFRGBValue* clamptab;			/* range clamping table */
186 	int*	Cr_r_tab;
187 	int*	Cb_b_tab;
188 	int32*	Cr_g_tab;
189 	int32*	Cb_g_tab;
190         int32*  Y_tab;
191 } TIFFYCbCrToRGB;
192 
193 typedef struct {				/* CIE Lab 1976->RGB support */
194 	int	range;				/* Size of conversion table */
195 #define CIELABTORGB_TABLE_RANGE 1500
196 	float	rstep, gstep, bstep;
197 	float	X0, Y0, Z0;			/* Reference white point */
198 	TIFFDisplay display;
199 	float	Yr2r[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yr to r */
200 	float	Yg2g[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yg to g */
201 	float	Yb2b[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yb to b */
202 } TIFFCIELabToRGB;
203 
204 /*
205  * RGBA-style image support.
206  */
207 typedef struct _TIFFRGBAImage TIFFRGBAImage;
208 /*
209  * The image reading and conversion routines invoke
210  * ``put routines'' to copy/image/whatever tiles of
211  * raw image data.  A default set of routines are
212  * provided to convert/copy raw image data to 8-bit
213  * packed ABGR format rasters.  Applications can supply
214  * alternate routines that unpack the data into a
215  * different format or, for example, unpack the data
216  * and draw the unpacked raster on the display.
217  */
218 typedef void (*tileContigRoutine)
219     (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
220 	unsigned char*);
221 typedef void (*tileSeparateRoutine)
222     (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
223 	unsigned char*, unsigned char*, unsigned char*, unsigned char*);
224 /*
225  * RGBA-reader state.
226  */
227 struct _TIFFRGBAImage {
228 	TIFF*	tif;				/* image handle */
229 	int	stoponerr;			/* stop on read error */
230 	int	isContig;			/* data is packed/separate */
231 	int	alpha;				/* type of alpha data present */
232 	uint32	width;				/* image width */
233 	uint32	height;				/* image height */
234 	uint16	bitspersample;			/* image bits/sample */
235 	uint16	samplesperpixel;		/* image samples/pixel */
236 	uint16	orientation;			/* image orientation */
237 	uint16	req_orientation;		/* requested orientation */
238 	uint16	photometric;			/* image photometric interp */
239 	uint16*	redcmap;			/* colormap pallete */
240 	uint16*	greencmap;
241 	uint16*	bluecmap;
242 						/* get image data routine */
243 	int	(*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
244 	union {
245 	    void (*any)(TIFFRGBAImage*);
246 	    tileContigRoutine	contig;
247 	    tileSeparateRoutine	separate;
248 	} put;					/* put decoded strip/tile */
249 	TIFFRGBValue* Map;			/* sample mapping array */
250 	uint32** BWmap;				/* black&white map */
251 	uint32** PALmap;			/* palette image map */
252 	TIFFYCbCrToRGB* ycbcr;			/* YCbCr conversion state */
253         TIFFCIELabToRGB* cielab;		/* CIE L*a*b conversion state */
254 
255         int	row_offset;
256         int     col_offset;
257 };
258 
259 /*
260  * Macros for extracting components from the
261  * packed ABGR form returned by TIFFReadRGBAImage.
262  */
263 #define	TIFFGetR(abgr)	((abgr) & 0xff)
264 #define	TIFFGetG(abgr)	(((abgr) >> 8) & 0xff)
265 #define	TIFFGetB(abgr)	(((abgr) >> 16) & 0xff)
266 #define	TIFFGetA(abgr)	(((abgr) >> 24) & 0xff)
267 
268 /*
269  * A CODEC is a software package that implements decoding,
270  * encoding, or decoding+encoding of a compression algorithm.
271  * The library provides a collection of builtin codecs.
272  * More codecs may be registered through calls to the library
273  * and/or the builtin implementations may be overridden.
274  */
275 typedef	int (*TIFFInitMethod)(TIFF*, int);
276 typedef struct {
277 	char*		name;
278 	uint16		scheme;
279 	TIFFInitMethod	init;
280 } TIFFCodec;
281 
282 #include <stdio.h>
283 #include <stdarg.h>
284 
285 /* share internal LogLuv conversion routines? */
286 #ifndef LOGLUV_PUBLIC
287 #define LOGLUV_PUBLIC		1
288 #endif
289 
290 #if defined(c_plusplus) || defined(__cplusplus)
291 extern "C" {
292 #endif
293 typedef	void (*TIFFErrorHandler)(const char*, const char*, va_list);
294 typedef	void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);
295 typedef	tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);
296 typedef	toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
297 typedef	int (*TIFFCloseProc)(thandle_t);
298 typedef	toff_t (*TIFFSizeProc)(thandle_t);
299 typedef	int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
300 typedef	void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);
301 typedef	void (*TIFFExtendProc)(TIFF*);
302 
303 LIBTIFF_DLL_IMPEXP	const char* TIFFGetVersion(void);
304 
305 LIBTIFF_DLL_IMPEXP	const TIFFCodec* TIFFFindCODEC(uint16);
306 LIBTIFF_DLL_IMPEXP	TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
307 LIBTIFF_DLL_IMPEXP	void TIFFUnRegisterCODEC(TIFFCodec*);
308 LIBTIFF_DLL_IMPEXP  int TIFFIsCODECConfigured(uint16);
309 LIBTIFF_DLL_IMPEXP	TIFFCodec* TIFFGetConfiguredCODECs(void);
310 
311 /*
312  * Auxiliary functions.
313  */
314 
315 LIBTIFF_DLL_IMPEXP	tdata_t _TIFFmalloc(tsize_t);
316 LIBTIFF_DLL_IMPEXP	tdata_t _TIFFrealloc(tdata_t, tsize_t);
317 LIBTIFF_DLL_IMPEXP	void _TIFFmemset(tdata_t, int, tsize_t);
318 LIBTIFF_DLL_IMPEXP	void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
319 LIBTIFF_DLL_IMPEXP	int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
320 LIBTIFF_DLL_IMPEXP	void _TIFFfree(tdata_t);
321 
322 /*
323 ** Stuff, related to tag handling and creating custom tags.
324 */
325 LIBTIFF_DLL_IMPEXP  int  TIFFGetTagListCount( TIFF * );
326 LIBTIFF_DLL_IMPEXP  ttag_t TIFFGetTagListEntry( TIFF *, int tag_index );
327 
328 #define	TIFF_ANY	TIFF_NOTYPE	/* for field descriptor searching */
329 #define	TIFF_VARIABLE	-1		/* marker for variable length tags */
330 #define	TIFF_SPP	-2		/* marker for SamplesPerPixel tags */
331 #define	TIFF_VARIABLE2	-3		/* marker for uint32 var-length tags */
332 
333 #define FIELD_CUSTOM    65
334 
335 typedef	struct {
336 	ttag_t	field_tag;		/* field's tag */
337 	short	field_readcount;	/* read count/TIFF_VARIABLE/TIFF_SPP */
338 	short	field_writecount;	/* write count/TIFF_VARIABLE */
339 	TIFFDataType field_type;	/* type of associated data */
340         unsigned short field_bit;	/* bit in fieldsset bit vector */
341 	unsigned char field_oktochange;	/* if true, can change while writing */
342 	unsigned char field_passcount;	/* if true, pass dir count on set */
343 	char	*field_name;		/* ASCII name */
344 } TIFFFieldInfo;
345 
346 typedef struct _TIFFTagValue {
347     const TIFFFieldInfo  *info;
348     int             count;
349     void           *value;
350 } TIFFTagValue;
351 
352 LIBTIFF_DLL_IMPEXP	void TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int);
353 LIBTIFF_DLL_IMPEXP	const TIFFFieldInfo* TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType);
354 LIBTIFF_DLL_IMPEXP  const TIFFFieldInfo* TIFFFindFieldInfoByName(TIFF* , const char *,
355 						     TIFFDataType);
356 LIBTIFF_DLL_IMPEXP	const TIFFFieldInfo* TIFFFieldWithTag(TIFF*, ttag_t);
357 LIBTIFF_DLL_IMPEXP	const TIFFFieldInfo* TIFFFieldWithName(TIFF*, const char *);
358 
359 typedef	int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
360 typedef	int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
361 typedef	void (*TIFFPrintMethod)(TIFF*, FILE*, long);
362 
363 typedef struct {
364     TIFFVSetMethod	vsetfield;	/* tag set routine */
365     TIFFVGetMethod	vgetfield;	/* tag get routine */
366     TIFFPrintMethod	printdir;	/* directory print routine */
367 } TIFFTagMethods;
368 
369 LIBTIFF_DLL_IMPEXP  TIFFTagMethods *TIFFAccessTagMethods( TIFF * );
370 LIBTIFF_DLL_IMPEXP  void *TIFFGetClientInfo( TIFF *, const char * );
371 LIBTIFF_DLL_IMPEXP  void TIFFSetClientInfo( TIFF *, void *, const char * );
372 
373 LIBTIFF_DLL_IMPEXP	void TIFFCleanup(TIFF*);
374 LIBTIFF_DLL_IMPEXP	void TIFFClose(TIFF*);
375 LIBTIFF_DLL_IMPEXP	int TIFFFlush(TIFF*);
376 LIBTIFF_DLL_IMPEXP	int TIFFFlushData(TIFF*);
377 LIBTIFF_DLL_IMPEXP	int TIFFGetField(TIFF*, ttag_t, ...);
378 LIBTIFF_DLL_IMPEXP	int TIFFVGetField(TIFF*, ttag_t, va_list);
379 LIBTIFF_DLL_IMPEXP	int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
380 LIBTIFF_DLL_IMPEXP	int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
381 LIBTIFF_DLL_IMPEXP	int TIFFReadDirectory(TIFF*);
382 LIBTIFF_DLL_IMPEXP	int TIFFReadCustomDirectory(TIFF*, toff_t, const TIFFFieldInfo[],
383 				    size_t);
384 LIBTIFF_DLL_IMPEXP	int TIFFReadEXIFDirectory(TIFF*, toff_t);
385 LIBTIFF_DLL_IMPEXP	tsize_t TIFFScanlineSize(TIFF*);
386 LIBTIFF_DLL_IMPEXP	tsize_t TIFFRasterScanlineSize(TIFF*);
387 LIBTIFF_DLL_IMPEXP	tsize_t TIFFStripSize(TIFF*);
388 LIBTIFF_DLL_IMPEXP	tsize_t TIFFRawStripSize(TIFF*, tstrip_t);
389 LIBTIFF_DLL_IMPEXP	tsize_t TIFFVStripSize(TIFF*, uint32);
390 LIBTIFF_DLL_IMPEXP	tsize_t TIFFTileRowSize(TIFF*);
391 LIBTIFF_DLL_IMPEXP	tsize_t TIFFTileSize(TIFF*);
392 LIBTIFF_DLL_IMPEXP	tsize_t TIFFVTileSize(TIFF*, uint32);
393 LIBTIFF_DLL_IMPEXP	uint32 TIFFDefaultStripSize(TIFF*, uint32);
394 LIBTIFF_DLL_IMPEXP	void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
395 LIBTIFF_DLL_IMPEXP	int TIFFFileno(TIFF*);
396 LIBTIFF_DLL_IMPEXP  int TIFFSetFileno(TIFF*, int);
397 LIBTIFF_DLL_IMPEXP  thandle_t TIFFClientdata(TIFF*);
398 LIBTIFF_DLL_IMPEXP  thandle_t TIFFSetClientdata(TIFF*, thandle_t);
399 LIBTIFF_DLL_IMPEXP	int TIFFGetMode(TIFF*);
400 LIBTIFF_DLL_IMPEXP	int TIFFSetMode(TIFF*, int);
401 LIBTIFF_DLL_IMPEXP	int TIFFIsTiled(TIFF*);
402 LIBTIFF_DLL_IMPEXP	int TIFFIsByteSwapped(TIFF*);
403 LIBTIFF_DLL_IMPEXP	int TIFFIsUpSampled(TIFF*);
404 LIBTIFF_DLL_IMPEXP	int TIFFIsMSB2LSB(TIFF*);
405 LIBTIFF_DLL_IMPEXP	int TIFFIsBigEndian(TIFF*);
406 LIBTIFF_DLL_IMPEXP	TIFFReadWriteProc TIFFGetReadProc(TIFF*);
407 LIBTIFF_DLL_IMPEXP	TIFFReadWriteProc TIFFGetWriteProc(TIFF*);
408 LIBTIFF_DLL_IMPEXP	TIFFSeekProc TIFFGetSeekProc(TIFF*);
409 LIBTIFF_DLL_IMPEXP	TIFFCloseProc TIFFGetCloseProc(TIFF*);
410 LIBTIFF_DLL_IMPEXP	TIFFSizeProc TIFFGetSizeProc(TIFF*);
411 LIBTIFF_DLL_IMPEXP	TIFFMapFileProc TIFFGetMapFileProc(TIFF*);
412 LIBTIFF_DLL_IMPEXP	TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);
413 LIBTIFF_DLL_IMPEXP	uint32 TIFFCurrentRow(TIFF*);
414 LIBTIFF_DLL_IMPEXP	tdir_t TIFFCurrentDirectory(TIFF*);
415 LIBTIFF_DLL_IMPEXP	tdir_t TIFFNumberOfDirectories(TIFF*);
416 LIBTIFF_DLL_IMPEXP	uint32 TIFFCurrentDirOffset(TIFF*);
417 LIBTIFF_DLL_IMPEXP	tstrip_t TIFFCurrentStrip(TIFF*);
418 LIBTIFF_DLL_IMPEXP	ttile_t TIFFCurrentTile(TIFF*);
419 LIBTIFF_DLL_IMPEXP	int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
420 LIBTIFF_DLL_IMPEXP	int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
421 LIBTIFF_DLL_IMPEXP	int TIFFSetupStrips(TIFF *);
422 LIBTIFF_DLL_IMPEXP  int TIFFWriteCheck(TIFF*, int, const char *);
423 LIBTIFF_DLL_IMPEXP	void TIFFFreeDirectory(TIFF*);
424 LIBTIFF_DLL_IMPEXP  int TIFFCreateDirectory(TIFF*);
425 LIBTIFF_DLL_IMPEXP	int TIFFLastDirectory(TIFF*);
426 LIBTIFF_DLL_IMPEXP	int TIFFSetDirectory(TIFF*, tdir_t);
427 LIBTIFF_DLL_IMPEXP	int TIFFSetSubDirectory(TIFF*, uint32);
428 LIBTIFF_DLL_IMPEXP	int TIFFUnlinkDirectory(TIFF*, tdir_t);
429 LIBTIFF_DLL_IMPEXP	int TIFFSetField(TIFF*, ttag_t, ...);
430 LIBTIFF_DLL_IMPEXP	int TIFFVSetField(TIFF*, ttag_t, va_list);
431 LIBTIFF_DLL_IMPEXP	int TIFFWriteDirectory(TIFF *);
432 LIBTIFF_DLL_IMPEXP	int TIFFCheckpointDirectory(TIFF *);
433 LIBTIFF_DLL_IMPEXP	int TIFFRewriteDirectory(TIFF *);
434 LIBTIFF_DLL_IMPEXP	int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
435 
436 #if defined(c_plusplus) || defined(__cplusplus)
437 LIBTIFF_DLL_IMPEXP	void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
438 LIBTIFF_DLL_IMPEXP	int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
439 LIBTIFF_DLL_IMPEXP	int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
440 LIBTIFF_DLL_IMPEXP	int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
441 LIBTIFF_DLL_IMPEXP	int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
442 				      int = ORIENTATION_BOTLEFT, int = 0);
443 #else
444 LIBTIFF_DLL_IMPEXP	void TIFFPrintDirectory(TIFF*, FILE*, long);
445 LIBTIFF_DLL_IMPEXP	int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
446 LIBTIFF_DLL_IMPEXP	int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
447 LIBTIFF_DLL_IMPEXP	int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
448 LIBTIFF_DLL_IMPEXP	int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
449 #endif
450 
451 LIBTIFF_DLL_IMPEXP	int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
452 LIBTIFF_DLL_IMPEXP	int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
453 LIBTIFF_DLL_IMPEXP	int TIFFRGBAImageOK(TIFF*, char [1024]);
454 LIBTIFF_DLL_IMPEXP	int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
455 LIBTIFF_DLL_IMPEXP	int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
456 LIBTIFF_DLL_IMPEXP	void TIFFRGBAImageEnd(TIFFRGBAImage*);
457 LIBTIFF_DLL_IMPEXP	TIFF* TIFFOpen(const char*, const char*);
458 # ifdef __WIN32__
459 LIBTIFF_DLL_IMPEXP	TIFF* TIFFOpenW(const wchar_t*, const char*);
460 # endif /* __WIN32__ */
461 LIBTIFF_DLL_IMPEXP	TIFF* TIFFFdOpen(int, const char*, const char*);
462 LIBTIFF_DLL_IMPEXP	TIFF* TIFFClientOpen(const char*, const char*,
463 	    thandle_t,
464 	    TIFFReadWriteProc, TIFFReadWriteProc,
465 	    TIFFSeekProc, TIFFCloseProc,
466 	    TIFFSizeProc,
467 	    TIFFMapFileProc, TIFFUnmapFileProc);
468 LIBTIFF_DLL_IMPEXP	const char* TIFFFileName(TIFF*);
469 LIBTIFF_DLL_IMPEXP	const char* TIFFSetFileName(TIFF*, const char *);
470 LIBTIFF_DLL_IMPEXP	void TIFFError(const char*, const char*, ...);
471 LIBTIFF_DLL_IMPEXP	void TIFFErrorExt(thandle_t, const char*, const char*, ...);
472 LIBTIFF_DLL_IMPEXP	void TIFFWarning(const char*, const char*, ...);
473 LIBTIFF_DLL_IMPEXP	void TIFFWarningExt(thandle_t, const char*, const char*, ...);
474 LIBTIFF_DLL_IMPEXP	TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
475 LIBTIFF_DLL_IMPEXP	TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
476 LIBTIFF_DLL_IMPEXP	TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
477 LIBTIFF_DLL_IMPEXP	TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
478 LIBTIFF_DLL_IMPEXP	TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
479 LIBTIFF_DLL_IMPEXP	ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
480 LIBTIFF_DLL_IMPEXP	int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
481 LIBTIFF_DLL_IMPEXP	ttile_t TIFFNumberOfTiles(TIFF*);
482 LIBTIFF_DLL_IMPEXP	tsize_t TIFFReadTile(TIFF*,
483 	    tdata_t, uint32, uint32, uint32, tsample_t);
484 LIBTIFF_DLL_IMPEXP	tsize_t TIFFWriteTile(TIFF*,
485 	    tdata_t, uint32, uint32, uint32, tsample_t);
486 LIBTIFF_DLL_IMPEXP	tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t);
487 LIBTIFF_DLL_IMPEXP	tstrip_t TIFFNumberOfStrips(TIFF*);
488 LIBTIFF_DLL_IMPEXP	tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
489 LIBTIFF_DLL_IMPEXP	tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
490 LIBTIFF_DLL_IMPEXP	tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
491 LIBTIFF_DLL_IMPEXP	tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
492 LIBTIFF_DLL_IMPEXP	tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
493 LIBTIFF_DLL_IMPEXP	tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
494 LIBTIFF_DLL_IMPEXP	tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
495 LIBTIFF_DLL_IMPEXP	tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
496 LIBTIFF_DLL_IMPEXP	int TIFFDataWidth(TIFFDataType);    /* table of tag datatype widths */
497 LIBTIFF_DLL_IMPEXP	void TIFFSetWriteOffset(TIFF*, toff_t);
498 LIBTIFF_DLL_IMPEXP	void TIFFSwabShort(uint16*);
499 LIBTIFF_DLL_IMPEXP	void TIFFSwabLong(uint32*);
500 LIBTIFF_DLL_IMPEXP	void TIFFSwabDouble(double*);
501 LIBTIFF_DLL_IMPEXP	void TIFFSwabArrayOfShort(uint16*, unsigned long);
502 LIBTIFF_DLL_IMPEXP	void TIFFSwabArrayOfTriples(uint8*, unsigned long);
503 LIBTIFF_DLL_IMPEXP	void TIFFSwabArrayOfLong(uint32*, unsigned long);
504 LIBTIFF_DLL_IMPEXP	void TIFFSwabArrayOfDouble(double*, unsigned long);
505 LIBTIFF_DLL_IMPEXP	void TIFFReverseBits(unsigned char *, unsigned long);
506 LIBTIFF_DLL_IMPEXP	const unsigned char* TIFFGetBitRevTable(int);
507 
508 #ifdef LOGLUV_PUBLIC
509 #define U_NEU		0.210526316
510 #define V_NEU		0.473684211
511 #define UVSCALE		410.
512 LIBTIFF_DLL_IMPEXP	double LogL16toY(int);
513 LIBTIFF_DLL_IMPEXP	double LogL10toY(int);
514 LIBTIFF_DLL_IMPEXP	void XYZtoRGB24(float*, uint8*);
515 LIBTIFF_DLL_IMPEXP	int uv_decode(double*, double*, int);
516 LIBTIFF_DLL_IMPEXP	void LogLuv24toXYZ(uint32, float*);
517 LIBTIFF_DLL_IMPEXP	void LogLuv32toXYZ(uint32, float*);
518 #if defined(c_plusplus) || defined(__cplusplus)
519 LIBTIFF_DLL_IMPEXP	int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
520 LIBTIFF_DLL_IMPEXP	int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
521 LIBTIFF_DLL_IMPEXP	int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
522 LIBTIFF_DLL_IMPEXP	uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
523 LIBTIFF_DLL_IMPEXP	uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
524 #else
525 LIBTIFF_DLL_IMPEXP	int LogL16fromY(double, int);
526 LIBTIFF_DLL_IMPEXP	int LogL10fromY(double, int);
527 LIBTIFF_DLL_IMPEXP	int uv_encode(double, double, int);
528 LIBTIFF_DLL_IMPEXP	uint32 LogLuv24fromXYZ(float*, int);
529 LIBTIFF_DLL_IMPEXP	uint32 LogLuv32fromXYZ(float*, int);
530 #endif
531 #endif /* LOGLUV_PUBLIC */
532 
533 LIBTIFF_DLL_IMPEXP int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, TIFFDisplay *, float*);
534 LIBTIFF_DLL_IMPEXP void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
535 			    float *, float *, float *);
536 LIBTIFF_DLL_IMPEXP void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
537 			 uint32 *, uint32 *, uint32 *);
538 
539 LIBTIFF_DLL_IMPEXP int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
540 LIBTIFF_DLL_IMPEXP void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
541 			   uint32 *, uint32 *, uint32 *);
542 
543 #if defined(c_plusplus) || defined(__cplusplus)
544 }
545 #endif
546 
547 #endif /* _TIFFIO_ */
548 
549 /* vim: set ts=8 sts=8 sw=8 noet: */
550