/src/FreeImage/Source/LibTIFF/tiffio.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 526 lines · 367 code · 48 blank · 111 comment · 12 complexity · 8490d3bd21a70006f4ef5fcdebe8b54a MD5 · raw file

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