61 friend class Fl_Graphics_Driver;
63 static const int ERR_NO_IMAGE = -1;
64 static const int ERR_FILE_ACCESS = -2;
65 static const int ERR_FORMAT = -3;
66 static const int ERR_MEMORY_ACCESS = -4;
69 int w_, h_, d_, ld_, count_;
71 const char *
const *data_;
78 virtual void cache_size_(
int &,
int &) {}
87 void w(
int W) {w_ = W; data_w_ = W;}
93 void h(
int H) {h_ = H; data_h_ = H;}
97 void d(
int D) {d_ = D;}
109 void ld(
int LD) {ld_ = LD;}
117 void data(
const char *
const *p,
int c) {data_ = p; count_ = c;}
118 void draw_empty(
int X,
int Y);
120 static void labeltype(
const Fl_Label *lo,
int lx,
int ly,
int lw,
int lh,
Fl_Align la);
121 static void measure(
const Fl_Label *lo,
int &lw,
int &lh);
122 int draw_scaled(
int X,
int Y,
int W,
int H);
131 int w()
const {
return w_;}
137 int h()
const {
return h_;}
151 int d()
const {
return d_;}
156 int ld()
const {
return ld_;}
191 const char *
const *
data()
const {
return data_;}
239 virtual Fl_Image *copy(
int W,
int H)
const;
267 virtual void color_average(
Fl_Color c,
float i);
280 virtual void desaturate();
294 virtual void draw(
int X,
int Y,
int W,
int H,
int cx=0,
int cy=0);
299 void draw(
int X,
int Y) {
draw(X, Y, w(), h(), 0, 0);}
300 virtual void uncache();
311 virtual void scale(
int width,
int height,
int proportional = 1,
int can_expand = 0);
340 friend class Fl_Graphics_Driver;
341 static size_t max_size_;
356 int cache_w_, cache_h_;
367 void draw(
int X,
int Y,
int W,
int H,
int cx=0,
int cy=0)
FL_OVERRIDE;
368 void draw(
int X,
int Y) {draw(X, Y, w(), h(), 0, 0);}
372 int cache_w() {
return cache_w_;}
373 int cache_h() {
return cache_h_;}
383 static void max_size(
size_t size) { max_size_ = size;}
This file contains type definitions and general enumerations.
unsigned Fl_Align
FLTK type for alignment control.
Definition Enumerations.H:967
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition Enumerations.H:1101
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition Enumerations.H:816
Fl_RGB_Scaling
The scaling algorithm to use for RGB images.
Definition Fl_Image.H:36
@ FL_RGB_SCALING_NEAREST
default RGB image scaling algorithm
Definition Fl_Image.H:37
@ FL_RGB_SCALING_BILINEAR
more accurate, but slower RGB image scaling algorithm
Definition Fl_Image.H:38
Base class for image caching, scaling and drawing.
Definition Fl_Image.H:60
int count() const
Returns the number of data values associated with the image.
Definition Fl_Image.H:165
void d(int D)
Sets the current image depth.
Definition Fl_Image.H:97
void draw(int X, int Y)
Draws the image to the current drawing surface.
Definition Fl_Image.H:299
static void scaling_algorithm(Fl_RGB_Scaling algorithm)
Sets what algorithm is used when resizing a source image to draw it.
Definition Fl_Image.H:320
void data(const char *const *p, int c)
Sets the current data pointer and count of pointers in the array.
Definition Fl_Image.H:117
const char *const * data() const
Returns a pointer to the current image data array.
Definition Fl_Image.H:191
int data_h() const
Returns the height of the image data.
Definition Fl_Image.H:145
void h(int H)
Sets the height of the image data.
Definition Fl_Image.H:93
int w() const
Returns the current image drawing width in FLTK units.
Definition Fl_Image.H:131
virtual class Fl_Shared_Image * as_shared_image()
Returns whether an image is an Fl_Shared_Image or not.
Definition Fl_Image.H:233
void ld(int LD)
Sets the current line data size in bytes.
Definition Fl_Image.H:109
Fl_Image * copy() const
Creates a copy of the image in the same size.
Definition Fl_Image.H:266
static Fl_RGB_Scaling scaling_algorithm()
Gets what algorithm is used when resizing a source image to draw it.
Definition Fl_Image.H:322
virtual void release()
Releases an Fl_Image - the same as 'delete this'.
Definition Fl_Image.H:220
int data_w() const
Returns the width of the image data.
Definition Fl_Image.H:141
void w(int W)
Sets the width of the image data.
Definition Fl_Image.H:87
static bool register_images_done
True after fl_register_images() was called, false before.
Definition Fl_Image.H:323
int ld() const
Returns the current line data size in bytes.
Definition Fl_Image.H:156
void inactive()
The inactive() method calls color_average(FL_BACKGROUND_COLOR, 0.33f) to produce an image that appear...
Definition Fl_Image.H:279
int h() const
Returns the current image drawing height in FLTK units.
Definition Fl_Image.H:137
int d() const
Returns the image depth.
Definition Fl_Image.H:151
The Fl_Pixmap class supports caching and drawing of colormap (pixmap) images, including transparency.
Definition Fl_Pixmap.H:36
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition Fl_Image.H:339
const uchar * array
Points to the start of the object's data array.
Definition Fl_Image.H:347
virtual Fl_SVG_Image * as_svg_image()
Returns whether an image is an Fl_SVG_Image or not.
Definition Fl_Image.H:391
static size_t max_size()
Returns the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
Definition Fl_Image.H:388
int alloc_array
If non-zero, the object's data array is delete[]'d when deleting the object.
Definition Fl_Image.H:350
virtual void normalize()
Makes sure the object is fully initialized.
Definition Fl_Image.H:394
static void max_size(size_t size)
Sets the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
Definition Fl_Image.H:383
The Fl_SVG_Image class supports loading, caching and drawing of scalable vector graphics (SVG) images...
Definition Fl_SVG_Image.H:135
This class supports caching, loading, and drawing of image files.
Definition Fl_Shared_Image.H:94
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
unsigned char uchar
unsigned char
Definition fl_types.h:30
This struct stores all information for a text or mixed graphics label.
Definition Fl_Widget.H:49