31#ifndef Fl_Shared_Image_H
32# define Fl_Shared_Image_H
38typedef Fl_Image *(*Fl_Shared_Handler)(
const char *name,
uchar *header,
51 friend class Fl_JPEG_Image;
52 friend class Fl_PNG_Image;
57 static int num_images_;
58 static int alloc_images_;
59 static Fl_Shared_Handler *handlers_;
60 static int num_handlers_;
61 static int alloc_handlers_;
80 const char *
name() {
return name_; }
90 virtual void draw(
int X,
int Y,
int W,
int H,
int cx,
int cy);
91 void draw(
int X,
int Y) {
draw(X, Y,
w(),
h(), 0, 0); }
94 static Fl_Shared_Image *find(
const char *n,
int W = 0,
int H = 0);
95 static Fl_Shared_Image *get(
const char *n,
int W = 0,
int H = 0);
96 static Fl_Shared_Image **images();
97 static int num_images();
98 static void add_handler(Fl_Shared_Handler f);
99 static void remove_handler(Fl_Shared_Handler f);
unsigned int Fl_Color
an FLTK color value
Definition Enumerations.H:764
FL_EXPORT void fl_register_images()
Register the image formats.
Definition fl_images_core.cxx:63
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition Fl_Image.H:51
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0)
Draws the image with a bounding box.
Definition Fl_Image.cxx:63
virtual void desaturate()
The desaturate() method converts an image to grayscale.
Definition Fl_Image.cxx:110
virtual void color_average(Fl_Color c, float i)
The color_average() method averages the colors in the image with the FLTK color value c.
Definition Fl_Image.cxx:101
int w() const
Returns the current image width in pixels.
Definition Fl_Image.H:91
Fl_Image * copy()
The copy() method creates a copy of the specified image.
Definition Fl_Image.H:136
int h() const
Returns the current image height in pixels.
Definition Fl_Image.H:94
virtual void uncache()
If the image has been cached for display, delete the cache data.
Definition Fl_Image.cxx:60
const char * name()
Returns the filename of the shared image.
Definition Fl_Shared_Image.H:80
Fl_Shared_Image()
Creates an empty shared image.
Definition Fl_Shared_Image.cxx:95
int refcount()
Returns the number of references of this shared image.
Definition Fl_Shared_Image.H:82
unsigned char uchar
unsigned char
Definition fl_types.h:39