2013-03-09 07:51:10 +04:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
2013-03-09 07:51:10 +04:00
|
|
|
#ifndef min
|
|
|
|
#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 {
|
|
|
|
tdata_t data; /* tdata_t == void* */
|
|
|
|
toff_t loc; /* toff_t == uint32 */
|
|
|
|
tsize_t size; /* tsize_t == int32 */
|
|
|
|
int fp;
|
2016-01-14 15:31:24 +03:00
|
|
|
uint32 ifd; /* offset of the ifd, used for multipage
|
|
|
|
* Should be uint32 for libtiff 3.9.x
|
2016-06-17 13:03:21 +03:00
|
|
|
* uint64 for libtiff 4.0.x
|
2016-01-14 15:31:24 +03:00
|
|
|
*/
|
|
|
|
TIFF *tiff; /* Used in write */
|
2013-03-09 07:51:10 +04:00
|
|
|
toff_t eof;
|
2016-01-14 15:31:24 +03:00
|
|
|
int flrealloc;/* may we realloc */
|
2013-03-09 07:51:10 +04:00
|
|
|
} TIFFSTATE;
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-21 22:02:01 +04:00
|
|
|
extern int ImagingLibTiffInit(ImagingCodecState state, int fp, int offset);
|
2013-03-09 07:51:10 +04:00
|
|
|
extern int ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp);
|
|
|
|
extern int ImagingLibTiffSetField(ImagingCodecState state, ttag_t tag, ...);
|
|
|
|
|
|
|
|
|
2016-06-17 13:03:21 +03:00
|
|
|
/*
|
2014-06-19 03:08:50 +04:00
|
|
|
Trace debugging
|
2015-10-11 13:27:18 +03:00
|
|
|
legacy, don't enable for Python 3.x, unicode issues.
|
2014-06-19 03:08:50 +04:00
|
|
|
*/
|
2013-03-13 09:54:13 +04:00
|
|
|
|
2013-03-15 01:38:49 +04:00
|
|
|
/*
|
2013-03-09 07:51:10 +04:00
|
|
|
#define VA_ARGS(...) __VA_ARGS__
|
|
|
|
#define TRACE(args) fprintf(stderr, VA_ARGS args)
|
2013-03-15 01:38:49 +04:00
|
|
|
*/
|
2013-03-09 07:51:10 +04:00
|
|
|
|
2013-03-13 09:54:13 +04:00
|
|
|
#define TRACE(args)
|
2013-03-14 20:03:18 +04:00
|
|
|
|
2013-07-01 02:42:19 +04:00
|
|
|
#endif
|