/cocos2dx/platform/third_party/win32/libtiff/tiffio.h

https://bitbucket.org/Tsiannian/cocos2d-x · C++ Header · 553 lines · 377 code · 51 blank · 125 comment · 12 complexity · 1574e6c27da547c672d8da6b54d60bdf MD5 · raw file

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