Pillow/src/libImaging/TiffDecode.h

67 lines
1.4 KiB
C
Raw Normal View History

/*
* The Python Imaging Library.
* $Id: //modules/pil/libImaging/Tiff.h#1 $
*
* declarations for the LibTiff-based Group3 and Group4 decoder
*
*/
#ifndef _TIFFIO_
#include <tiffio.h>
#endif
#ifndef _TIFF_
#include <tiff.h>
#endif
2014-03-19 21:06:33 +04:00
/* UNDONE -- what are we using from this? */
/*#ifndef _UNISTD_H
# include <unistd.h>
# endif
*/
2013-03-15 00:25:23 +04:00
#ifndef min
2021-01-03 06:17:51 +03:00
#define min(x, y) ((x > y) ? y : x)
#define max(x, y) ((x < y) ? y : x)
#endif
#ifndef _PIL_LIBTIFF_
#define _PIL_LIBTIFF_
typedef struct {
2020-05-01 15:08:57 +03:00
tdata_t data; /* tdata_t == void* */
toff_t loc; /* toff_t == uint32 */
tsize_t size; /* tsize_t == int32 */
int fp;
2021-01-03 06:17:51 +03:00
uint32 ifd; /* offset of the ifd, used for multipage
* Should be uint32 for libtiff 3.9.x
* uint64 for libtiff 4.0.x
*/
TIFF *tiff; /* Used in write */
2020-05-01 15:08:57 +03:00
toff_t eof;
2021-01-03 06:17:51 +03:00
int flrealloc; /* may we realloc */
} TIFFSTATE;
2021-01-03 06:17:51 +03:00
extern int
ImagingLibTiffInit(ImagingCodecState state, int fp, uint32 offset);
extern int
ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp);
extern int
ImagingLibTiffMergeFieldInfo(
ImagingCodecState state, TIFFDataType field_type, int key, int is_var_length);
extern int
ImagingLibTiffSetField(ImagingCodecState state, ttag_t tag, ...);
2016-06-17 13:03:21 +03:00
/*
Trace debugging
2015-10-11 13:27:18 +03:00
legacy, don't enable for Python 3.x, unicode issues.
*/
2013-03-15 01:38:49 +04:00
/*
2020-05-01 15:08:57 +03:00
#define VA_ARGS(...) __VA_ARGS__
#define TRACE(args) fprintf(stderr, VA_ARGS args)
2013-03-15 01:38:49 +04:00
*/
#define TRACE(args)
#endif