63 friend class Fl_Graphics_Driver;
65 static const int ERR_NO_IMAGE = -1;
66 static const int ERR_FILE_ACCESS = -2;
67 static const int ERR_FORMAT = -3;
70 int w_, h_, d_, ld_, count_;
72 const char *
const *data_;
86 void w(
int W) {w_ = W; data_w_ = W;}
92 void h(
int H) {h_ = H; data_h_ = H;}
96 void d(
int D) {d_ = D;}
108 void ld(
int LD) {ld_ = LD;}
112 void data(
const char *
const *p,
int c) {data_ = p; count_ = c;}
113 void draw_empty(
int X,
int Y);
115 static void labeltype(
const Fl_Label *lo,
int lx,
int ly,
int lw,
int lh,
Fl_Align la);
116 static void measure(
const Fl_Label *lo,
int &lw,
int &lh);
117 int draw_scaled(
int X,
int Y,
int W,
int H);
126 int w()
const {
return w_;}
132 int h()
const {
return h_;}
146 int d()
const {
return d_;}
151 int ld()
const {
return ld_;}
163 const char *
const *
data()
const {
return data_;}
211 virtual Fl_Image *copy(
int W,
int H);
242 virtual void draw(
int X,
int Y,
int W,
int H,
int cx=0,
int cy=0);
259 virtual void scale(
int width,
int height,
int proportional = 1,
int can_expand = 0);
288 friend class Fl_Graphics_Driver;
289 static size_t max_size_;
304 int cache_w_, cache_h_;
315 virtual void draw(
int X,
int Y,
int W,
int H,
int cx=0,
int cy=0);
316 void draw(
int X,
int Y) {
draw(X, Y,
w(),
h(), 0, 0);}
329 static void max_size(
size_t size) { max_size_ = size;}
343 #endif // !Fl_Image_H
void d(int D)
Sets the current image depth.
Definition: Fl_Image.H:96
virtual void desaturate()
The desaturate() method converts an image to grayscale.
Definition: Fl_Image.cxx:110
default RGB image scaling algorithm
Definition: Fl_Image.H:38
The Fl_Pixmap class supports caching and drawing of colormap (pixmap) images, including transparency...
Definition: Fl_Pixmap.H:36
int data_h() const
Returns the height of the image data.
Definition: Fl_Image.H:140
int h() const
Returns the current image drawing height in FLTK units.
Definition: Fl_Image.H:132
virtual void scale(int width, int height, int proportional=1, int can_expand=0)
Sets the drawing size of the image.
Definition: Fl_Image.cxx:259
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:130
static bool register_images_done
True after fl_register_images() was called, false before.
Definition: Fl_Image.H:271
void ld(int LD)
Sets the current line data size in bytes.
Definition: Fl_Image.H:108
const char *const * data() const
Returns a pointer to the current image data array.
Definition: Fl_Image.H:163
virtual void uncache()
If the image has been cached for display, delete the cache data.
Definition: Fl_Shared_Image.cxx:377
virtual void normalize()
Makes sure the object is fully initialized.
Definition: Fl_Image.H:340
The Fl_SVG_Image class supports loading, caching and drawing of scalable vector graphics (SVG) images...
Definition: Fl_SVG_Image.H:135
virtual ~Fl_Image()
The destructor is a virtual method that frees all memory used by the image.
Definition: Fl_Image.cxx:49
Base class for image caching, scaling and drawing.
Definition: Fl_Image.H:62
int w() const
Returns the current image drawing width in FLTK units.
Definition: Fl_Image.H:126
static Fl_RGB_Scaling scaling_algorithm()
Gets what algorithm is used when resizing a source image to draw it.
Definition: Fl_Image.H:270
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:287
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0)
Draws the image to the current drawing surface with a bounding box.
Definition: Fl_Image.cxx:60
int d() const
Returns the image depth.
Definition: Fl_Image.H:146
more accurate, but slower RGB image scaling algorithm
Definition: Fl_Image.H:39
static size_t max_size()
Returns the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
Definition: Fl_Image.H:334
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_Shared_Image.cxx:334
int data_w() const
Returns the width of the image data.
Definition: Fl_Image.H:136
void inactive()
The inactive() method calls color_average(FL_BACKGROUND_COLOR, 0.33f) to produce an image that appear...
Definition: Fl_Image.H:227
This file contains type definitions and general enumerations.
Fl_Image * copy()
Creates a copy of the specified image.
Definition: Fl_Image.H:217
int alloc_array
If non-zero, the object's data array is delete[]'d when deleting the object.
Definition: Fl_Image.H:298
int ld() const
Returns the current line data size in bytes.
Definition: Fl_Image.H:151
virtual class Fl_Shared_Image * as_shared_image()
Returns whether an image is an Fl_Shared_Image or not.
Definition: Fl_Image.H:205
int count() const
The count() method returns the number of data values associated with the image.
Definition: Fl_Image.H:158
void w(int W)
Sets the width of the image data.
Definition: Fl_Image.H:86
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:48
void h(int H)
Sets the height of the image data.
Definition: Fl_Image.H:92
virtual void release()
Releases an Fl_Image - the same as 'delete this'.
Definition: Fl_Image.H:192
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; see also Colors.
Definition: Enumerations.H:1042
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:757
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:908
void data(const char *const *p, int c)
Sets the current array pointer and count of pointers in the array.
Definition: Fl_Image.H:112
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:329
This class supports caching, loading, and drawing of image files.
Definition: Fl_Shared_Image.H:49
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:268
virtual void uncache()
If the image has been cached for display, delete the cache data.
Definition: Fl_Image.cxx:57
virtual void desaturate()
The desaturate() method converts an image to grayscale.
Definition: Fl_Shared_Image.cxx:348
static Fl_RGB_Scaling RGB_scaling()
Returns the currently used RGB image scaling method.
Definition: Fl_Image.cxx:228
void draw(int X, int Y)
Draws the image to the current drawing surface.
Definition: Fl_Image.H:247
const uchar * array
Points to the start of the object's data array.
Definition: Fl_Image.H:295
unsigned char uchar
unsigned char
Definition: fl_types.h:28
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0)
Draws the image to the current drawing surface with a bounding box.
Definition: Fl_Shared_Image.cxx:358
Fl_RGB_Scaling
The scaling algorithm to use for RGB images.
Definition: Fl_Image.H:37
virtual Fl_SVG_Image * as_svg_image()
Returns whether an image is an Fl_SVG_Image or not.
Definition: Fl_Image.H:337