File: gifx_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 (66 lines) | stat: -rw-r--r-- 1,448 bytes parent folder | download | duplicates (9)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef __gifx_image_h
#define __gifx_image_h

#include "gif_image.H"

class GifXImage : public GifImage {
	public:
		GifXImage( class Port *port, const char *filename, int autocrop=0);
		~GifXImage();

	// Size Information
		int   XWidth()							{  return xwidth; }
		int   XHeight()						{  return xheight; }
		void GetXSize( int *w, int *h )	{ *w=xwidth; *h=xheight; }

		void CreateData( int w, int h );
		void SetupMapper();
		void SetupTrueMapper();
		void TraceMapper();

		XImage *GetImage() {
			if (!ximage)		CreateData(xwidth,xheight);
			return ximage;
		}
		unsigned long GetPixel( int x, int y );

	public:
		void DropData();
		void Reset8();
		void Reset16();
		void Reset32();

		Display	*dpy;
		int		scr;

		XImage	*ximage;
		int		xwidth, xheight;
		int		offset_rows;		// rows befor and ahead of the image
		int		offset_bytes;		// to prevent overwrite when optimized

		unsigned long		*gif_cols;
		class Port			*p;
};

class GifPixmap : public GifXImage {
	public:
		GifPixmap( class Port *port, const char *filename, int autocrop=0);
		~GifPixmap();

		Pixmap	GetPixmap();
		void CreateData( int w, int h );

		int		Width()	{ return GifXImage::Width()/xmult; }
		int		Height()	{ return GifXImage::Height()/ymult; }
		int		XWidth()	{ return GifXImage::XWidth()/xmult; }
		int		XHeight()	{ return GifXImage::XHeight()/ymult; }

		int		IsTwinPixmap()		{ return ymult==2; }

	private:
		Pixmap	pixmap;

		int		xmult,ymult;
};

#endif