TiffDecode.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * The Python Imaging Library.
  3. * $Id: //modules/pil/libImaging/Tiff.h#1 $
  4. *
  5. * declarations for the LibTiff-based Group3 and Group4 decoder
  6. *
  7. */
  8. #ifndef _TIFFIO_
  9. #include <tiffio.h>
  10. #endif
  11. #ifndef _TIFF_
  12. #include <tiff.h>
  13. #endif
  14. /* UNDONE -- what are we using from this? */
  15. /*#ifndef _UNISTD_H
  16. # include <unistd.h>
  17. # endif
  18. */
  19. #ifndef min
  20. #define min(x,y) (( x > y ) ? y : x )
  21. #define max(x,y) (( x < y ) ? y : x )
  22. #endif
  23. #ifndef _PIL_LIBTIFF_
  24. #define _PIL_LIBTIFF_
  25. typedef struct {
  26. tdata_t data; /* tdata_t == void* */
  27. toff_t loc; /* toff_t == uint32 */
  28. tsize_t size; /* tsize_t == int32 */
  29. int fp;
  30. uint32 ifd; /* offset of the ifd, used for multipage
  31. * Should be uint32 for libtiff 3.9.x
  32. * uint64 for libtiff 4.0.x
  33. */
  34. TIFF *tiff; /* Used in write */
  35. toff_t eof;
  36. int flrealloc;/* may we realloc */
  37. } TIFFSTATE;
  38. extern int ImagingLibTiffInit(ImagingCodecState state, int fp, uint32 offset);
  39. extern int ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp);
  40. extern int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_type, int key, int is_var_length);
  41. extern int ImagingLibTiffSetField(ImagingCodecState state, ttag_t tag, ...);
  42. /*
  43. Trace debugging
  44. legacy, don't enable for Python 3.x, unicode issues.
  45. */
  46. /*
  47. #define VA_ARGS(...) __VA_ARGS__
  48. #define TRACE(args) fprintf(stderr, VA_ARGS args)
  49. */
  50. #define TRACE(args)
  51. #endif