1 #ifndef __gifx_image_h 2 #define __gifx_image_h 3 4 #include "gif_image.H" 5 6 class GifXImage : public GifImage { 7 public: 8 GifXImage( class Port *port, const char *filename, int autocrop=0); 9 ~GifXImage(); 10 11 // Size Information XWidth()12 int XWidth() { return xwidth; } XHeight()13 int XHeight() { return xheight; } GetXSize(int * w,int * h)14 void GetXSize( int *w, int *h ) { *w=xwidth; *h=xheight; } 15 16 void CreateData( int w, int h ); 17 void SetupMapper(); 18 void SetupTrueMapper(); 19 void TraceMapper(); 20 GetImage()21 XImage *GetImage() { 22 if (!ximage) CreateData(xwidth,xheight); 23 return ximage; 24 } 25 unsigned long GetPixel( int x, int y ); 26 27 public: 28 void DropData(); 29 void Reset8(); 30 void Reset16(); 31 void Reset32(); 32 void Reset24(); 33 34 Display *dpy; 35 int scr; 36 37 XImage *ximage; 38 int xwidth, xheight; 39 int offset_rows; // rows befor and ahead of the image 40 int offset_bytes; // to prevent overwrite when optimized 41 42 unsigned long *gif_cols; 43 class Port *p; 44 }; 45 46 class GifPixmap : public GifXImage { 47 public: 48 GifPixmap( class Port *port, const char *filename, int autocrop=0); 49 ~GifPixmap(); 50 51 Pixmap GetPixmap(); 52 void CreateData( int w, int h ); 53 Width()54 int Width() { return GifXImage::Width()/xmult; } Height()55 int Height() { return GifXImage::Height()/ymult; } XWidth()56 int XWidth() { return GifXImage::XWidth()/xmult; } XHeight()57 int XHeight() { return GifXImage::XHeight()/ymult; } 58 IsTwinPixmap()59 int IsTwinPixmap() { return ymult==2; } 60 61 private: 62 Pixmap pixmap; 63 64 int xmult,ymult; 65 }; 66 67 #endif 68