Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Imaging/libImaging/Lzw.h
blob: 3e6faa2e111d221f4b681188add5f3c8758cae13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * 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;