2010-07-31 06:52:47 +04:00
|
|
|
/*
|
|
|
|
* The Python Imaging Library.
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* declarations for the ZIP codecs
|
|
|
|
*
|
|
|
|
* Copyright (c) Fredrik Lundh 1996.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "zlib.h"
|
|
|
|
|
|
|
|
/* modes */
|
2020-05-01 15:08:57 +03:00
|
|
|
#define ZIP_PNG 0 /* continuous, filtered image data */
|
|
|
|
#define ZIP_PNG_PALETTE 1 /* non-continuous data, disable filtering */
|
|
|
|
#define ZIP_TIFF_PREDICTOR 2 /* TIFF, with predictor */
|
|
|
|
#define ZIP_TIFF 3 /* TIFF, without predictor */
|
2010-07-31 06:52:47 +04:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* CONFIGURATION */
|
|
|
|
|
|
|
|
/* Codec mode */
|
|
|
|
int mode;
|
|
|
|
|
|
|
|
/* Optimize (max compression) SLOW!!! */
|
|
|
|
int optimize;
|
2013-07-01 02:42:19 +04:00
|
|
|
|
2013-03-11 23:33:04 +04:00
|
|
|
/* 0 no compression, 9 best compression, -1 default compression */
|
|
|
|
int compress_level;
|
|
|
|
/* compression strategy Z_XXX */
|
|
|
|
int compress_type;
|
2010-07-31 06:52:47 +04:00
|
|
|
|
|
|
|
/* Predefined dictionary (experimental) */
|
2021-01-03 06:17:51 +03:00
|
|
|
char *dictionary;
|
2010-07-31 06:52:47 +04:00
|
|
|
int dictionary_size;
|
|
|
|
|
|
|
|
/* PRIVATE CONTEXT (set by decoder/encoder) */
|
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
z_stream z_stream; /* (de)compression stream */
|
2010-07-31 06:52:47 +04:00
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
UINT8 *previous; /* previous line (allocated) */
|
2010-07-31 06:52:47 +04:00
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
int last_output; /* # bytes last output by inflate */
|
2010-07-31 06:52:47 +04:00
|
|
|
|
|
|
|
/* Compressor specific stuff */
|
2021-01-03 06:17:51 +03:00
|
|
|
UINT8 *prior; /* filter storage (allocated) */
|
|
|
|
UINT8 *up;
|
|
|
|
UINT8 *average;
|
|
|
|
UINT8 *paeth;
|
2010-07-31 06:52:47 +04:00
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
UINT8 *output; /* output data */
|
2010-07-31 06:52:47 +04:00
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
int prefix; /* size of filter prefix (0 for TIFF data) */
|
2013-07-01 02:42:19 +04:00
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
int interlaced; /* is the image interlaced? (PNG) */
|
2013-07-01 02:42:19 +04:00
|
|
|
|
2021-01-03 06:17:51 +03:00
|
|
|
int pass; /* current pass of the interlaced image (PNG) */
|
2010-07-31 06:52:47 +04:00
|
|
|
|
|
|
|
} ZIPSTATE;
|