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: Lzw.h 2134 2004-10-06 08:55:20Z fredrik $
 *
 * declarations for the TIFF LZW decoder.
 *
 * Copyright (c) Fredrik Lundh 1995-96.
 */


/* Max size for LZW code words */

#define LZWBITS     12

#define LZWTABLE    (1<<LZWBITS)
#define LZWBUFFER   (1<<LZWBITS)


typedef struct {

    /* CONFIGURATION */

    /* Filter type */
    int filter;

    /* PRIVATE CONTEXT (set by decoder) */

    /* Input bit buffer */
    INT32 bitbuffer;
    int bitcount;

    /* Code buffer */
    int codesize;
    int codemask;

    /* Constant symbol codes */
    int clear, end;

    /* Symbol history */
    int lastcode;
    unsigned char lastdata;

    /* History buffer */
    int bufferindex;
    unsigned char buffer[LZWTABLE];

    /* Symbol table */
    unsigned INT16 link[LZWTABLE];
    unsigned char data[LZWTABLE];
    int next;

} LZWSTATE;