X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b47c832e5529dc6c632536b4665a005f0a85aec8..f31bbefd1070af6162b9deeda9d4e528efbc1b31:/src/tiff/tiffiop.h diff --git a/src/tiff/tiffiop.h b/src/tiff/tiffiop.h index cd46330cd5..b2286162fd 100644 --- a/src/tiff/tiffiop.h +++ b/src/tiff/tiffiop.h @@ -34,7 +34,7 @@ * a port.h file that reflects the system capabilities. * Doing this obviates all the dreck done in tiffcomp.h. */ -#if defined(unix) || defined(__unix) +#if (defined(unix) || defined(__unix)) && !defined(__DJGPP__) #include "port.h" #include "tiffconf.h" #else @@ -49,6 +49,12 @@ #define FALSE 0 #endif +typedef struct client_info { + struct client_info *next; + void *data; + char *name; +} TIFFClientInfoLink; + /* * Typedefs for ``method pointers'' used internally. */ @@ -61,9 +67,6 @@ typedef int (*TIFFPreMethod)(TIFF*, tsample_t); typedef int (*TIFFCodeMethod)(TIFF*, tidata_t, tsize_t, tsample_t); typedef int (*TIFFSeekMethod)(TIFF*, uint32); typedef void (*TIFFPostMethod)(TIFF*, tidata_t, tsize_t); -typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list); -typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list); -typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); typedef uint32 (*TIFFStripMethod)(TIFF*, uint32); typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*); @@ -89,9 +92,11 @@ struct tiff { #define TIFF_STRIPCHOP 0x8000 /* enable strip chopping support */ toff_t tif_diroff; /* file offset of current directory */ toff_t tif_nextdiroff; /* file offset of following directory */ + toff_t* tif_dirlist; /* list of offsets to already seen */ + /* directories to prevent IFD looping */ + uint16 tif_dirnumber; /* number of already seen directories */ TIFFDirectory tif_dir; /* internal rep of current directory */ TIFFHeader tif_header; /* file's header block */ - tidata_t tif_clientdir; /* client TIFF directory */ const int* tif_typeshift; /* data type shift counts */ const long* tif_typemask; /* data type masks */ uint32 tif_row; /* current scanline */ @@ -108,9 +113,11 @@ struct tiff { ttile_t tif_curtile; /* current tile for read/write */ tsize_t tif_tilesize; /* # of bytes in a tile */ /* compression scheme hooks */ + int tif_decodestatus; TIFFBoolMethod tif_setupdecode;/* called once before predecode */ TIFFPreMethod tif_predecode; /* pre- row/strip/tile decoding */ TIFFBoolMethod tif_setupencode;/* called once before preencode */ + int tif_encodestatus; TIFFPreMethod tif_preencode; /* pre- row/strip/tile encoding */ TIFFBoolMethod tif_postencode; /* post- row/strip/tile encoding */ TIFFCodeMethod tif_decoderow; /* scanline decoding routine */ @@ -149,9 +156,8 @@ struct tiff { /* tag support */ TIFFFieldInfo** tif_fieldinfo; /* sorted table of registered tags */ int tif_nfields; /* # entries in registered tag table */ - TIFFVSetMethod tif_vsetfield; /* tag set routine */ - TIFFVGetMethod tif_vgetfield; /* tag get routine */ - TIFFPrintMethod tif_printdir; /* directory print routine */ + TIFFTagMethods tif_tagmethods; /* tag get/set/print routines */ + TIFFClientInfoLink *tif_clientinfo; /* extra client information. */ }; #define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */ @@ -180,7 +186,7 @@ struct tiff { */ #ifndef ReadOK #define ReadOK(tif, buf, size) \ - (TIFFReadFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size) + (TIFFReadFile(tif, (tdata_t) buf, (tsize_t)(size)) == (tsize_t)(size)) #endif #ifndef SeekOK #define SeekOK(tif, off) \ @@ -192,8 +198,12 @@ struct tiff { #endif /* NB: the uint32 casts are to silence certain ANSI-C compilers */ -#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) -#define TIFFroundup(x, y) (TIFFhowmany(x,y)*((uint32)(y))) +#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) +#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3) +#define TIFFroundup(x, y) (TIFFhowmany(x,y)*(y)) + +#define TIFFmax(A,B) ((A)>(B)?(A):(B)) +#define TIFFmin(A,B) ((A)<(B)?(A):(B)) #if defined(__cplusplus) extern "C" { @@ -206,6 +216,7 @@ extern int _TIFFNoRowDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t); +extern int _TIFFNoPreCode (TIFF*, tsample_t); extern int _TIFFNoSeek(TIFF*, uint32); extern void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t); extern void _TIFFSwab32BitData(TIFF*, tidata_t, tsize_t);