Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
gifencode.h
Go to the documentation of this file.
1/* @(#)root/x11:$Id$ */
2/* Author: S.Linev 20/04/2026 */
3/* C++ interface for gifencode.c */
4
5
6#ifndef gifencode_h
7#define gifencode_h
8
9#include <cstdio>
10#include <cstdlib>
11#include <cstring>
12
13
15
16 private:
17
18 enum { HSIZE = 5003 }; /* hash table size */
19
20 unsigned long cur_accum = 0;
21 int cur_bits = 0;
22 int a_count = 0;
23
24 int BitsPixel = 0; /* number of bits per pixel */
25 int IniCodeSize = 0; /* initial number of bits per code */
26 int CurCodeSize = 0; /* current number of bits per code */
27 int CurMaxCode = 0; /* maximum code, given CurCodeSize */
28 int ClearCode = 0; /* reset code */
29 int EOFCode = 0; /* end of file code */
30 int FreeCode = 0; /* first unused entry */
31
32 long HashTab [HSIZE]; /* hash table */
33 int CodeTab [HSIZE]; /* code table */
34 unsigned char accum[256];
35
36 long fNbyte = 0;
37 FILE *fOut = nullptr;
38
39 void put_byte(unsigned char b);
40 void char_init();
41 void char_out(unsigned char c);
42 void char_flush();
43 void put_short(int word);
44 void output(int code);
45
46 protected:
47
48 virtual void get_scline(int y, int width, unsigned char *buf) = 0;
49
50 public:
51 virtual ~TGifEncode() { CloseFile(); }
52
53 bool OpenFile(const char *fname, const char *opt = "w+");
54 void CloseFile();
55
56 long GIFencode(int Width, int Height, int Ncol, unsigned char *R, unsigned char *G, unsigned char *B);
57};
58
59
60#endif
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define R(a, b, c, d, e, f, g, h, i)
Definition RSha256.hxx:110
virtual void get_scline(int y, int width, unsigned char *buf)=0
void char_init()
Definition gifencode.cxx:37
int BitsPixel
Definition gifencode.h:24
virtual ~TGifEncode()
Definition gifencode.h:51
unsigned char accum[256]
Definition gifencode.h:34
unsigned long cur_accum
Definition gifencode.h:20
int EOFCode
Definition gifencode.h:29
int IniCodeSize
Definition gifencode.h:25
int CodeTab[HSIZE]
Definition gifencode.h:33
int FreeCode
Definition gifencode.h:30
int cur_bits
Definition gifencode.h:21
bool OpenFile(const char *fname, const char *opt="w+")
Definition gifencode.cxx:23
int ClearCode
Definition gifencode.h:28
void CloseFile()
Definition gifencode.cxx:29
void put_byte(unsigned char b)
Definition gifencode.cxx:15
long GIFencode(int Width, int Height, int Ncol, unsigned char *R, unsigned char *G, unsigned char *B)
void put_short(int word)
Definition gifencode.cxx:61
int a_count
Definition gifencode.h:22
int CurCodeSize
Definition gifencode.h:26
long HashTab[HSIZE]
Definition gifencode.h:32
long fNbyte
Definition gifencode.h:36
void char_out(unsigned char c)
Definition gifencode.cxx:44
void output(int code)
Definition gifencode.cxx:76
int CurMaxCode
Definition gifencode.h:27
void char_flush()
Definition gifencode.cxx:51
FILE * fOut
Definition gifencode.h:37
Double_t y[n]
Definition legend1.C:17
#define G(x, y, z)
int width
Definition main.c:107