File indexing completed on 2025-01-17 09:56:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef _TIFFIO_
0026 #define _TIFFIO_
0027
0028
0029
0030
0031 #include "tiff.h"
0032 #include "tiffvers.h"
0033
0034
0035
0036
0037
0038 typedef struct tiff TIFF;
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 typedef TIFF_SSIZE_T tmsize_t;
0066 #define TIFF_TMSIZE_T_MAX (tmsize_t)(SIZE_MAX >> 1)
0067
0068 typedef uint64_t toff_t;
0069
0070
0071 typedef uint32_t ttag_t;
0072 typedef uint32_t tdir_t;
0073 typedef uint16_t tsample_t;
0074 typedef uint32_t tstrile_t;
0075 typedef tstrile_t tstrip_t;
0076 typedef tstrile_t ttile_t;
0077 typedef tmsize_t tsize_t;
0078 typedef void *tdata_t;
0079
0080
0081
0082
0083
0084
0085
0086
0087 #if defined(_WIN32)
0088 #if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && \
0089 !defined(USE_WIN32_FILEIO)
0090 #define AVOID_WIN32_FILEIO
0091 #endif
0092 #endif
0093
0094 #if defined(USE_WIN32_FILEIO)
0095 #define VC_EXTRALEAN
0096 #include <windows.h>
0097 #ifdef _WIN32
0098 DECLARE_HANDLE(thandle_t);
0099 #else
0100 typedef HFILE thandle_t;
0101 #endif
0102 #else
0103 typedef void *thandle_t;
0104 #endif
0105
0106
0107
0108
0109
0110
0111
0112 #define TIFFPRINT_NONE 0x0
0113 #define TIFFPRINT_STRIPS 0x1
0114 #define TIFFPRINT_CURVES 0x2
0115 #define TIFFPRINT_COLORMAP 0x4
0116 #define TIFFPRINT_JPEGQTABLES 0x100
0117 #define TIFFPRINT_JPEGACTABLES 0x200
0118 #define TIFFPRINT_JPEGDCTABLES 0x200
0119
0120
0121
0122
0123
0124
0125 #define D65_X0 (95.0470F)
0126 #define D65_Y0 (100.0F)
0127 #define D65_Z0 (108.8827F)
0128
0129 #define D50_X0 (96.4250F)
0130 #define D50_Y0 (100.0F)
0131 #define D50_Z0 (82.4680F)
0132
0133
0134
0135 typedef unsigned char TIFFRGBValue;
0136
0137 typedef struct
0138 {
0139 float d_mat[3][3];
0140 float d_YCR;
0141 float d_YCG;
0142 float d_YCB;
0143 uint32_t d_Vrwr;
0144 uint32_t d_Vrwg;
0145 uint32_t d_Vrwb;
0146 float d_Y0R;
0147 float d_Y0G;
0148 float d_Y0B;
0149 float d_gammaR;
0150 float d_gammaG;
0151 float d_gammaB;
0152 } TIFFDisplay;
0153
0154 typedef struct
0155 {
0156 TIFFRGBValue *clamptab;
0157 int *Cr_r_tab;
0158 int *Cb_b_tab;
0159 int32_t *Cr_g_tab;
0160 int32_t *Cb_g_tab;
0161 int32_t *Y_tab;
0162 } TIFFYCbCrToRGB;
0163
0164 typedef struct
0165 {
0166 int range;
0167 #define CIELABTORGB_TABLE_RANGE 1500
0168 float rstep, gstep, bstep;
0169 float X0, Y0, Z0;
0170 TIFFDisplay display;
0171 float Yr2r[CIELABTORGB_TABLE_RANGE + 1];
0172 float Yg2g[CIELABTORGB_TABLE_RANGE + 1];
0173 float Yb2b[CIELABTORGB_TABLE_RANGE + 1];
0174 } TIFFCIELabToRGB;
0175
0176
0177
0178
0179 typedef struct _TIFFRGBAImage TIFFRGBAImage;
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190 typedef void (*tileContigRoutine)(TIFFRGBAImage *, uint32_t *, uint32_t,
0191 uint32_t, uint32_t, uint32_t, int32_t,
0192 int32_t, unsigned char *);
0193 typedef void (*tileSeparateRoutine)(TIFFRGBAImage *, uint32_t *, uint32_t,
0194 uint32_t, uint32_t, uint32_t, int32_t,
0195 int32_t, unsigned char *, unsigned char *,
0196 unsigned char *, unsigned char *);
0197
0198
0199
0200 struct _TIFFRGBAImage
0201 {
0202 TIFF *tif;
0203 int stoponerr;
0204 int isContig;
0205 int alpha;
0206 uint32_t width;
0207 uint32_t height;
0208 uint16_t bitspersample;
0209 uint16_t samplesperpixel;
0210 uint16_t orientation;
0211 uint16_t req_orientation;
0212 uint16_t photometric;
0213 uint16_t *redcmap;
0214 uint16_t *greencmap;
0215 uint16_t *bluecmap;
0216
0217 int (*get)(TIFFRGBAImage *, uint32_t *, uint32_t, uint32_t);
0218
0219 union
0220 {
0221 void (*any)(TIFFRGBAImage *);
0222 tileContigRoutine contig;
0223 tileSeparateRoutine separate;
0224 } put;
0225 TIFFRGBValue *Map;
0226 uint32_t **BWmap;
0227 uint32_t **PALmap;
0228 TIFFYCbCrToRGB *ycbcr;
0229 TIFFCIELabToRGB *cielab;
0230
0231 uint8_t *UaToAa;
0232 uint8_t *Bitdepth16To8;
0233
0234 int row_offset;
0235 int col_offset;
0236 };
0237
0238
0239
0240
0241
0242 #define TIFFGetR(abgr) ((abgr)&0xff)
0243 #define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
0244 #define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
0245 #define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
0246
0247
0248
0249
0250
0251
0252
0253
0254 typedef int (*TIFFInitMethod)(TIFF *, int);
0255 typedef struct
0256 {
0257 char *name;
0258 uint16_t scheme;
0259 TIFFInitMethod init;
0260 } TIFFCodec;
0261
0262 typedef struct
0263 {
0264 uint32_t uNum;
0265 uint32_t uDenom;
0266 } TIFFRational_t;
0267
0268 #include <stdarg.h>
0269 #include <stdio.h>
0270
0271
0272 #ifndef LOGLUV_PUBLIC
0273 #define LOGLUV_PUBLIC 1
0274 #endif
0275
0276 #if defined(__GNUC__) || defined(__clang__) || defined(__attribute__)
0277 #define TIFF_ATTRIBUTE(x) __attribute__(x)
0278 #else
0279 #define TIFF_ATTRIBUTE(x)
0280 #endif
0281
0282 #if defined(c_plusplus) || defined(__cplusplus)
0283 extern "C"
0284 {
0285 #endif
0286 typedef void (*TIFFErrorHandler)(const char *, const char *, va_list);
0287 typedef void (*TIFFErrorHandlerExt)(thandle_t, const char *, const char *,
0288 va_list);
0289 typedef int (*TIFFErrorHandlerExtR)(TIFF *, void *user_data, const char *,
0290 const char *, va_list);
0291 typedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void *, tmsize_t);
0292 typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
0293 typedef int (*TIFFCloseProc)(thandle_t);
0294 typedef toff_t (*TIFFSizeProc)(thandle_t);
0295 typedef int (*TIFFMapFileProc)(thandle_t, void **base, toff_t *size);
0296 typedef void (*TIFFUnmapFileProc)(thandle_t, void *base, toff_t size);
0297 typedef void (*TIFFExtendProc)(TIFF *);
0298
0299 extern const char *TIFFGetVersion(void);
0300
0301 extern const TIFFCodec *TIFFFindCODEC(uint16_t);
0302 extern TIFFCodec *TIFFRegisterCODEC(uint16_t, const char *, TIFFInitMethod);
0303 extern void TIFFUnRegisterCODEC(TIFFCodec *);
0304 extern int TIFFIsCODECConfigured(uint16_t);
0305 extern TIFFCodec *TIFFGetConfiguredCODECs(void);
0306
0307
0308
0309
0310 #ifndef TIFF_DO_NOT_USE_NON_EXT_ALLOC_FUNCTIONS
0311 extern void *_TIFFmalloc(tmsize_t s);
0312 extern void *_TIFFcalloc(tmsize_t nmemb, tmsize_t siz);
0313 extern void *_TIFFrealloc(void *p, tmsize_t s);
0314 extern void _TIFFfree(void *p);
0315 #endif
0316 extern void _TIFFmemset(void *p, int v, tmsize_t c);
0317 extern void _TIFFmemcpy(void *d, const void *s, tmsize_t c);
0318 extern int _TIFFmemcmp(const void *p1, const void *p2, tmsize_t c);
0319
0320
0321
0322
0323 extern int TIFFGetTagListCount(TIFF *);
0324 extern uint32_t TIFFGetTagListEntry(TIFF *, int tag_index);
0325
0326 #define TIFF_ANY TIFF_NOTYPE
0327 #define TIFF_VARIABLE -1
0328 #define TIFF_SPP -2
0329 #define TIFF_VARIABLE2 -3
0330
0331 #define FIELD_CUSTOM 65
0332
0333 typedef struct _TIFFField TIFFField;
0334 typedef struct _TIFFFieldArray TIFFFieldArray;
0335
0336 extern const TIFFField *TIFFFindField(TIFF *, uint32_t, TIFFDataType);
0337 extern const TIFFField *TIFFFieldWithTag(TIFF *, uint32_t);
0338 extern const TIFFField *TIFFFieldWithName(TIFF *, const char *);
0339
0340 extern uint32_t TIFFFieldTag(const TIFFField *);
0341 extern const char *TIFFFieldName(const TIFFField *);
0342 extern TIFFDataType TIFFFieldDataType(const TIFFField *);
0343 extern int TIFFFieldPassCount(const TIFFField *);
0344 extern int TIFFFieldReadCount(const TIFFField *);
0345 extern int TIFFFieldWriteCount(const TIFFField *);
0346 extern int
0347 TIFFFieldSetGetSize(const TIFFField *);
0348
0349 extern int TIFFFieldSetGetCountSize(
0350 const TIFFField *);
0351
0352 extern int TIFFFieldIsAnonymous(const TIFFField *);
0353
0354 typedef int (*TIFFVSetMethod)(TIFF *, uint32_t, va_list);
0355 typedef int (*TIFFVGetMethod)(TIFF *, uint32_t, va_list);
0356 typedef void (*TIFFPrintMethod)(TIFF *, FILE *, long);
0357
0358 typedef struct
0359 {
0360 TIFFVSetMethod vsetfield;
0361 TIFFVGetMethod vgetfield;
0362 TIFFPrintMethod printdir;
0363 } TIFFTagMethods;
0364
0365 extern TIFFTagMethods *TIFFAccessTagMethods(TIFF *);
0366 extern void *TIFFGetClientInfo(TIFF *, const char *);
0367 extern void TIFFSetClientInfo(TIFF *, void *, const char *);
0368
0369 extern void TIFFCleanup(TIFF *tif);
0370 extern void TIFFClose(TIFF *tif);
0371 extern int TIFFFlush(TIFF *tif);
0372 extern int TIFFFlushData(TIFF *tif);
0373 extern int TIFFGetField(TIFF *tif, uint32_t tag, ...);
0374 extern int TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap);
0375 extern int TIFFGetFieldDefaulted(TIFF *tif, uint32_t tag, ...);
0376 extern int TIFFVGetFieldDefaulted(TIFF *tif, uint32_t tag, va_list ap);
0377 extern int TIFFReadDirectory(TIFF *tif);
0378 extern int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff,
0379 const TIFFFieldArray *infoarray);
0380 extern int TIFFReadEXIFDirectory(TIFF *tif, toff_t diroff);
0381 extern int TIFFReadGPSDirectory(TIFF *tif, toff_t diroff);
0382 extern uint64_t TIFFScanlineSize64(TIFF *tif);
0383 extern tmsize_t TIFFScanlineSize(TIFF *tif);
0384 extern uint64_t TIFFRasterScanlineSize64(TIFF *tif);
0385 extern tmsize_t TIFFRasterScanlineSize(TIFF *tif);
0386 extern uint64_t TIFFStripSize64(TIFF *tif);
0387 extern tmsize_t TIFFStripSize(TIFF *tif);
0388 extern uint64_t TIFFRawStripSize64(TIFF *tif, uint32_t strip);
0389 extern tmsize_t TIFFRawStripSize(TIFF *tif, uint32_t strip);
0390 extern uint64_t TIFFVStripSize64(TIFF *tif, uint32_t nrows);
0391 extern tmsize_t TIFFVStripSize(TIFF *tif, uint32_t nrows);
0392 extern uint64_t TIFFTileRowSize64(TIFF *tif);
0393 extern tmsize_t TIFFTileRowSize(TIFF *tif);
0394 extern uint64_t TIFFTileSize64(TIFF *tif);
0395 extern tmsize_t TIFFTileSize(TIFF *tif);
0396 extern uint64_t TIFFVTileSize64(TIFF *tif, uint32_t nrows);
0397 extern tmsize_t TIFFVTileSize(TIFF *tif, uint32_t nrows);
0398 extern uint32_t TIFFDefaultStripSize(TIFF *tif, uint32_t request);
0399 extern void TIFFDefaultTileSize(TIFF *, uint32_t *, uint32_t *);
0400 extern int TIFFFileno(TIFF *);
0401 extern int TIFFSetFileno(TIFF *, int);
0402 extern thandle_t TIFFClientdata(TIFF *);
0403 extern thandle_t TIFFSetClientdata(TIFF *, thandle_t);
0404 extern int TIFFGetMode(TIFF *);
0405 extern int TIFFSetMode(TIFF *, int);
0406 extern int TIFFIsTiled(TIFF *);
0407 extern int TIFFIsByteSwapped(TIFF *);
0408 extern int TIFFIsUpSampled(TIFF *);
0409 extern int TIFFIsMSB2LSB(TIFF *);
0410 extern int TIFFIsBigEndian(TIFF *);
0411 extern int TIFFIsBigTIFF(TIFF *);
0412 extern TIFFReadWriteProc TIFFGetReadProc(TIFF *);
0413 extern TIFFReadWriteProc TIFFGetWriteProc(TIFF *);
0414 extern TIFFSeekProc TIFFGetSeekProc(TIFF *);
0415 extern TIFFCloseProc TIFFGetCloseProc(TIFF *);
0416 extern TIFFSizeProc TIFFGetSizeProc(TIFF *);
0417 extern TIFFMapFileProc TIFFGetMapFileProc(TIFF *);
0418 extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF *);
0419 extern uint32_t TIFFCurrentRow(TIFF *);
0420 extern tdir_t TIFFCurrentDirectory(TIFF *);
0421 extern tdir_t TIFFNumberOfDirectories(TIFF *);
0422 extern uint64_t TIFFCurrentDirOffset(TIFF *);
0423 extern uint32_t TIFFCurrentStrip(TIFF *);
0424 extern uint32_t TIFFCurrentTile(TIFF *tif);
0425 extern int TIFFReadBufferSetup(TIFF *tif, void *bp, tmsize_t size);
0426 extern int TIFFWriteBufferSetup(TIFF *tif, void *bp, tmsize_t size);
0427 extern int TIFFSetupStrips(TIFF *);
0428 extern int TIFFWriteCheck(TIFF *, int, const char *);
0429 extern void TIFFFreeDirectory(TIFF *);
0430 extern int TIFFCreateDirectory(TIFF *);
0431 extern int TIFFCreateCustomDirectory(TIFF *, const TIFFFieldArray *);
0432 extern int TIFFCreateEXIFDirectory(TIFF *);
0433 extern int TIFFCreateGPSDirectory(TIFF *);
0434 extern int TIFFLastDirectory(TIFF *);
0435 extern int TIFFSetDirectory(TIFF *, tdir_t);
0436 extern int TIFFSetSubDirectory(TIFF *, uint64_t);
0437 extern int TIFFUnlinkDirectory(TIFF *, tdir_t);
0438 extern int TIFFSetField(TIFF *, uint32_t, ...);
0439 extern int TIFFVSetField(TIFF *, uint32_t, va_list);
0440 extern int TIFFUnsetField(TIFF *, uint32_t);
0441 extern int TIFFWriteDirectory(TIFF *);
0442 extern int TIFFWriteCustomDirectory(TIFF *, uint64_t *);
0443 extern int TIFFCheckpointDirectory(TIFF *);
0444 extern int TIFFRewriteDirectory(TIFF *);
0445 extern int TIFFDeferStrileArrayWriting(TIFF *);
0446 extern int TIFFForceStrileArrayWriting(TIFF *);
0447
0448 #if defined(c_plusplus) || defined(__cplusplus)
0449 extern void TIFFPrintDirectory(TIFF *, FILE *, long = 0);
0450 extern int TIFFReadScanline(TIFF *tif, void *buf, uint32_t row,
0451 uint16_t sample = 0);
0452 extern int TIFFWriteScanline(TIFF *tif, void *buf, uint32_t row,
0453 uint16_t sample = 0);
0454 extern int TIFFReadRGBAImage(TIFF *, uint32_t, uint32_t, uint32_t *,
0455 int = 0);
0456 extern int TIFFReadRGBAImageOriented(TIFF *, uint32_t, uint32_t, uint32_t *,
0457 int = ORIENTATION_BOTLEFT, int = 0);
0458 #else
0459 extern void TIFFPrintDirectory(TIFF *, FILE *, long);
0460 extern int TIFFReadScanline(TIFF *tif, void *buf, uint32_t row,
0461 uint16_t sample);
0462 extern int TIFFWriteScanline(TIFF *tif, void *buf, uint32_t row,
0463 uint16_t sample);
0464 extern int TIFFReadRGBAImage(TIFF *, uint32_t, uint32_t, uint32_t *, int);
0465 extern int TIFFReadRGBAImageOriented(TIFF *, uint32_t, uint32_t, uint32_t *,
0466 int, int);
0467 #endif
0468
0469 extern int TIFFReadRGBAStrip(TIFF *, uint32_t, uint32_t *);
0470 extern int TIFFReadRGBATile(TIFF *, uint32_t, uint32_t, uint32_t *);
0471 extern int TIFFReadRGBAStripExt(TIFF *, uint32_t, uint32_t *,
0472 int stop_on_error);
0473 extern int TIFFReadRGBATileExt(TIFF *, uint32_t, uint32_t, uint32_t *,
0474 int stop_on_error);
0475 extern int TIFFRGBAImageOK(TIFF *, char[1024]);
0476 extern int TIFFRGBAImageBegin(TIFFRGBAImage *, TIFF *, int, char[1024]);
0477 extern int TIFFRGBAImageGet(TIFFRGBAImage *, uint32_t *, uint32_t,
0478 uint32_t);
0479 extern void TIFFRGBAImageEnd(TIFFRGBAImage *);
0480
0481 extern const char *TIFFFileName(TIFF *);
0482 extern const char *TIFFSetFileName(TIFF *, const char *);
0483 extern void TIFFError(const char *, const char *, ...)
0484 TIFF_ATTRIBUTE((__format__(__printf__, 2, 3)));
0485 extern void TIFFErrorExt(thandle_t, const char *, const char *, ...)
0486 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
0487 extern void TIFFWarning(const char *, const char *, ...)
0488 TIFF_ATTRIBUTE((__format__(__printf__, 2, 3)));
0489 extern void TIFFWarningExt(thandle_t, const char *, const char *, ...)
0490 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
0491 extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
0492 extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
0493 extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
0494 extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
0495
0496 extern void TIFFWarningExtR(TIFF *, const char *, const char *, ...)
0497 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
0498 extern void TIFFErrorExtR(TIFF *, const char *, const char *, ...)
0499 TIFF_ATTRIBUTE((__format__(__printf__, 3, 4)));
0500
0501 typedef struct TIFFOpenOptions TIFFOpenOptions;
0502 extern TIFFOpenOptions *TIFFOpenOptionsAlloc(void);
0503 extern void TIFFOpenOptionsFree(TIFFOpenOptions *);
0504 extern void
0505 TIFFOpenOptionsSetMaxSingleMemAlloc(TIFFOpenOptions *opts,
0506 tmsize_t max_single_mem_alloc);
0507 extern void
0508 TIFFOpenOptionsSetMaxCumulatedMemAlloc(TIFFOpenOptions *opts,
0509 tmsize_t max_cumulated_mem_alloc);
0510 extern void
0511 TIFFOpenOptionsSetErrorHandlerExtR(TIFFOpenOptions *opts,
0512 TIFFErrorHandlerExtR handler,
0513 void *errorhandler_user_data);
0514 extern void
0515 TIFFOpenOptionsSetWarningHandlerExtR(TIFFOpenOptions *opts,
0516 TIFFErrorHandlerExtR handler,
0517 void *warnhandler_user_data);
0518
0519 extern TIFF *TIFFOpen(const char *, const char *);
0520 extern TIFF *TIFFOpenExt(const char *, const char *, TIFFOpenOptions *opts);
0521 #ifdef _WIN32
0522 extern TIFF *TIFFOpenW(const wchar_t *, const char *);
0523 extern TIFF *TIFFOpenWExt(const wchar_t *, const char *,
0524 TIFFOpenOptions *opts);
0525 #endif
0526 extern TIFF *TIFFFdOpen(int, const char *, const char *);
0527 extern TIFF *TIFFFdOpenExt(int, const char *, const char *,
0528 TIFFOpenOptions *opts);
0529 extern TIFF *TIFFClientOpen(const char *, const char *, thandle_t,
0530 TIFFReadWriteProc, TIFFReadWriteProc,
0531 TIFFSeekProc, TIFFCloseProc, TIFFSizeProc,
0532 TIFFMapFileProc, TIFFUnmapFileProc);
0533 extern TIFF *TIFFClientOpenExt(const char *, const char *, thandle_t,
0534 TIFFReadWriteProc, TIFFReadWriteProc,
0535 TIFFSeekProc, TIFFCloseProc, TIFFSizeProc,
0536 TIFFMapFileProc, TIFFUnmapFileProc,
0537 TIFFOpenOptions *opts);
0538 extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
0539 extern uint32_t TIFFComputeTile(TIFF *tif, uint32_t x, uint32_t y,
0540 uint32_t z, uint16_t s);
0541 extern int TIFFCheckTile(TIFF *tif, uint32_t x, uint32_t y, uint32_t z,
0542 uint16_t s);
0543 extern uint32_t TIFFNumberOfTiles(TIFF *);
0544 extern tmsize_t TIFFReadTile(TIFF *tif, void *buf, uint32_t x, uint32_t y,
0545 uint32_t z, uint16_t s);
0546 extern tmsize_t TIFFWriteTile(TIFF *tif, void *buf, uint32_t x, uint32_t y,
0547 uint32_t z, uint16_t s);
0548 extern uint32_t TIFFComputeStrip(TIFF *, uint32_t, uint16_t);
0549 extern uint32_t TIFFNumberOfStrips(TIFF *);
0550 extern tmsize_t TIFFReadEncodedStrip(TIFF *tif, uint32_t strip, void *buf,
0551 tmsize_t size);
0552 extern tmsize_t TIFFReadRawStrip(TIFF *tif, uint32_t strip, void *buf,
0553 tmsize_t size);
0554 extern tmsize_t TIFFReadEncodedTile(TIFF *tif, uint32_t tile, void *buf,
0555 tmsize_t size);
0556 extern tmsize_t TIFFReadRawTile(TIFF *tif, uint32_t tile, void *buf,
0557 tmsize_t size);
0558 extern int TIFFReadFromUserBuffer(TIFF *tif, uint32_t strile, void *inbuf,
0559 tmsize_t insize, void *outbuf,
0560 tmsize_t outsize);
0561 extern tmsize_t TIFFWriteEncodedStrip(TIFF *tif, uint32_t strip, void *data,
0562 tmsize_t cc);
0563 extern tmsize_t TIFFWriteRawStrip(TIFF *tif, uint32_t strip, void *data,
0564 tmsize_t cc);
0565 extern tmsize_t TIFFWriteEncodedTile(TIFF *tif, uint32_t tile, void *data,
0566 tmsize_t cc);
0567 extern tmsize_t TIFFWriteRawTile(TIFF *tif, uint32_t tile, void *data,
0568 tmsize_t cc);
0569 extern int TIFFDataWidth(
0570 TIFFDataType);
0571 extern void TIFFSetWriteOffset(TIFF *tif, toff_t off);
0572 extern void TIFFSwabShort(uint16_t *);
0573 extern void TIFFSwabLong(uint32_t *);
0574 extern void TIFFSwabLong8(uint64_t *);
0575 extern void TIFFSwabFloat(float *);
0576 extern void TIFFSwabDouble(double *);
0577 extern void TIFFSwabArrayOfShort(uint16_t *wp, tmsize_t n);
0578 extern void TIFFSwabArrayOfTriples(uint8_t *tp, tmsize_t n);
0579 extern void TIFFSwabArrayOfLong(uint32_t *lp, tmsize_t n);
0580 extern void TIFFSwabArrayOfLong8(uint64_t *lp, tmsize_t n);
0581 extern void TIFFSwabArrayOfFloat(float *fp, tmsize_t n);
0582 extern void TIFFSwabArrayOfDouble(double *dp, tmsize_t n);
0583 extern void TIFFReverseBits(uint8_t *cp, tmsize_t n);
0584 extern const unsigned char *TIFFGetBitRevTable(int);
0585
0586 extern uint64_t TIFFGetStrileOffset(TIFF *tif, uint32_t strile);
0587 extern uint64_t TIFFGetStrileByteCount(TIFF *tif, uint32_t strile);
0588 extern uint64_t TIFFGetStrileOffsetWithErr(TIFF *tif, uint32_t strile,
0589 int *pbErr);
0590 extern uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile,
0591 int *pbErr);
0592
0593 #ifdef LOGLUV_PUBLIC
0594 #define U_NEU 0.210526316
0595 #define V_NEU 0.473684211
0596 #define UVSCALE 410.
0597 extern double LogL16toY(int);
0598 extern double LogL10toY(int);
0599 extern void XYZtoRGB24(float *, uint8_t *);
0600 extern int uv_decode(double *, double *, int);
0601 extern void LogLuv24toXYZ(uint32_t, float *);
0602 extern void LogLuv32toXYZ(uint32_t, float *);
0603 #if defined(c_plusplus) || defined(__cplusplus)
0604 extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
0605 extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
0606 extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
0607 extern uint32_t LogLuv24fromXYZ(float *, int = SGILOGENCODE_NODITHER);
0608 extern uint32_t LogLuv32fromXYZ(float *, int = SGILOGENCODE_NODITHER);
0609 #else
0610 extern int LogL16fromY(double, int);
0611 extern int LogL10fromY(double, int);
0612 extern int uv_encode(double, double, int);
0613 extern uint32_t LogLuv24fromXYZ(float *, int);
0614 extern uint32_t LogLuv32fromXYZ(float *, int);
0615 #endif
0616 #endif
0617
0618 extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB *, const TIFFDisplay *,
0619 float *);
0620 extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32_t, int32_t, int32_t,
0621 float *, float *, float *);
0622 extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float, uint32_t *,
0623 uint32_t *, uint32_t *);
0624
0625 extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *, float *, float *);
0626 extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32_t, int32_t, int32_t,
0627 uint32_t *, uint32_t *, uint32_t *);
0628
0629
0630
0631
0632
0633
0634
0635 typedef struct
0636 {
0637 ttag_t field_tag;
0638 short field_readcount;
0639 short field_writecount;
0640 TIFFDataType field_type;
0641 unsigned short field_bit;
0642 unsigned char field_oktochange;
0643 unsigned char field_passcount;
0644 char *field_name;
0645 } TIFFFieldInfo;
0646
0647 extern int TIFFMergeFieldInfo(TIFF *, const TIFFFieldInfo[], uint32_t);
0648
0649 #if defined(c_plusplus) || defined(__cplusplus)
0650 }
0651 #endif
0652
0653 #endif