Fredrik Lundh is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

effbot / pil-2009-raclette http://effbot.org/zone/pil-index.htm

Work repository for PIL 1.1.7 and beyond. The "default" branch should be fairly solid, the other branches less so. For production use, see the pil-117 repository.

Clone this repository (size: 1.6 MB): HTTPS / SSH
hg clone https://bitbucket.org/effbot/pil-2009-raclette
hg clone ssh://hg@bitbucket.org/effbot/pil-2009-raclette
/*
 * The Python Imaging Library.
 * $Id: Zip.h 2134 2004-10-06 08:55:20Z fredrik $
 *
 * declarations for the ZIP codecs
 *
 * Copyright (c) Fredrik Lundh 1996.
 */


#include "zlib.h"


/* modes */
#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 */


typedef struct {

    /* CONFIGURATION */

    /* Codec mode */
    int mode;

    /* Optimize (max compression) SLOW!!! */
    int optimize;

    /* Predefined dictionary (experimental) */
    char* dictionary;
    int dictionary_size;

    /* PRIVATE CONTEXT (set by decoder/encoder) */

    z_stream z_stream;          /* (de)compression stream */

    UINT8* previous;            /* previous line (allocated) */

    int last_output;            /* # bytes last output by inflate */

    /* Compressor specific stuff */
    UINT8* prior;               /* filter storage (allocated) */
    UINT8* up;
    UINT8* average;
    UINT8* paeth;

    UINT8* output;              /* output data */

    int prefix;                 /* size of filter prefix (0 for TIFF data) */

} ZIPSTATE;