File: gif_image.H

package info (click to toggle)
xjig 2.4-14.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 892 kB
  • sloc: cpp: 10,177; makefile: 1,142; perl: 23
file content (48 lines) | stat: -rw-r--r-- 962 bytes parent folder | download | duplicates (4)
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
#ifndef __gif_image_h
#define __gif_image_h

#include "base_image.H"

class Extension {
	public:
		Extension(unsigned char code_in,class Extension *n)
			{ code=code_in; data=new char[1]; len=0; next=n; }
		~Extension()		{
				if (next)	delete next;
				if (data)	delete data;
		}
		void AddData( char *ndata, int nlen );

	private:
		unsigned char		code;
		char					*data;
		int					len;
		class Extension	*next;

	friend class GifImage;
};

class GifImage : public Image {
	public:
		GifImage( const char *filename, int autocrop=1 );
		GifImage();
		~GifImage();

		const char *GetExtensionData( unsigned char code );

	protected:
		int LoadImageFile(const char *fname);
		int ReadImageData(FILE *fp);			// read raw raster data into buffer
		int DecodeImage();						// decode data into image
		static int ReadCode();
		void AddToPixel(byte Index);
#if (0)
		int ColorDicking();
#endif
		void ReadColormap(FILE *fp);

	protected:
		Extension	*first;
};

#endif