home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / xjig / gifx_image.h < prev    next >
C/C++ Source or Header  |  1996-07-15  |  1KB  |  67 lines

  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
  12.         int   XWidth()                            {  return xwidth; }
  13.         int   XHeight()                        {  return xheight; }
  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.  
  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.  
  33.         Display    *dpy;
  34.         int        scr;
  35.  
  36.         XImage    *ximage;
  37.         int        xwidth, xheight;
  38.         int        offset_rows;        // rows befor and ahead of the image
  39.         int        offset_bytes;        // to prevent overwrite when optimized
  40.  
  41.         unsigned long        *gif_cols;
  42.         class Port            *p;
  43. };
  44.  
  45. class GifPixmap : public GifXImage {
  46.     public:
  47.         GifPixmap( class Port *port, const char *filename, int autocrop=0);
  48.         ~GifPixmap();
  49.  
  50.         Pixmap    GetPixmap();
  51.         void CreateData( int w, int h );
  52.  
  53.         int        Width()    { return GifXImage::Width()/xmult; }
  54.         int        Height()    { return GifXImage::Height()/ymult; }
  55.         int        XWidth()    { return GifXImage::XWidth()/xmult; }
  56.         int        XHeight()    { return GifXImage::XHeight()/ymult; }
  57.  
  58.         int        IsTwinPixmap()        { return ymult==2; }
  59.  
  60.     private:
  61.         Pixmap    pixmap;
  62.  
  63.         int        xmult,ymult;
  64. };
  65.  
  66. #endif
  67.