Import the current wip animation datatype and subclasses. further development will...
[AROS.git] / workbench / classes / datatypes / gifanim / encoder.h
blob08bad92ca63bca2e661987973af0144ca7bf21ec
2 #ifndef ENCODER_H
3 #define ENCODER_H 1
5 /*
6 **
7 ** $VER: encoder.h 2.2 (13.4.98)
8 ** gifanim.datatype 2.2
9 **
10 ** GIF Encoder header of gifanim.datatype
12 ** Written 1997/1998 by Roland 'Gizzy' Mainz
13 ** Original example source from David N. Junod
17 /* project includes */
18 #include "classbase.h"
20 /* ansi includes */
21 #include <limits.h>
22 #include <ctype.h>
24 /*****************************************************************************/
26 /* General DEFINEs */
27 #define HSIZE (5003) /* 80% occupancy */
29 /*****************************************************************************/
31 /* a code_int must be able to hold 2**BITS values of type int, and also -1 */
32 typedef int code_int;
33 typedef long int count_int;
35 /*****************************************************************************/
37 /* encoder context data */
38 struct GIFEncoder
40 struct ClassBase *classbase;
42 Object *object;
43 struct adtFrame loadmsg;
44 struct BitMap *srcbm;
45 UBYTE *srcchunkymap[ 2 ],
46 *currchunkymap;
47 struct RastPort rpa8tmprp;
48 struct RastPort rp;
49 UWORD whichbm; /* which source bm ? */
51 /* prefs */
52 BOOL interlace;
53 WORD backgroundpen;
54 WORD transparentpen;
56 /* attrs */
58 ULONG animwidth,
59 animheight,
60 animdepth,
61 numcolors;
62 ULONG tpf;
63 BPTR outfile;
65 int Width,
66 Height;
67 int curx,
68 cury;
69 long CountDown;
70 int Pass/* = 0*/;
71 int Interlace;
73 int n_bits; /* number of bits/code */
74 code_int maxcode; /* maximum code, given n_bits */
76 count_int htab[ HSIZE ];
77 unsigned short codetab[ HSIZE ];
79 code_int free_ent /* = 0*/; /* first unused entry */
81 /* block compression parameters -- after all codes are used up, and compression rate changes, start over. */
82 BOOL clear_flg /* = 0*/;
83 int g_init_bits;
84 int ClearCode;
85 int EOFCode;
87 unsigned long cur_accum/* = 0*/;
88 int cur_bits/* = 0*/;
90 char accum[ 256 ]; /* Define the storage for the packet accumulator */
91 int a_count; /* Number of characters so far in this 'packet' */
94 #endif /* !ENCODER_H */