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
|
2021-01-03 06:17:51 +03:00
|
|
|
#define min(x, y) ((x > y) ? y : x)
|
|
|
|
#define max(x, y) ((x < y) ? y : x)
|
2013-03-09 07:51:10 +04:00
|
|
|
#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-04-30 17:51:39 +03:00
|
|
|
uint32_t ifd; /* offset of the ifd, used for multipage
|
|
|
|
* Should be uint32 for libtiff 3.9.x
|
|
|
|
* uint64 for libtiff 4.0.x
|
|
|
|
*/
|
2021-01-03 06:17:51 +03:00
|
|
|
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 */
|
2013-03-09 07:51:10 +04:00
|
|
|
} TIFFSTATE;
|
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
extern int
|
2021-04-30 17:51:39 +03:00
|
|
|
ImagingLibTiffInit(ImagingCodecState state, int fp, uint32_t offset);
|
2021-01-03 06:17:51 +03:00
|
|
|
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, ...);
|
2013-03-09 07:51:10 +04:00
|
|
|
|
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
|
|
|
/*
|
2020-05-01 15:08:57 +03:00
|
|
|
#define VA_ARGS(...) __VA_ARGS__
|
2013-03-09 07:51:10 +04:00
|
|
|
#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
|