TiffDecode.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef min
  15. #define min(x, y) ((x > y) ? y : x)
  16. #define max(x, y) ((x < y) ? y : x)
  17. #endif
  18. #ifndef _PIL_LIBTIFF_
  19. #define _PIL_LIBTIFF_
  20. typedef struct {
  21. tdata_t data; /* tdata_t == void* */
  22. toff_t loc; /* toff_t == uint32 */
  23. tsize_t size; /* tsize_t == int32 */
  24. int fp;
  25. uint32_t ifd; /* offset of the ifd, used for multipage
  26. * Should be uint32 for libtiff 3.9.x
  27. * uint64 for libtiff 4.0.x
  28. */
  29. TIFF *tiff; /* Used in write */
  30. toff_t eof;
  31. int flrealloc; /* may we realloc */
  32. } TIFFSTATE;
  33. extern int
  34. ImagingLibTiffInit(ImagingCodecState state, int fp, uint32_t offset);
  35. extern int
  36. ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp);
  37. extern int
  38. ImagingLibTiffMergeFieldInfo(
  39. ImagingCodecState state, TIFFDataType field_type, int key, int is_var_length);
  40. extern int
  41. 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