Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
tiffio.h
Go to the documentation of this file.
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 /*
31  * TIFF I/O Library Definitions.
32  */
33 #include "tiff.h"
34 #include "tiffvers.h"
35 
36 /*
37  * TIFF is defined as an incomplete type to hide the
38  * library's internal data structures from clients.
39  */
40 typedef struct tiff TIFF;
41 
42 /*
43  * The following typedefs define the intrinsic size of
44  * data types used in the *exported* interfaces. These
45  * definitions depend on the proper definition of types
46  * in tiff.h. Note also that the varargs interface used
47  * to pass tag types and values uses the types defined in
48  * tiff.h directly.
49  *
50  * NB: ttag_t is unsigned int and not unsigned short because
51  * ANSI C requires that the type before the ellipsis be a
52  * promoted type (i.e. one of int, unsigned int, pointer,
53  * or double) and because we defined pseudo-tags that are
54  * outside the range of legal Aldus-assigned tags.
55  * NB: tsize_t is int32 and not uint32 because some functions
56  * return -1.
57  * NB: toff_t is not off_t for many reasons; TIFFs max out at
58  * 32-bit file offsets being the most important, and to ensure
59  * that it is unsigned, rather than signed.
60  */
61 typedef uint32 ttag_t; /* directory tag */
62 typedef uint16 tdir_t; /* directory index */
63 typedef uint16 tsample_t; /* sample number */
64 typedef uint32 tstrip_t; /* strip number */
65 typedef uint32 ttile_t; /* tile number */
66 typedef int32 tsize_t; /* i/o size in bytes */
67 typedef void* tdata_t; /* image data ref */
68 typedef uint32 toff_t; /* file offset */
69 
70 #if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
71 #define __WIN32__
72 #endif
73 
74 /*
75  * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
76  * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
77  *
78  * By default tif_unix.c is assumed.
79  */
80 
81 #if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
82 # if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)
83 # define AVOID_WIN32_FILEIO
84 # endif
85 #endif
86 
87 #if defined(USE_WIN32_FILEIO)
88 # define VC_EXTRALEAN
89 # include <windows.h>
90 # ifdef __WIN32__
91 DECLARE_HANDLE(thandle_t); /* Win32 file handle */
92 # else
93 typedef HFILE thandle_t; /* client data handle */
94 # endif /* __WIN32__ */
95 #else
96 typedef void* thandle_t; /* client data handle */
97 #endif /* USE_WIN32_FILEIO */
98 
99 #ifndef NULL
100 # define NULL (void *)0
101 #endif
102 
103 /*
104  * Flags to pass to TIFFPrintDirectory to control
105  * printing of data structures that are potentially
106  * very large. Bit-or these flags to enable printing
107  * multiple items.
108  */
109 #define TIFFPRINT_NONE 0x0 /* no extra info */
110 #define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */
111 #define TIFFPRINT_CURVES 0x2 /* color/gray response curves */
112 #define TIFFPRINT_COLORMAP 0x4 /* colormap */
113 #define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */
114 #define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */
115 #define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */
116 
117 /*
118  * Colour conversion stuff
119  */
120 
121 /* reference white */
122 #define D65_X0 (95.0470F)
123 #define D65_Y0 (100.0F)
124 #define D65_Z0 (108.8827F)
125 
126 #define D50_X0 (96.4250F)
127 #define D50_Y0 (100.0F)
128 #define D50_Z0 (82.4680F)
129 
130 /* Structure for holding information about a display device. */
131 
132 typedef unsigned char TIFFRGBValue; /* 8-bit samples */
133 
134 typedef struct {
135  float d_mat[3][3]; /* XYZ -> luminance matrix */
136  float d_YCR; /* Light o/p for reference white */
137  float d_YCG;
138  float d_YCB;
139  uint32 d_Vrwr; /* Pixel values for ref. white */
142  float d_Y0R; /* Residual light for black pixel */
143  float d_Y0G;
144  float d_Y0B;
145  float d_gammaR; /* Gamma values for the three guns */
146  float d_gammaG;
147  float d_gammaB;
148 } TIFFDisplay;
149 
150 typedef struct { /* YCbCr->RGB support */
151  TIFFRGBValue* clamptab; /* range clamping table */
152  int* Cr_r_tab;
153  int* Cb_b_tab;
154  int32* Cr_g_tab;
155  int32* Cb_g_tab;
156  int32* Y_tab;
158 
159 typedef struct { /* CIE Lab 1976->RGB support */
160  int range; /* Size of conversion table */
161 #define CIELABTORGB_TABLE_RANGE 1500
162  float rstep, gstep, bstep;
163  float X0, Y0, Z0; /* Reference white point */
165  float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */
166  float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */
167  float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */
169 
170 /*
171  * RGBA-style image support.
172  */
174 /*
175  * The image reading and conversion routines invoke
176  * ``put routines'' to copy/image/whatever tiles of
177  * raw image data. A default set of routines are
178  * provided to convert/copy raw image data to 8-bit
179  * packed ABGR format rasters. Applications can supply
180  * alternate routines that unpack the data into a
181  * different format or, for example, unpack the data
182  * and draw the unpacked raster on the display.
183  */
184 typedef void (*tileContigRoutine)
186  unsigned char*);
187 typedef void (*tileSeparateRoutine)
188  (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
189  unsigned char*, unsigned char*, unsigned char*, unsigned char*);
190 /*
191  * RGBA-reader state.
192  */
194  TIFF* tif; /* image handle */
195  int stoponerr; /* stop on read error */
196  int isContig; /* data is packed/separate */
197  int alpha; /* type of alpha data present */
198  uint32 width; /* image width */
199  uint32 height; /* image height */
200  uint16 bitspersample; /* image bits/sample */
201  uint16 samplesperpixel; /* image samples/pixel */
202  uint16 orientation; /* image orientation */
203  uint16 req_orientation; /* requested orientation */
204  uint16 photometric; /* image photometric interp */
205  uint16* redcmap; /* colormap pallete */
208  /* get image data routine */
209  int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
210  union {
214  } put; /* put decoded strip/tile */
215  TIFFRGBValue* Map; /* sample mapping array */
216  uint32** BWmap; /* black&white map */
217  uint32** PALmap; /* palette image map */
218  TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */
219  TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */
220 
223 };
224 
225 /*
226  * Macros for extracting components from the
227  * packed ABGR form returned by TIFFReadRGBAImage.
228  */
229 #define TIFFGetR(abgr) ((abgr) & 0xff)
230 #define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
231 #define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
232 #define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
233 
234 /*
235  * A CODEC is a software package that implements decoding,
236  * encoding, or decoding+encoding of a compression algorithm.
237  * The library provides a collection of builtin codecs.
238  * More codecs may be registered through calls to the library
239  * and/or the builtin implementations may be overridden.
240  */
241 typedef int (*TIFFInitMethod)(TIFF*, int);
242 typedef struct {
243  char* name;
246 } TIFFCodec;
247 
248 #include <stdio.h>
249 #include <stdarg.h>
250 
251 /* share internal LogLuv conversion routines? */
252 #ifndef LOGLUV_PUBLIC
253 #define LOGLUV_PUBLIC 1
254 #endif
255 
256 #if defined(c_plusplus) || defined(__cplusplus)
257 extern "C" {
258 #endif
259 typedef void (*TIFFErrorHandler)(const char*, const char*, va_list);
260 typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);
265 typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
267 typedef void (*TIFFExtendProc)(TIFF*);
268 
269 extern const char* TIFFGetVersion(void);
270 
271 extern const TIFFCodec* TIFFFindCODEC(uint16);
272 extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
273 extern void TIFFUnRegisterCODEC(TIFFCodec*);
274 extern int TIFFIsCODECConfigured(uint16);
275 extern TIFFCodec* TIFFGetConfiguredCODECs(void);
276 
277 /*
278  * Auxiliary functions.
279  */
280 
281 extern tdata_t _TIFFmalloc(tsize_t);
282 extern tdata_t _TIFFrealloc(tdata_t, tsize_t);
283 extern void _TIFFmemset(tdata_t, int, tsize_t);
284 extern void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
285 extern int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
286 extern void _TIFFfree(tdata_t);
287 
288 /*
289 ** Stuff, related to tag handling and creating custom tags.
290 */
291 extern int TIFFGetTagListCount( TIFF * );
292 extern ttag_t TIFFGetTagListEntry( TIFF *, int tag_index );
293 
294 #define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
295 #define TIFF_VARIABLE -1 /* marker for variable length tags */
296 #define TIFF_SPP -2 /* marker for SamplesPerPixel tags */
297 #define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */
298 
299 #define FIELD_CUSTOM 65
300 
301 typedef struct {
302  ttag_t field_tag; /* field's tag */
303  short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
304  short field_writecount; /* write count/TIFF_VARIABLE */
305  TIFFDataType field_type; /* type of associated data */
306  unsigned short field_bit; /* bit in fieldsset bit vector */
307  unsigned char field_oktochange; /* if true, can change while writing */
308  unsigned char field_passcount; /* if true, pass dir count on set */
309  char *field_name; /* ASCII name */
310 } TIFFFieldInfo;
311 
312 typedef struct _TIFFTagValue {
314  int count;
315  void *value;
316 } TIFFTagValue;
317 
318 extern void TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int);
320 extern const TIFFFieldInfo* TIFFFindFieldInfoByName(TIFF* , const char *,
321  TIFFDataType);
322 extern const TIFFFieldInfo* TIFFFieldWithTag(TIFF*, ttag_t);
323 extern const TIFFFieldInfo* TIFFFieldWithName(TIFF*, const char *);
324 
325 typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
326 typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
327 typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
328 
329 typedef struct {
330  TIFFVSetMethod vsetfield; /* tag set routine */
331  TIFFVGetMethod vgetfield; /* tag get routine */
332  TIFFPrintMethod printdir; /* directory print routine */
334 
335 extern TIFFTagMethods *TIFFAccessTagMethods( TIFF * );
336 extern void *TIFFGetClientInfo( TIFF *, const char * );
337 extern void TIFFSetClientInfo( TIFF *, void *, const char * );
338 
339 extern void TIFFCleanup(TIFF*);
340 extern void TIFFClose(TIFF*);
341 extern int TIFFFlush(TIFF*);
342 extern int TIFFFlushData(TIFF*);
343 extern int TIFFGetField(TIFF*, ttag_t, ...);
344 extern int TIFFVGetField(TIFF*, ttag_t, va_list);
345 extern int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
346 extern int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
347 extern int TIFFReadDirectory(TIFF*);
348 extern int TIFFReadCustomDirectory(TIFF*, toff_t, const TIFFFieldInfo[],
349  size_t);
350 extern int TIFFReadEXIFDirectory(TIFF*, toff_t);
351 extern tsize_t TIFFScanlineSize(TIFF*);
352 extern tsize_t TIFFRasterScanlineSize(TIFF*);
353 extern tsize_t TIFFStripSize(TIFF*);
354 extern tsize_t TIFFRawStripSize(TIFF*, tstrip_t);
355 extern tsize_t TIFFVStripSize(TIFF*, uint32);
356 extern tsize_t TIFFTileRowSize(TIFF*);
357 extern tsize_t TIFFTileSize(TIFF*);
358 extern tsize_t TIFFVTileSize(TIFF*, uint32);
359 extern uint32 TIFFDefaultStripSize(TIFF*, uint32);
360 extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
361 extern int TIFFFileno(TIFF*);
362 extern int TIFFSetFileno(TIFF*, int);
363 extern thandle_t TIFFClientdata(TIFF*);
364 extern thandle_t TIFFSetClientdata(TIFF*, thandle_t);
365 extern int TIFFGetMode(TIFF*);
366 extern int TIFFSetMode(TIFF*, int);
367 extern int TIFFIsTiled(TIFF*);
368 extern int TIFFIsByteSwapped(TIFF*);
369 extern int TIFFIsUpSampled(TIFF*);
370 extern int TIFFIsMSB2LSB(TIFF*);
371 extern int TIFFIsBigEndian(TIFF*);
372 extern TIFFReadWriteProc TIFFGetReadProc(TIFF*);
373 extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);
374 extern TIFFSeekProc TIFFGetSeekProc(TIFF*);
375 extern TIFFCloseProc TIFFGetCloseProc(TIFF*);
376 extern TIFFSizeProc TIFFGetSizeProc(TIFF*);
377 extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);
379 extern uint32 TIFFCurrentRow(TIFF*);
380 extern tdir_t TIFFCurrentDirectory(TIFF*);
381 extern tdir_t TIFFNumberOfDirectories(TIFF*);
382 extern uint32 TIFFCurrentDirOffset(TIFF*);
383 extern tstrip_t TIFFCurrentStrip(TIFF*);
384 extern ttile_t TIFFCurrentTile(TIFF*);
385 extern int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
386 extern int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
387 extern int TIFFSetupStrips(TIFF *);
388 extern int TIFFWriteCheck(TIFF*, int, const char *);
389 extern void TIFFFreeDirectory(TIFF*);
390 extern int TIFFCreateDirectory(TIFF*);
391 extern int TIFFLastDirectory(TIFF*);
392 extern int TIFFSetDirectory(TIFF*, tdir_t);
393 extern int TIFFSetSubDirectory(TIFF*, uint32);
394 extern int TIFFUnlinkDirectory(TIFF*, tdir_t);
395 extern int TIFFSetField(TIFF*, ttag_t, ...);
396 extern int TIFFVSetField(TIFF*, ttag_t, va_list);
397 extern int TIFFWriteDirectory(TIFF *);
398 extern int TIFFCheckpointDirectory(TIFF *);
399 extern int TIFFRewriteDirectory(TIFF *);
400 extern int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
401 
402 #if defined(c_plusplus) || defined(__cplusplus)
403 extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
404 extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
405 extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
406 extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
407 extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
408  int = ORIENTATION_BOTLEFT, int = 0);
409 #else
410 extern void TIFFPrintDirectory(TIFF*, FILE*, long);
411 extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
412 extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
413 extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
414 extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
415 #endif
416 
417 extern int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
418 extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
419 extern int TIFFRGBAImageOK(TIFF*, char [1024]);
420 extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
421 extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
422 extern void TIFFRGBAImageEnd(TIFFRGBAImage*);
423 extern TIFF* TIFFOpen(const char*, const char*);
424 # ifdef __WIN32__
425 extern TIFF* TIFFOpenW(const wchar_t*, const char*);
426 # endif /* __WIN32__ */
427 extern TIFF* TIFFFdOpen(int, const char*, const char*);
428 extern TIFF* TIFFClientOpen(const char*, const char*,
429  thandle_t,
432  TIFFSizeProc,
434 extern const char* TIFFFileName(TIFF*);
435 extern const char* TIFFSetFileName(TIFF*, const char *);
436 extern void TIFFError(const char*, const char*, ...);
437 extern void TIFFErrorExt(thandle_t, const char*, const char*, ...);
438 extern void TIFFWarning(const char*, const char*, ...);
439 extern void TIFFWarningExt(thandle_t, const char*, const char*, ...);
445 extern ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
446 extern int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
447 extern ttile_t TIFFNumberOfTiles(TIFF*);
448 extern tsize_t TIFFReadTile(TIFF*,
449  tdata_t, uint32, uint32, uint32, tsample_t);
450 extern tsize_t TIFFWriteTile(TIFF*,
451  tdata_t, uint32, uint32, uint32, tsample_t);
452 extern tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t);
453 extern tstrip_t TIFFNumberOfStrips(TIFF*);
454 extern tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
455 extern tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
456 extern tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
457 extern tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
458 extern tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
459 extern tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
460 extern tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
461 extern tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
462 extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */
463 extern void TIFFSetWriteOffset(TIFF*, toff_t);
464 extern void TIFFSwabShort(uint16*);
465 extern void TIFFSwabLong(uint32*);
466 extern void TIFFSwabDouble(double*);
467 extern void TIFFSwabArrayOfShort(uint16*, unsigned long);
468 extern void TIFFSwabArrayOfTriples(uint8*, unsigned long);
469 extern void TIFFSwabArrayOfLong(uint32*, unsigned long);
470 extern void TIFFSwabArrayOfDouble(double*, unsigned long);
471 extern void TIFFReverseBits(unsigned char *, unsigned long);
472 extern const unsigned char* TIFFGetBitRevTable(int);
473 
474 #ifdef LOGLUV_PUBLIC
475 #define U_NEU 0.210526316
476 #define V_NEU 0.473684211
477 #define UVSCALE 410.
478 extern double LogL16toY(int);
479 extern double LogL10toY(int);
480 extern void XYZtoRGB24(float*, uint8*);
481 extern int uv_decode(double*, double*, int);
482 extern void LogLuv24toXYZ(uint32, float*);
483 extern void LogLuv32toXYZ(uint32, float*);
484 #if defined(c_plusplus) || defined(__cplusplus)
485 extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
486 extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
487 extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
488 extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
489 extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
490 #else
491 extern int LogL16fromY(double, int);
492 extern int LogL10fromY(double, int);
493 extern int uv_encode(double, double, int);
494 extern uint32 LogLuv24fromXYZ(float*, int);
495 extern uint32 LogLuv32fromXYZ(float*, int);
496 #endif
497 #endif /* LOGLUV_PUBLIC */
498 
499 extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, TIFFDisplay *, float*);
500 extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
501  float *, float *, float *);
502 extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
503  uint32 *, uint32 *, uint32 *);
504 
505 extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
506 extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
507  uint32 *, uint32 *, uint32 *);
508 
509 #if defined(c_plusplus) || defined(__cplusplus)
510 }
511 #endif
512 
513 #endif /* _TIFFIO_ */
514 
515 /* vim: set ts=8 sts=8 sw=8 noet: */
int TIFFIsBigEndian(TIFF *)
Definition: tif_open.c:615
int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t)
Definition: tif_acorn.c:491
int32 tsize_t
Definition: tiffio.h:66
uint16 scheme
Definition: tiffio.h:244
uint16 tsample_t
Definition: tiffio.h:63
tsize_t TIFFReadTile(TIFF *, tdata_t, uint32, uint32, uint32, tsample_t)
Definition: tif_read.c:330
uint32 ttag_t
Definition: tiffio.h:61
void TIFFSwabArrayOfTriples(uint8 *, unsigned long)
Definition: tif_swab.c:75
int TIFFLastDirectory(TIFF *)
Definition: tif_dir.c:1220
tsize_t TIFFWriteRawTile(TIFF *, ttile_t, tdata_t, tsize_t)
Definition: tif_write.c:427
void * TIFFGetClientInfo(TIFF *, const char *)
Definition: tif_extension.c:66
void * tdata_t
Definition: tiffio.h:67
uint32 ttile_t
Definition: tiffio.h:65
int TIFFRewriteDirectory(TIFF *)
ttag_t TIFFGetTagListEntry(TIFF *, int tag_index)
Definition: tif_extension.c:44
uint32 ** PALmap
Definition: tiffio.h:217
int TIFFSetSubDirectory(TIFF *, uint32)
Definition: tif_dir.c:1195
int(* TIFFCloseProc)(thandle_t)
Definition: tiffio.h:263
tstrip_t TIFFNumberOfStrips(TIFF *)
Definition: tif_strip.c:90
int TIFFCheckTile(TIFF *, uint32, uint32, uint32, tsample_t)
Definition: tif_tile.c:105
tsize_t TIFFWriteTile(TIFF *, tdata_t, uint32, uint32, uint32, tsample_t)
Definition: tif_write.c:310
int TIFFVSetField(TIFF *, ttag_t, va_list)
Definition: tif_dir.c:645
int32 * Y_tab
Definition: tiffio.h:156
int TIFFCreateDirectory(TIFF *)
Definition: tif_dir.c:1013
void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32, float *, float *, float *)
Definition: tif_color.c:46
tsize_t TIFFReadRawTile(TIFF *, ttile_t, tdata_t, tsize_t)
Definition: tif_read.c:418
struct _TIFFTagValue TIFFTagValue
int TIFFGetField(TIFF *, ttag_t,...)
Definition: tif_dir.c:925
tdata_t _TIFFrealloc(tdata_t, tsize_t)
Definition: tif_acorn.c:473
int TIFFReadCustomDirectory(TIFF *, toff_t, const TIFFFieldInfo[], size_t)
Definition: tif_dirread.c:696
int32 * Cb_g_tab
Definition: tiffio.h:155
TIFFInitMethod init
Definition: tiffio.h:245
void TIFFPrintDirectory(TIFF *, FILE *, long)
Definition: tif_print.c:195
int TIFFSetFileno(TIFF *, int)
Definition: tif_open.c:491
bool any(const ivec2 &a)
Definition: glsl_math.hpp:1449
tdata_t _TIFFmalloc(tsize_t)
Definition: tif_acorn.c:461
DECLARE_HANDLE(HPBUFFERARB)
TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler)
Definition: tif_warning.c:35
void TIFFUnRegisterCODEC(TIFFCodec *)
Definition: tif_compress.c:215
int TIFFSetField(TIFF *, ttag_t,...)
Definition: tif_dir.c:627
tsize_t TIFFWriteEncodedStrip(TIFF *, tstrip_t, tdata_t, tsize_t)
Definition: tif_write.c:182
TIFF * TIFFClientOpen(const char *, const char *, thandle_t, TIFFReadWriteProc, TIFFReadWriteProc, TIFFSeekProc, TIFFCloseProc, TIFFSizeProc, TIFFMapFileProc, TIFFUnmapFileProc)
Definition: tif_open.c:141
int TIFFGetFieldDefaulted(TIFF *, ttag_t,...)
Definition: tif_aux.c:256
void TIFFSetClientInfo(TIFF *, void *, const char *)
Definition: tif_extension.c:80
tsize_t TIFFVTileSize(TIFF *, uint32)
Definition: tif_tile.c:193
void TIFFSwabLong(uint32 *)
Definition: tif_swab.c:47
int TIFFIsTiled(TIFF *)
Definition: tif_open.c:543
uint32 TIFFDefaultStripSize(TIFF *, uint32)
Definition: tif_strip.c:198
unsigned char uint8
Definition: tiff.h:67
tsize_t TIFFStripSize(TIFF *)
Definition: tif_strip.c:182
uint16 * greencmap
Definition: tiffio.h:206
TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc)
Definition: tif_dir.c:998
double LogL16toY(int)
Definition: tif_luv.c:650
void(* TIFFErrorHandler)(const char *, const char *, va_list)
Definition: tiffio.h:259
int TIFFReadRGBAImage(TIFF *, uint32, uint32, uint32 *, int)
Definition: tif_getimage.c:487
TIFFDisplay display
Definition: tiffio.h:164
const char * TIFFFileName(TIFF *)
Definition: tif_open.c:462
int(* TIFFInitMethod)(TIFF *, int)
Definition: tiffio.h:241
int TIFFWriteCheck(TIFF *, int, const char *)
Definition: tif_write.c:487
float d_gammaB
Definition: tiffio.h:147
uint32 d_Vrwr
Definition: tiffio.h:139
unsigned char TIFFRGBValue
Definition: tiffio.h:132
TIFFReadWriteProc TIFFGetReadProc(TIFF *)
Definition: tif_open.c:624
tdir_t TIFFNumberOfDirectories(TIFF *)
Definition: tif_dir.c:1149
uint32 TIFFCurrentDirOffset(TIFF *)
Definition: tif_dir.c:1210
int TIFFCheckpointDirectory(TIFF *)
Definition: tif_dirwrite.c:422
TIFFSizeProc TIFFGetSizeProc(TIFF *)
Definition: tif_open.c:660
void TIFFDefaultTileSize(TIFF *, uint32 *, uint32 *)
Definition: tif_tile.c:253
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
void(* tileContigRoutine)(TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *)
Definition: tiffio.h:185
TIFFMapFileProc TIFFGetMapFileProc(TIFF *)
Definition: tif_open.c:669
int32 * Cr_g_tab
Definition: tiffio.h:154
TIFFReadWriteProc TIFFGetWriteProc(TIFF *)
Definition: tif_open.c:633
Definition: tiffiop.h:95
int TIFFRGBAImageBegin(TIFFRGBAImage *, TIFF *, int, char [1024])
Definition: tif_getimage.c:222
int TIFFGetMode(TIFF *)
Definition: tif_open.c:522
char * name
Definition: tiffio.h:243
TIFFPrintMethod printdir
Definition: tiffio.h:332
TIFF * TIFFFdOpen(int, const char *, const char *)
Definition: tif_acorn.c:418
int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int)
Definition: tif_dir.c:1309
void TIFFReverseBits(unsigned char *, unsigned long)
TIFFCodec * TIFFGetConfiguredCODECs(void)
Get list of configured codecs, both built-in and registered by user.
Definition: tif_compress.c:243
int TIFFReadScanline(TIFF *, tdata_t, uint32, tsample_t)
Definition: tif_read.c:94
int TIFFUnlinkDirectory(TIFF *, tdir_t)
Definition: tif_dir.c:1229
int TIFFReadBufferSetup(TIFF *, tdata_t, tsize_t)
Definition: tif_read.c:519
const TIFFFieldInfo * info
Definition: tiffio.h:313
png_infop png_charp png_int_32 * X0
Definition: png.h:2180
void TIFFMergeFieldInfo(TIFF *, const TIFFFieldInfo[], int)
uint32 tstrip_t
Definition: tiffio.h:64
int TIFFReadRGBATile(TIFF *, uint32, uint32, uint32 *)
toff_t(* TIFFSeekProc)(thandle_t, toff_t, int)
Definition: tiffio.h:262
int TIFFVGetFieldDefaulted(TIFF *, ttag_t, va_list)
Definition: tif_aux.c:104
void(* TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t)
Definition: tiffio.h:266
float d_YCB
Definition: tiffio.h:138
toff_t(* TIFFSizeProc)(thandle_t)
Definition: tiffio.h:264
thandle_t TIFFClientdata(TIFF *)
Definition: tif_open.c:502
int TIFFFileno(TIFF *)
Definition: tif_open.c:482
unsigned char field_passcount
Definition: tiffio.h:308
int TIFFWriteDirectory(TIFF *)
Definition: tif_dirwrite.c:410
uint16 * redcmap
Definition: tiffio.h:205
int uv_decode(double *, double *, int)
Definition: tif_luv.c:836
tstrip_t TIFFCurrentStrip(TIFF *)
Definition: tif_open.c:570
ttile_t TIFFNumberOfTiles(TIFF *)
Definition: tif_tile.c:145
#define CIELABTORGB_TABLE_RANGE
Definition: tiffio.h:161
void TIFFError(const char *, const char *,...)
Definition: tif_error.c:51
TIFFRGBValue * Map
Definition: tiffio.h:215
int TIFFFlush(TIFF *)
Definition: tif_flush.c:33
TIFFCodec * TIFFRegisterCODEC(uint16, const char *, TIFFInitMethod)
Definition: tif_compress.c:192
float d_YCG
Definition: tiffio.h:137
tsize_t TIFFRasterScanlineSize(TIFF *)
Definition: tif_strip.c:277
TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt)
Definition: tif_error.c:43
tsize_t TIFFReadRawStrip(TIFF *, tstrip_t, tdata_t, tsize_t)
Definition: tif_read.c:214
void TIFFErrorExt(thandle_t, const char *, const char *,...)
Definition: tif_error.c:63
void TIFFSwabArrayOfLong(uint32 *, unsigned long)
TIFF * TIFFOpenW(const wchar_t *name, const char *mode)
Definition: tif_win32.c:220
unsigned short uint16
Definition: tiff.h:71
int TIFFReadRGBAStrip(TIFF *, tstrip_t, uint32 *)
tsize_t TIFFReadEncodedTile(TIFF *, ttile_t, tdata_t, tsize_t)
Definition: tif_read.c:344
int TIFFWriteScanline(TIFF *, tdata_t, uint32, tsample_t)
Definition: tif_write.c:49
uint32 d_Vrwb
Definition: tiffio.h:141
TIFFCIELabToRGB * cielab
Definition: tiffio.h:219
uint16 samplesperpixel
Definition: tiffio.h:201
TIFFVSetMethod vsetfield
Definition: tiffio.h:330
tsize_t(* TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t)
Definition: tiffio.h:261
TIFFRGBValue * clamptab
Definition: tiffio.h:151
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
double LogL10toY(int)
Definition: tif_luv.c:732
TIFFIgnoreSense
Definition: tiff.h:85
tsize_t TIFFScanlineSize(TIFF *)
Definition: tif_strip.c:227
tsize_t TIFFVStripSize(TIFF *, uint32)
Definition: tif_strip.c:107
tsize_t TIFFReadEncodedStrip(TIFF *, tstrip_t, tdata_t, tsize_t)
Definition: tif_read.c:122
ttile_t TIFFCurrentTile(TIFF *)
Definition: tif_open.c:579
uint32 ** BWmap
Definition: tiffio.h:216
int TIFFSetupStrips(TIFF *)
Definition: tif_write.c:447
void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float, uint32 *, uint32 *, uint32 *)
Definition: tif_color.c:78
int LogL10fromY(double, int)
Definition: tif_luv.c:743
tileContigRoutine contig
Definition: tiffio.h:212
float d_Y0B
Definition: tiffio.h:144
TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF *)
Definition: tif_open.c:678
void TIFFSwabArrayOfDouble(double *, unsigned long)
short field_readcount
Definition: tiffio.h:303
const TIFFFieldInfo * TIFFFieldWithName(TIFF *, const char *)
TIFF * TIFFOpen(const char *, const char *)
Definition: tif_acorn.c:438
void TIFFClose(TIFF *)
Close a previously opened TIFF file.
Definition: tif_close.c:111
tdir_t TIFFCurrentDirectory(TIFF *)
Definition: tif_open.c:561
int(* TIFFMapFileProc)(thandle_t, tdata_t *, toff_t *)
Definition: tiffio.h:265
tsize_t TIFFTileRowSize(TIFF *)
Definition: tif_tile.c:174
uint32 LogLuv32fromXYZ(float *, int)
TIFFCloseProc TIFFGetCloseProc(TIFF *)
Definition: tif_open.c:651
int * Cr_r_tab
Definition: tiffio.h:152
void(* TIFFExtendProc)(TIFF *)
Definition: tiffio.h:267
void(* TIFFErrorHandlerExt)(thandle_t, const char *, const char *, va_list)
Definition: tiffio.h:260
TIFFTagMethods * TIFFAccessTagMethods(TIFF *)
Definition: tif_extension.c:60
int TIFFWriteBufferSetup(TIFF *, tdata_t, tsize_t)
Definition: tif_write.c:549
#define SGILOGENCODE_NODITHER
Definition: tiff.h:577
int TIFFReadEXIFDirectory(TIFF *, toff_t)
Definition: tif_dirread.c:857
tsize_t TIFFWriteRawStrip(TIFF *, tstrip_t, tdata_t, tsize_t)
Definition: tif_write.c:266
uint32 height
Definition: tiffio.h:199
int TIFFCIELabToRGBInit(TIFFCIELabToRGB *, TIFFDisplay *, float *)
Definition: tif_color.c:125
uint16 bitspersample
Definition: tiffio.h:200
int col_offset
Definition: tiffio.h:222
int row_offset
Definition: tiffio.h:221
int TIFFGetTagListCount(TIFF *)
Definition: tif_extension.c:36
void TIFFWarning(const char *, const char *,...)
Definition: tif_warning.c:51
const char * TIFFGetVersion(void)
Definition: tif_version.c:30
float d_gammaG
Definition: tiffio.h:146
const char * TIFFSetFileName(TIFF *, const char *)
Definition: tif_open.c:471
void LogLuv32toXYZ(uint32, float *)
void TIFFSetWriteOffset(TIFF *, toff_t)
Definition: tif_write.c:720
unsigned long uint32
Definition: md5.h:41
void(* TIFFPrintMethod)(TIFF *, FILE *, long)
Definition: tiffio.h:327
int TIFFIsUpSampled(TIFF *)
Definition: tif_open.c:597
void XYZtoRGB24(float *, uint8 *)
typedef int
Definition: png.h:978
int uv_encode(double, double, int)
Definition: tif_luv.c:814
int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *, float *, float *)
Definition: tif_color.c:212
int * Cb_b_tab
Definition: tiffio.h:153
int TIFFFlushData(TIFF *)
Definition: tif_flush.c:56
ttile_t TIFFComputeTile(TIFF *, uint32, uint32, uint32, tsample_t)
Definition: tif_tile.c:68
uint16 orientation
Definition: tiffio.h:202
uint32 LogLuv24fromXYZ(float *, int)
int LogL16fromY(double, int)
Definition: tif_luv.c:665
void LogLuv24toXYZ(uint32, float *)
int TIFFRGBAImageGet(TIFFRGBAImage *, uint32 *, uint32, uint32)
Definition: tif_getimage.c:442
const TIFFFieldInfo * TIFFFindFieldInfoByName(TIFF *, const char *, TIFFDataType)
tileSeparateRoutine separate
Definition: tiffio.h:213
void _TIFFmemset(tdata_t, int, tsize_t)
Definition: tif_acorn.c:479
void TIFFWarningExt(thandle_t, const char *, const char *,...)
Definition: tif_warning.c:63
uint32 toff_t
Definition: tiffio.h:68
int stoponerr
Definition: tiffio.h:195
int(* TIFFVGetMethod)(TIFF *, ttag_t, va_list)
Definition: tiffio.h:326
const TIFFFieldInfo * TIFFFieldWithTag(TIFF *, ttag_t)
void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32, uint32 *, uint32 *, uint32 *)
Definition: tif_color.c:183
TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt)
Definition: tif_warning.c:43
int TIFFSetDirectory(TIFF *, tdir_t)
Definition: tif_dir.c:1164
ttag_t field_tag
Definition: tiffio.h:302
uint16 tdir_t
Definition: tiffio.h:62
int TIFFDataWidth(TIFFDataType)
Definition: tif_dirinfo.c:620
unsigned char field_oktochange
Definition: tiffio.h:307
void _TIFFfree(tdata_t)
Definition: tif_acorn.c:467
int TIFFSetMode(TIFF *, int)
Definition: tif_open.c:531
tsize_t TIFFRawStripSize(TIFF *, tstrip_t)
Definition: tif_strip.c:158
float d_Y0G
Definition: tiffio.h:143
int TIFFReadDirectory(TIFF *)
Definition: tif_dirread.c:70
void TIFFCleanup(TIFF *)
Auxiliary function to free the TIFF structure.
Definition: tif_close.c:46
float d_Y0R
Definition: tiffio.h:142
thandle_t TIFFSetClientdata(TIFF *, thandle_t)
Definition: tif_open.c:511
int TIFFIsCODECConfigured(uint16)
Check whether we have working codec for the specific coding scheme.
Definition: tif_codec.c:135
uint16 req_orientation
Definition: tiffio.h:203
char * field_name
Definition: tiffio.h:309
void(* tileSeparateRoutine)(TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *, unsigned char *, unsigned char *, unsigned char *)
Definition: tiffio.h:188
void TIFFFreeDirectory(TIFF *)
Definition: tif_dir.c:961
const TIFFCodec * TIFFFindCODEC(uint16)
Definition: tif_compress.c:177
TIFFDataType field_type
Definition: tiffio.h:305
int TIFFReadRGBAImageOriented(TIFF *, uint32, uint32, uint32 *, int, int)
Definition: tif_getimage.c:461
int TIFFRGBAImageOK(TIFF *, char [1024])
Definition: tif_getimage.c:73
TIFF * tif
Definition: tiffio.h:194
uint32 TIFFCurrentRow(TIFF *)
Definition: tif_open.c:552
int TIFFIsMSB2LSB(TIFF *)
Definition: tif_open.c:606
float d_YCR
Definition: tiffio.h:136
TIFFYCbCrToRGB * ycbcr
Definition: tiffio.h:218
uint16 photometric
Definition: tiffio.h:204
void TIFFSwabArrayOfShort(uint16 *, unsigned long)
int TIFFVGetField(TIFF *, ttag_t, va_list)
Definition: tif_dir.c:943
TIFFSeekProc TIFFGetSeekProc(TIFF *)
Definition: tif_open.c:642
tstrip_t TIFFComputeStrip(TIFF *, uint32, tsample_t)
Definition: tif_strip.c:68
const TIFFFieldInfo * TIFFFindFieldInfo(TIFF *, ttag_t, TIFFDataType)
uint32 width
Definition: tiffio.h:198
uint16 * bluecmap
Definition: tiffio.h:207
int(* TIFFVSetMethod)(TIFF *, ttag_t, va_list)
Definition: tiffio.h:325
void TIFFRGBAImageEnd(TIFFRGBAImage *)
Definition: tif_getimage.c:190
tsize_t TIFFTileSize(TIFF *)
Definition: tif_tile.c:241
void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t)
Definition: tif_acorn.c:485
TIFFVGetMethod vgetfield
Definition: tiffio.h:331
TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler)
Definition: tif_error.c:35
void TIFFSwabDouble(double *)
Definition: tif_swab.c:108
#define ORIENTATION_BOTLEFT
Definition: tiff.h:230
int TIFFIsByteSwapped(TIFF *)
Definition: tif_open.c:588
unsigned short field_bit
Definition: tiffio.h:306
float d_gammaR
Definition: tiffio.h:145
int isContig
Definition: tiffio.h:196
void TIFFSwabShort(uint16 *)
Definition: tif_swab.c:36
const unsigned char * TIFFGetBitRevTable(int)
Definition: tif_swab.c:212
void * thandle_t
Definition: tiffio.h:96
short field_writecount
Definition: tiffio.h:304
tsize_t TIFFWriteEncodedTile(TIFF *, ttile_t, tdata_t, tsize_t)
Definition: tif_write.c:338
TIFFDataType
Definition: tiff.h:137
void * value
Definition: tiffio.h:315
float rstep
Definition: tiffio.h:162
uint32 d_Vrwg
Definition: tiffio.h:140