52 int w_, h_, d_, ld_, count_;
53 const char *
const *data_;
64 void w(
int W) {w_ = W;}
68 void h(
int H) {h_ = H;}
72 void d(
int D) {d_ = D;}
76 void ld(
int LD) {ld_ = LD;}
80 void data(
const char *
const *p,
int c) {data_ = p; count_ = c;}
81 void draw_empty(
int X,
int Y);
83 static void labeltype(
const Fl_Label *lo,
int lx,
int ly,
int lw,
int lh,
Fl_Align la);
84 static void measure(
const Fl_Label *lo,
int &lw,
int &lh);
91 int w()
const {
return w_;}
94 int h()
const {
return h_;}
100 int d()
const {
return d_;}
106 int ld()
const {
return ld_;}
118 const char *
const *
data()
const {
return data_;}
126 Fl_Image(
int W,
int H,
int D) {w_ = W; h_ = H; d_ = D; ld_ = 0; count_ = 0; data_ = 0;}
128 virtual Fl_Image *copy(
int W,
int H);
137 virtual void color_average(
Fl_Color c,
float i);
145 virtual void desaturate();
155 virtual void draw(
int X,
int Y,
int W,
int H,
int cx=0,
int cy=0);
160 void draw(
int X,
int Y) {
draw(X, Y, w(), h(), 0, 0);}
161 virtual void uncache();
186 #if defined(__APPLE__) || defined(WIN32)
192 #endif // __APPLE__ || WIN32
198 Fl_Image(W,H,D), array(bits), alloc_array(0), id_(0), mask_(0) {
data((
const char **)&array, 1);
ld(LD);}
204 virtual void draw(
int X,
int Y,
int W,
int H,
int cx=0,
int cy=0);
205 void draw(
int X,
int Y) {
draw(X, Y,
w(),
h(), 0, 0);}
211 #endif // !Fl_Image_H
void d(int D)
Sets the current image depth.
Definition: Fl_Image.H:72
Fl_Image(int W, int H, int D)
The constructor creates an empty image with the specified width, height, and depth.
Definition: Fl_Image.H:126
virtual void desaturate()
The desaturate() method converts an image to grayscale.
Definition: Fl_Image.cxx:108
virtual void label(Fl_Widget *w)
The label() methods are an obsolete way to set the image attribute of a widget or menu item...
Definition: Fl_Image.cxx:118
void ld(int LD)
Sets the current line data size in bytes.
Definition: Fl_Image.H:76
The Mac OS X-specific graphics class.
Definition: Fl_Device.H:406
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0)
The constructor creates a new image from the specified data.
Definition: Fl_Image.H:197
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:51
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:175
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:61
void inactive()
The inactive() method calls color_average(FL_BACKGROUND_COLOR, 0.33f) to produce an image that appear...
Definition: Fl_Image.H:144
This file contains type definitions and general enumerations.
Fl_Image * copy()
The copy() method creates a copy of the specified image.
Definition: Fl_Image.H:136
The Xlib-specific graphics class.
Definition: Fl_Device.H:469
void w(int W)
Sets the current image width in pixels.
Definition: Fl_Image.H:64
const char *const * data() const
Returns a pointer to the current image data array.
Definition: Fl_Image.H:118
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:73
void h(int H)
Sets the current image height in pixels.
Definition: Fl_Image.H:68
int ld() const
Returns the current line data size in bytes.
Definition: Fl_Image.H:106
int d() const
Returns the current image depth.
Definition: Fl_Image.H:100
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:99
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:769
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:663
void data(const char *const *p, int c)
Sets the current array pointer and count of pointers in the array.
Definition: Fl_Image.H:80
int w() const
Returns the current image width in pixels.
Definition: Fl_Image.H:91
virtual void uncache()
If the image has been cached for display, delete the cache data.
Definition: Fl_Image.cxx:58
int h() const
Returns the current image height in pixels.
Definition: Fl_Image.H:94
int count() const
The count() method returns the number of data values associated with the image.
Definition: Fl_Image.H:113
The MSWindows-specific graphics class.
Definition: Fl_Device.H:439
void draw(int X, int Y)
Draws the image.
Definition: Fl_Image.H:160
unsigned char uchar
unsigned char
Definition: fl_types.h:39