00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef INC_MI32_TIFFIO_H
00051 #define INC_MI32_TIFFIO_H
00052
00053 #ifndef INC_STDIO_H
00054 #include <stdio.h>
00055 #define INC_STDIO_H
00056 #endif
00057
00058 #ifndef INC_STDARG_H
00059 #include <stdarg.h>
00060 #define INC_STDARG_H
00061 #endif
00062
00063 #ifndef INC_MI32_STDINCLS_H
00064 #include <mi32/stdincls.h>
00065 #endif
00066
00067 #ifndef INC_MI32_TIFF_H
00068 #include <mi32/tiff.h>
00069 #endif
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 #define TIFFLIB_VERSION 19960307
00086
00087
00088
00089
00090
00091 typedef struct tiff TIFF;
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 typedef uint32 ttag_t;
00112 typedef uint16 tdir_t;
00113 typedef uint16 tsample_t;
00114 typedef uint32 tstrip_t;
00115 typedef uint32 ttile_t;
00116 typedef int32 tsize_t;
00117 typedef void* thandle_t;
00118 typedef void* tdata_t;
00119 typedef int32 toff_t;
00120
00121 #ifndef NULL
00122 #define NULL 0
00123 #endif
00124
00125
00126
00127
00128
00129
00130
00131 #define TIFFPRINT_NONE 0x0
00132 #define TIFFPRINT_STRIPS 0x1
00133 #define TIFFPRINT_CURVES 0x2
00134 #define TIFFPRINT_COLORMAP 0x4
00135 #define TIFFPRINT_JPEGQTABLES 0x100
00136 #define TIFFPRINT_JPEGACTABLES 0x200
00137 #define TIFFPRINT_JPEGDCTABLES 0x200
00138
00139
00140
00141
00142 typedef unsigned char TIFFRGBValue;
00143 typedef struct _TIFFRGBAImage TIFFRGBAImage;
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 typedef void (*tileContigRoutine)
00155 (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
00156 unsigned char*);
00157 typedef void (*tileSeparateRoutine)
00158 (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
00159 unsigned char*, unsigned char*, unsigned char*, unsigned char*);
00160
00161
00162
00163
00164 typedef struct {
00165 TIFFRGBValue* clamptab;
00166 int* Cr_r_tab;
00167 int* Cb_b_tab;
00168 int32* Cr_g_tab;
00169 int32* Cb_g_tab;
00170 float coeffs[3];
00171 } TIFFYCbCrToRGB;
00172
00173 struct _TIFFRGBAImage {
00174 TIFF* tif;
00175 int stoponerr;
00176 int isContig;
00177 int alpha;
00178 uint32 width;
00179 uint32 height;
00180 uint16 bitspersample;
00181 uint16 samplesperpixel;
00182 uint16 orientation;
00183 uint16 photometric;
00184 uint16* redcmap;
00185 uint16* greencmap;
00186 uint16* bluecmap;
00187
00188 int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
00189 union {
00190 void (*any)(TIFFRGBAImage*);
00191 tileContigRoutine contig;
00192 tileSeparateRoutine separate;
00193 } put;
00194 TIFFRGBValue* Map;
00195 uint32** BWmap;
00196 uint32** PALmap;
00197 TIFFYCbCrToRGB* ycbcr;
00198 };
00199
00200
00201
00202
00203
00204
00205 #define TIFFGetR(abgr) ((abgr) & 0xff)
00206 #define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
00207 #define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
00208 #define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
00209
00210
00211
00212
00213
00214
00215
00216
00217 typedef int (*TIFFInitMethod)(TIFF*, int);
00218 typedef struct {
00219 char* name;
00220 uint16 scheme;
00221 TIFFInitMethod init;
00222 } TIFFCodec;
00223
00224 #ifdef TIFFDLL
00225 #define LIBEXPORT MI_DLLEXPORT
00226 #else
00227 #define LIBEXPORT MI_DLLIMPORT
00228 #endif
00229
00230 #if defined(__cplusplus)
00231 extern "C" {
00232 #endif
00233 typedef void (*TIFFErrorHandler)(const UNICODE*, const char*, va_list);
00234 typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);
00235 typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
00236 typedef int (*TIFFCloseProc)(thandle_t);
00237 typedef toff_t (*TIFFSizeProc)(thandle_t);
00238 typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
00239 typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);
00240 typedef void (*TIFFExtendProc)(TIFF*);
00241
00242
00243 extern const char* TIFFGetVersion(void);
00244
00245 extern const TIFFCodec* TIFFFindCODEC(uint16);
00246 extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
00247 extern void TIFFUnRegisterCODEC(TIFFCodec*);
00248
00249 extern tdata_t _TIFFmalloc(tsize_t);
00250 extern tdata_t _TIFFrealloc(tdata_t, tsize_t);
00251 extern void _TIFFmemset(tdata_t, int, tsize_t);
00252 extern void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
00253 extern int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
00254 extern void _TIFFfree(tdata_t);
00255
00256 extern void TIFFClose(TIFF*);
00257 extern int TIFFFlush(TIFF*);
00258 extern int TIFFFlushData(TIFF*);
00259 LIBEXPORT int TIFFGetField(TIFF*, ttag_t, ...);
00260 extern int TIFFVGetField(TIFF*, ttag_t, va_list);
00261 LIBEXPORT int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
00262 extern int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
00263 LIBEXPORT int TIFFReadDirectory(TIFF*);
00264 extern tsize_t TIFFScanlineSize(TIFF*);
00265 extern tsize_t TIFFRasterScanlineSize(TIFF*);
00266 LIBEXPORT tsize_t TIFFStripSize(TIFF*);
00267 extern tsize_t TIFFVStripSize(TIFF*, uint32);
00268 extern tsize_t TIFFTileRowSize(TIFF*);
00269 LIBEXPORT tsize_t TIFFTileSize(TIFF*);
00270 extern tsize_t TIFFVTileSize(TIFF*, uint32);
00271 extern uint32 TIFFDefaultStripSize(TIFF*, uint32);
00272 extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
00273 extern int TIFFGetMode(TIFF*);
00274 LIBEXPORT int TIFFIsTiled(TIFF*);
00275 extern int TIFFIsByteSwapped(TIFF*);
00276 extern int TIFFIsUpSampled(TIFF*);
00277 extern int TIFFIsMSB2LSB(TIFF*);
00278 extern uint32 TIFFCurrentRow(TIFF*);
00279 LIBEXPORT tdir_t TIFFCurrentDirectory(TIFF*);
00280 extern uint32 TIFFCurrentDirOffset(TIFF*);
00281 extern tstrip_t TIFFCurrentStrip(TIFF*);
00282 extern ttile_t TIFFCurrentTile(TIFF*);
00283 extern int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
00284 extern int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
00285 LIBEXPORT int TIFFLastDirectory(TIFF*);
00286 LIBEXPORT int TIFFSetDirectory(TIFF*, tdir_t);
00287 extern int TIFFSetSubDirectory(TIFF*, uint32);
00288 extern int TIFFUnlinkDirectory(TIFF*, tdir_t);
00289 LIBEXPORT int TIFFSetField(TIFF*, ttag_t, ...);
00290 extern int TIFFVSetField(TIFF*, ttag_t, va_list);
00291 LIBEXPORT int TIFFWriteDirectory(TIFF *);
00292 #if defined(__cplusplus)
00293 extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
00294 extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
00295 extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
00296 extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
00297 #else
00298 extern void TIFFPrintDirectory(TIFF*, FILE*, long);
00299 LIBEXPORT int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
00300 LIBEXPORT int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
00301 extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
00302 #endif
00303 extern int TIFFRGBAImageOK(TIFF*, char [1024]);
00304 extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
00305 extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
00306 extern void TIFFRGBAImageEnd(TIFFRGBAImage*);
00307 extern TIFF* TIFFOpen(const UNICODE*, const char*);
00308 extern TIFF* TIFFClientOpen(const UNICODE*, const char*, thandle_t, TIFFReadWriteProc, TIFFReadWriteProc, TIFFSeekProc, TIFFCloseProc, TIFFSizeProc, TIFFMapFileProc, TIFFUnmapFileProc);
00309 extern UNICODE* TIFFFileName(TIFF*);
00310 extern void TIFFError(const char*, const char*, ...);
00311 extern void TIFFErrorUC(const UNICODE*, const char*, ...);
00312 extern void TIFFWarning(const char*, const char*, ...);
00313 extern void TIFFWarningUC(const UNICODE*, const char*, ...);
00314 LIBEXPORT TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
00315 LIBEXPORT TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
00316 extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
00317 LIBEXPORT ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
00318 extern int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
00319 extern ttile_t TIFFNumberOfTiles(TIFF*);
00320 LIBEXPORT tsize_t TIFFReadTile(TIFF*, tdata_t, uint32, uint32, uint32, tsample_t);
00321 LIBEXPORT tsize_t TIFFWriteTile(TIFF*, tdata_t, uint32, uint32, uint32, tsample_t);
00322 extern tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t);
00323 extern tstrip_t TIFFNumberOfStrips(TIFF*);
00324 LIBEXPORT tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
00325 extern tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
00326 LIBEXPORT tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
00327 extern tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
00328 LIBEXPORT tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
00329 extern tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
00330 LIBEXPORT tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
00331 extern tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
00332 extern void TIFFSetWriteOffset(TIFF*, toff_t);
00333 extern void TIFFSwabShort(uint16*);
00334 extern void TIFFSwabLong(uint32*);
00335 extern void TIFFSwabDouble(double*);
00336 extern void TIFFSwabArrayOfShort(uint16*, unsigned long);
00337 extern void TIFFSwabArrayOfLong(uint32*, unsigned long);
00338 extern void TIFFSwabArrayOfDouble(double*, unsigned long);
00339 extern void TIFFReverseBits(unsigned char *, unsigned long);
00340 extern const unsigned char* TIFFGetBitRevTable(int);
00341 #if defined(__cplusplus)
00342 }
00343 #endif
00344
00345 #undef LIBEXPORT
00346
00347
00348
00349 #endif