| 1 |
/* File : Fl_GIF_Image.i */ |
| 2 |
//%module Fl_GIF_Image |
| 3 |
|
| 4 |
%feature("docstring") ::Fl_GIF_Image |
| 5 |
""" |
| 6 |
The Fl_GIF_Image class supports loading, caching, and drawing of Compuserve |
| 7 |
GIF images. The class loads the first image and supports transparency. |
| 8 |
""" ; |
| 9 |
|
| 10 |
|
| 11 |
%{ |
| 12 |
#include "FL/Fl_GIF_Image.H" |
| 13 |
%} |
| 14 |
|
| 15 |
//%include "macros.i" |
| 16 |
//CHANGE_OWNERSHIP(Fl_GIF_Image) |
| 17 |
|
| 18 |
//%include "FL/Fl_GIF_Image.H" |
| 19 |
class FL_EXPORT Fl_GIF_Image : public Fl_Pixmap { |
| 20 |
|
| 21 |
public: |
| 22 |
|
| 23 |
Fl_GIF_Image(const char* filename); |
| 24 |
// deprecated constructor w/o length (for backwards compatibility) |
| 25 |
Fl_GIF_Image(const char* imagename, const unsigned char *data); |
| 26 |
// constructor with length (since 1.4.0) |
| 27 |
Fl_GIF_Image(const char* imagename, const unsigned char *data, const size_t length); |
| 28 |
|
| 29 |
static bool is_animated(const char *name_); |
| 30 |
/** Sets how the shared image core routine should treat animated GIF files. |
| 31 |
The default is to treat them as ordinary GIF's e.g. it creates a Fl_GIF_Image object. |
| 32 |
If this variable is set, then an animated GIF object Fl_Anim_GIF_Image is created. |
| 33 |
*/ |
| 34 |
static bool animate; |
| 35 |
|
| 36 |
protected: |
| 37 |
|
| 38 |
// Protected constructors needed for animated GIF support through Fl_Anim_GIF_Image. |
| 39 |
Fl_GIF_Image(const char* filename, bool anim); |
| 40 |
Fl_GIF_Image(const char* imagename, const unsigned char *data, const size_t length, bool anim); |
| 41 |
// Protected default constructor needed for Fl_Anim_GIF_Image. |
| 42 |
Fl_GIF_Image(); |
| 43 |
|
| 44 |
void load_gif_(class Fl_Image_Reader &rdr, bool anim=false); |
| 45 |
|
| 46 |
void load(const char* filename, bool anim); |
| 47 |
void load(const char* imagename, const unsigned char *data, const size_t length, bool anim); |
| 48 |
|
| 49 |
// Internal structure to "glue" animated GIF support into Fl_GIF_Image. |
| 50 |
// This data is passed during decoding to the Fl_Anim_GIF_Image class. |
| 51 |
|
| 52 |
/* struct GIF_FRAME { */ |
| 53 |
/* int ifrm, width, height, x, y, w, h, */ |
| 54 |
/* clrs, bkgd, trans, */ |
| 55 |
/* dispose, delay; */ |
| 56 |
/* const uchar *bptr; */ |
| 57 |
/* //const struct CPAL { */ |
| 58 |
/* // uchar r, g, b; */ |
| 59 |
/* //} *cpal; */ |
| 60 |
/* GIF_FRAME(int frame, uchar *data) : ifrm(frame), bptr(data) {} */ |
| 61 |
/* GIF_FRAME(int frame, int W, int H, int fx, int fy, int fw, int fh, uchar *data) : */ |
| 62 |
/* ifrm(frame), width(W), height(H), x(fx), y(fy), w(fw), h(fh), bptr(data) {} */ |
| 63 |
/* void disposal(int mode, int delay) { dispose = mode; this->delay = delay; } */ |
| 64 |
/* void colors(int nclrs, int bg, int tp) { clrs = nclrs; bkgd = bg; trans = tp; } */ |
| 65 |
/* }; */ |
| 66 |
|
| 67 |
/* // Internal virtual methods, which are called during decoding to pass data */ |
| 68 |
/* // to the Fl_Anim_GIF_Image class. */ |
| 69 |
/* virtual void on_frame_data(GIF_FRAME &) {} */ |
| 70 |
/* virtual void on_extension_data(GIF_FRAME &) {} */ |
| 71 |
|
| 72 |
private: |
| 73 |
|
| 74 |
//void lzw_decode(Fl_Image_Reader &rdr, uchar *Image, int Width, int Height, int CodeSize, int ColorMapSize, int Interlace); |
| 75 |
}; |