FLTK 1.4.0
Loading...
Searching...
No Matches
Fl_Graphics_Driver.H
1//
2// Declaration of classes Fl_Graphics_Driver, Fl_Scalable_Graphics_Driver,
3// and Fl_Font_Descriptor for the Fast Light Tool Kit (FLTK).
4//
5// Copyright 2010-2023 by Bill Spitzak and others.
6//
7// This library is free software. Distribution and use rights are outlined in
8// the file "COPYING" which should have been included with this file. If this
9// file is missing or damaged, see the license at:
10//
11// https://www.fltk.org/COPYING.php
12//
13// Please see the following page on how to report bugs and issues:
14//
15// https://www.fltk.org/bugs.php
16//
17
28#ifndef FL_GRAPHICS_DRIVER_H
29#define FL_GRAPHICS_DRIVER_H
30
31#include <FL/Fl_Device.H>
32#include <FL/Fl_Image.H>
33#include <FL/Fl_Bitmap.H>
34#include <FL/Fl_Pixmap.H>
35#include <FL/Fl_RGB_Image.H>
36
37class Fl_Graphics_Driver;
38class Fl_Font_Descriptor;
40FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
41
50typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
51
52struct Fl_Fontdesc;
53typedef struct _PangoFontDescription PangoFontDescription;
54
55#define FL_REGION_STACK_SIZE 10
56#define FL_MATRIX_STACK_SIZE 32
57
76class FL_EXPORT Fl_Graphics_Driver {
77 friend class Fl_Surface_Device;
78 friend class Fl_Pixmap;
79 friend class Fl_Bitmap;
80 friend class Fl_RGB_Image;
81 friend class Fl_SVG_Image;
82 friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
83 friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
84 friend void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
85 friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
86 friend void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
87 friend int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg);
88 friend FL_EXPORT void gl_start();
89 /* ============== Implementation note about image drawing =========================
90 A graphics driver can implement up to 6 virtual member functions to draw images:
91 virtual void draw_pixmap(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy)
92 virtual void draw_bitmap(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy)
93 virtual void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy)
94and
95 virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy)
96 virtual void draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy)
97 virtual void draw_fixed(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy)
98 - The 1st group of functions is used when the driver can directly map the image data,
99 sized at data_w() x data_h(), to the image drawing area, sized at w()*scale x h()*scale
100 where scale is the current GUI scale factor.
101 - If the driver does not support such scale-and-draw operation for a given image type,
102 it should implement the draw_fixed() function which is called by the library after the
103 image has been internally resized to the drawing size and cached.
104 - The platform-independent Fl_Graphics_Driver class implements the 1st group of functions.
105 Each resizes the image, caches it, and calls the platform-specific implementation of
106 draw_fixed(image-class *,....) with the cached image.
107 - Consider an image object, say from class Fl_RGB_Image. Fl_RGB_Image::draw()
108 calls the virtual member function draw_rgb(Fl_RGB_Image *,....). If Fl_XXX_Graphics_Driver
109 re-implements this function, this code runs and is expected to draw the image
110 adequately scaled to its drawing size. If Fl_XXX_Graphics_Driver does not re-implement
111 this function, Fl_Graphics_Driver::draw_rgb(Fl_RGB_Image *,....) runs. It internally
112 resizes the image, caches it, and calls Fl_XXX_Graphics_Driver::draw_fixed(Fl_RGB_Image *,....)
113 that draws the image from its cached form which already has the adequate size.
114 - Some drivers implement, for a given image class, only the function of the 1st group or
115 only draw_fixed() as in these examples:
116 - Fl_Quartz_Graphics_Driver implements only draw_rgb(Fl_RGB_Image *,....) because it
117 can perform the scale-and-draw operation whatever the RGB image and the required scaling.
118 - Fl_Xlib_Graphics_Driver implements only draw_fixed(Fl_Pixmap *,....). The library
119 takes care of resizing and caching the Pixmap to the adequate drawing size.
120 - Some drivers implement, for a given image class, the function of both groups, e.g. :
121 Fl_GDI_Graphics_Driver implements both draw_rgb(Fl_RGB_Image *,....) and
122 draw_fixed(Fl_RGB_Image *,....) because scale-and-draw may require function Alphablend()
123 from MSIMG32.DLL. In the absence of that, the draw_rgb() implementation calls
124 Fl_Graphics_Driver::draw_rgb() which runs Fl_GDI_Graphics_Driver::draw_fixed(Fl_RGB_Image*,...).
125
126 Graphics drivers also implement cache(Fl_Pixmap*), cache(Fl_Bitmap*) and cache(Fl_RGB_Image*)
127 to compute the cached form of all image types, and uncache(Fl_RGB_Image *,...),
128 uncache_pixmap(fl_uintptr_t) and delete_bitmask(fl_uintptr_t) to destroy cached image forms.
129 Graphics drivers that use the mask_ variable of class Fl_Pixmap to cache an Fl_Pixmap
130 object also reimplement the uchar **Fl_Graphics_Driver::mask_bitmap() member function.
131 */
132private:
133 virtual void draw_fixed(Fl_Pixmap *pxm,int XP, int YP, int WP, int HP, int cx, int cy);
134 virtual void draw_fixed(Fl_Bitmap *bm,int XP, int YP, int WP, int HP, int cx, int cy);
135 virtual void draw_fixed(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy);
136 // the default implementation of make_unused_color_() is most probably enough
137 virtual void make_unused_color_(unsigned char &r, unsigned char &g, unsigned char &b, int color_count, void **data);
138 // some platforms may need to reimplement this
139 virtual void set_current_();
140 float scale_; // scale between FLTK and drawing coordinates: drawing = FLTK * scale_
141public:
143 static Fl_Graphics_Driver *newMainGraphicsDriver();
145 struct matrix {double a, b, c, d, x, y;};
147 typedef enum {
148 NATIVE = 1,
149 PRINTER = 2
150 } driver_feature;
151
152protected:
153 int fl_clip_state_number;
154 static const matrix m0;
155 Fl_Font font_;
156 Fl_Fontsize size_;
157 Fl_Color color_;
158 int sptr;
159 static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
160 matrix stack[FL_MATRIX_STACK_SIZE];
161 matrix m;
162 int n;
163 int gap_;
164 enum SHAPE {NONE=0, LINE, LOOP, POLYGON, POINTS, COMPLEX_POLYGON} what;
165 int rstackptr;
166 static const int region_stack_max = FL_REGION_STACK_SIZE - 1;
167 Fl_Region rstack[FL_REGION_STACK_SIZE];
168 Fl_Font_Descriptor *font_descriptor_;
169 int p_size;
170 typedef struct { float x; float y; } XPOINT;
171 XPOINT *xpoint;
172 virtual void global_gc();
173 virtual void cache(Fl_Pixmap *img);
174 virtual void cache(Fl_Bitmap *img);
175 virtual void cache(Fl_RGB_Image *img);
176 virtual void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_);
177 // --- implementation is in src/drivers/xxx/Fl_xxx_Graphics_Driver_image.cxx
178 virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
179 virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
180 virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
181 virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
182 virtual void draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
183 virtual void draw_pixmap(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
184 virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
185 virtual void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
186
188 static void change_image_size(Fl_Image *img, int W, int H) {
189 img->w(W);
190 img->h(H);
191 }
192 // Support function for image drawing
193 virtual void uncache_pixmap(fl_uintptr_t p);
194 // accessor functions to protected image members
195 int start_image(Fl_Image *img, int XP, int YP, int WP, int HP, int &cx, int &cy,
196 int &X, int &Y, int &W, int &H);
198 static fl_uintptr_t* id(Fl_RGB_Image *rgb) {return &(rgb->id_);}
200 static fl_uintptr_t* id(Fl_Pixmap *pm) {return &(pm->id_);}
202 static fl_uintptr_t* id(Fl_Bitmap *bm) {return &(bm->id_);}
204 static fl_uintptr_t* mask(Fl_RGB_Image *rgb) {return &(rgb->mask_);}
206 static fl_uintptr_t* mask(Fl_Pixmap *pm) {return &(pm->mask_);}
208 static void cache_w_h(Fl_Pixmap *pm, int*& pwidth, int*& pheight) {
209 pwidth = &(pm->cache_w_);
210 pheight = &(pm->cache_h_);
211 }
213 static void cache_w_h(Fl_Bitmap *bm, int*& pwidth, int*& pheight) {
214 pwidth = &(bm->cache_w_);
215 pheight = &(bm->cache_h_);
216 }
218 static void cache_w_h(Fl_RGB_Image *rgb, int*& pwidth, int*& pheight) {
219 pwidth = &(rgb->cache_w_);
220 pheight = &(rgb->cache_h_);
221 }
222 static Fl_Offscreen get_offscreen_and_delete_image_surface(Fl_Image_Surface*);
224 static void draw_empty(Fl_Image* img, int X, int Y) {img->draw_empty(X, Y);}
225
226 Fl_Graphics_Driver();
227 virtual void cache_size(Fl_Image *img, int &width, int &height);
228 void cache_size_finalize(Fl_Image *img, int &width, int &height);
229 static unsigned need_pixmap_bg_color;
230public:
231 virtual ~Fl_Graphics_Driver();
232 static Fl_Graphics_Driver &default_driver();
233 // support of "complex shapes"
234 void push_matrix();
235 void pop_matrix();
236 void load_identity();
237 void load_matrix(double a, double b, double c, double d, double x, double y);
238 void mult_matrix(double a, double b, double c, double d, double x, double y);
239 void rotate(double d);
240 void translate(double x,double y);
241 double transform_x(double x, double y);
242 double transform_y(double x, double y);
243 double transform_dx(double x, double y);
244 double transform_dy(double x, double y);
246 inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
248 inline void font_descriptor(Fl_Font_Descriptor *d) { font_descriptor_ = d;}
250 float scale() { return scale_; }
252 virtual void scale(float f);
254 virtual char can_do_alpha_blending();
255 virtual void point(int x, int y);
256 virtual void rect(int x, int y, int w, int h);
257 virtual void focus_rect(int x, int y, int w, int h);
258 virtual void rectf(int x, int y, int w, int h);
259 virtual void _rbox(int fill, int x, int y, int w, int h, int r);
260 virtual void rounded_rect(int x, int y, int w, int h, int r);
261 virtual void rounded_rectf(int x, int y, int w, int h, int r);
262 // the default implementation is most likely enough
263 virtual void colored_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b);
264 virtual void line(int x, int y, int x1, int y1);
266 virtual void line(int x, int y, int x1, int y1, int x2, int y2);
268 virtual void xyline(int x, int y, int x1);
270 virtual void xyline(int x, int y, int x1, int y2);
272 virtual void xyline(int x, int y, int x1, int y2, int x3);
274 virtual void yxline(int x, int y, int y1);
276 virtual void yxline(int x, int y, int y1, int x2);
278 virtual void yxline(int x, int y, int y1, int x2, int y3);
280 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
282 virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
283 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
285 virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
286 // --- clipping
287 virtual void push_clip(int x, int y, int w, int h);
288 virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
289 virtual int not_clipped(int x, int y, int w, int h);
291 virtual void push_no_clip(); // has default implementation
293 virtual void pop_clip(); // has default implementation
294 virtual Fl_Region clip_region(); // has default implementation
295 virtual void clip_region(Fl_Region r); // has default implementation
296 virtual void restore_clip();
297 virtual void begin_points();
298 virtual void begin_line();
299 virtual void begin_loop();
300 virtual void begin_polygon();
301 virtual void begin_complex_polygon();
302 virtual void transformed_vertex(double xf, double yf);
303 virtual void transformed_vertex0(float x, float y);
304 virtual void vertex(double x, double y);
305 virtual void end_points();
306 virtual void end_line();
307 virtual void end_loop();
308 virtual void fixloop();
309 virtual void end_polygon();
310 virtual void end_complex_polygon();
311 // default implementation is most probably enough
312 virtual bool can_fill_non_convex_polygon() { return true; }
313 virtual void gap();
314 virtual void circle(double x, double y, double r);
315 virtual void arc(double x, double y, double r, double start, double end);
316 virtual void arc(int x, int y, int w, int h, double a1, double a2);
317 virtual void pie(int x, int y, int w, int h, double a1, double a2);
318 // To support fl_draw_circle(int x, int y, int d, Fl_Color color),
319 // the default implementation is most probably enough.
320 virtual void draw_circle(int x, int y, int d, Fl_Color c);
321 virtual void curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
322 virtual void line_style(int style, int width=0, char* dashes=0);
323 virtual void color(Fl_Color c);
324 virtual void set_color(Fl_Color i, unsigned int c);
325 virtual void free_color(Fl_Color i, int overlay);
326 virtual Fl_Color color();
327 virtual void color(uchar r, uchar g, uchar b);
328 virtual void draw(const char *str, int nChars, int x, int y);
329 virtual void draw(const char *str, int nChars, float x, float y);
330 virtual void draw(int angle, const char *str, int nChars, int x, int y);
331 virtual void rtl_draw(const char *str, int nChars, int x, int y);
332 virtual int has_feature(driver_feature feature);
333 virtual void font(Fl_Font face, Fl_Fontsize fsize);
334 virtual Fl_Font font();
335 virtual Fl_Fontsize size();
336 virtual double width(const char *str, int nChars);
337 virtual double width(unsigned int c);
338 virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
339 virtual int height();
340 virtual int descent();
341 virtual void gc(void*);
342 virtual void *gc(void);
343 virtual uchar **mask_bitmap();
344 // default implementation may be enough
345 virtual float scale_font_for_PostScript(Fl_Font_Descriptor *desc, int s);
346 // default implementation may be enough
347 virtual float scale_bitmap_for_PostScript();
348 // each platform implements these 3 functions its own way
349 virtual void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h);
350 virtual Fl_Region XRectangleRegion(int x, int y, int w, int h);
351 virtual void XDestroyRegion(Fl_Region r);
352 virtual const char* get_font_name(Fl_Font fnum, int* ap);
353 virtual int get_font_sizes(Fl_Font fnum, int*& sizep);
354 virtual Fl_Font set_fonts(const char *name);
355 virtual Fl_Fontdesc* calc_fl_fonts(void);
356 virtual unsigned font_desc_size();
357 virtual const char *font_name(int num);
358 virtual void font_name(int num, const char *name);
359 // Defaut implementation may be enough
360 virtual void overlay_rect(int x, int y, int w , int h);
361 virtual float override_scale();
362 virtual void restore_scale(float);
363 virtual PangoFontDescription* pango_font_description() { return NULL; }
364 virtual void antialias(int state);
365 virtual int antialias();
366 virtual void delete_bitmask(fl_uintptr_t bm);
367};
368
369#ifndef FL_DOXYGEN
370
371/* This class is not part of FLTK's public API.
372 Platforms usually define a derived class called Fl_XXX_Font_Descriptor
373 containing extra platform-specific data/functions.
374 This is a class for an actual system font, with junk to
375 help choose it and info on character sizes. Each Fl_Fontdesc has a
376 linked list of these. These are created the first time each system
377 font/size combination is used.
378 */
379class Fl_Font_Descriptor {
380public:
382 Fl_Font_Descriptor *next;
383 Fl_Fontsize size;
384 Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
385 virtual FL_EXPORT ~Fl_Font_Descriptor() {}
386 int ascent, descent;
387 unsigned int listbase;// base of display list, 0 = none
388};
389
390// This struct is not part of FLTK's public API.
391struct Fl_Fontdesc {
392 const char *name;
393 char fontname[128]; // "Pretty" font name
394 Fl_Font_Descriptor *first; // linked list of sizes of this style
395};
396
397/* Abstract class Fl_Scalable_Graphics_Driver is platform-independent.
398 It supports the scaling of all graphics coordinates by a
399 float factor helpful to support HiDPI displays.
400 This class does :
401 - compute scaled coordinates
402 - scale the cached offscreen of image objects
403 - scale the pixel arrays used when performing direct image draws
404 - call the member functions of a platform-specific,
405 Fl_Scalable_Graphics_Driver-derived class that do the drawings with adequately
406 scaled coordinates. The member functions are named with the _unscaled suffix.
407 - scale and unscale the clipping region.
408
409 This class is presently used by the X11 and Windows platforms to support HiDPI displays.
410 In the future, it may also be used by other platforms.
411 */
412class FL_EXPORT Fl_Scalable_Graphics_Driver : public Fl_Graphics_Driver {
413public:
414 Fl_Scalable_Graphics_Driver();
415 // This function aims to compute accurately int(x * s) in
416 // presence of rounding errors existing with floating point numbers
417 // and that sometimes differ between 32 and 64 bits.
418 static inline int floor(int x, float s) { return int(x * s + 0.001f); }
419 inline int floor(int x) { return Fl_Scalable_Graphics_Driver::floor(x, scale()); }
420protected:
421 int line_width_;
422 virtual Fl_Region scale_clip(float f);
423 void unscale_clip(Fl_Region r);
424 void point(int x, int y) FL_OVERRIDE;
425 virtual void point_unscaled(float x, float y);
426 void rect(int x, int y, int w, int h) FL_OVERRIDE;
427 void rectf(int x, int y, int w, int h) FL_OVERRIDE;
428 virtual void rectf_unscaled(int x, int y, int w, int h);
429 void line(int x, int y, int x1, int y1) FL_OVERRIDE;
430 virtual void line_unscaled(int x, int y, int x1, int y1);
431 void line(int x, int y, int x1, int y1, int x2, int y2) FL_OVERRIDE;
432 virtual void line_unscaled(int x, int y, int x1, int y1, int x2, int y2);
433 void xyline(int x, int y, int x1) FL_OVERRIDE;
434 virtual void xyline_unscaled(int x, int y, int x1);
435 void xyline(int x, int y, int x1, int y2) FL_OVERRIDE {Fl_Graphics_Driver::xyline(x, y, x1, y2);}
436 void xyline(int x, int y, int x1, int y2, int x3) FL_OVERRIDE {Fl_Graphics_Driver::xyline(x, y, x1, y2, x3);}
437 void yxline(int x, int y, int y1) FL_OVERRIDE;
438 virtual void yxline_unscaled(int x, int y, int y1);
439 void yxline(int x, int y, int y1, int x2) FL_OVERRIDE {Fl_Graphics_Driver::yxline(x, y, y1, x2);}
440 void yxline(int x, int y, int y1, int x2, int y3) FL_OVERRIDE {Fl_Graphics_Driver::yxline(x, y, y1, x2, y3);}
441 void loop(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE;
442 virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2);
443 void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE;
444 virtual void loop_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
445 void polygon(int x0, int y0, int x1, int y1, int x2, int y2) FL_OVERRIDE;
446 virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2);
447 void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) FL_OVERRIDE;
448 virtual void polygon_unscaled(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
449 void circle(double x, double y, double r) FL_OVERRIDE;
450 virtual void ellipse_unscaled(double xt, double yt, double rx, double ry);
451 void font(Fl_Font face, Fl_Fontsize size) FL_OVERRIDE;
452 Fl_Font font() FL_OVERRIDE;
453 virtual void font_unscaled(Fl_Font face, Fl_Fontsize size);
454 double width(const char *str, int n) FL_OVERRIDE;
455 double width(unsigned int c) FL_OVERRIDE;
456 virtual double width_unscaled(const char *str, int n);
457 virtual double width_unscaled(unsigned int c);
459 virtual Fl_Fontsize size_unscaled();
460 void text_extents(const char *str, int n, int &dx, int &dy, int &w, int &h) FL_OVERRIDE;
461 virtual void text_extents_unscaled(const char *str, int n, int &dx, int &dy, int &w, int &h);
462 int height() FL_OVERRIDE;
463 int descent() FL_OVERRIDE;
464 virtual int height_unscaled();
465 virtual int descent_unscaled();
466 void draw(const char *str, int n, int x, int y) FL_OVERRIDE;
467 virtual void draw_unscaled(const char *str, int n, int x, int y);
468 void draw(int angle, const char *str, int n, int x, int y) FL_OVERRIDE;
469 virtual void draw_unscaled(int angle, const char *str, int n, int x, int y);
470 void draw(const char *str, int nChars, float x, float y) FL_OVERRIDE;
471 void rtl_draw(const char* str, int n, int x, int y) FL_OVERRIDE;
472 virtual void rtl_draw_unscaled(const char* str, int n, int x, int y);
473 void arc(double x, double y, double r, double start, double end) FL_OVERRIDE;
474 void arc(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE;
475 virtual void arc_unscaled(int x, int y, int w, int h, double a1, double a2);
476 void pie(int x, int y, int w, int h, double a1, double a2) FL_OVERRIDE;
477 virtual void pie_unscaled(int x, int y, int w, int h, double a1, double a2);
478 void draw_circle(int x, int y, int d, Fl_Color c) FL_OVERRIDE;
479 void line_style(int style, int width=0, char* dashes=0) FL_OVERRIDE;
480 virtual void line_style_unscaled(int style, int width, char* dashes);
481 void draw_image_rescale(void *buf, Fl_Draw_Image_Cb cb, int X, int Y, int W, int H, int D, int L, bool mono);
482 virtual void draw_image_unscaled(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
483 virtual void draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
484 void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) FL_OVERRIDE;
485 void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) FL_OVERRIDE;
486 virtual void draw_image_mono_unscaled(const uchar* buf, int x, int y, int w, int h, int d, int l);
487 void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) FL_OVERRIDE;
488 virtual void draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
489 void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) FL_OVERRIDE;
490
491 void transformed_vertex(double xf, double yf) FL_OVERRIDE;
492 void vertex(double x, double y) FL_OVERRIDE;
493 float override_scale() FL_OVERRIDE;
494 void restore_scale(float) FL_OVERRIDE;
495 virtual void *change_pen_width(int lwidth);
496 virtual void reset_pen_width(void *data);
497};
498#endif // FL_DOXYGEN
499
500#endif // FL_GRAPHICS_DRIVER_H
501
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1044
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition Enumerations.H:1101
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1073
declaration of classes Fl_Surface_Device, Fl_Display_Device, Fl_Device_Plugin.
Fl_Graphics_Driver * fl_graphics_driver
Points to the driver that currently receives all graphics requests.
Definition Fl_Graphics_Driver.cxx:23
Fl_Image, Fl_RGB_Image classes.
The Fl_Bitmap class supports caching and drawing of mono-color (bitmap) images.
Definition Fl_Bitmap.H:32
Directs all graphics requests to an Fl_Image.
Definition Fl_Image_Surface.H:65
Base class for image caching, scaling and drawing.
Definition Fl_Image.H:60
void h(int H)
Sets the height of the image data.
Definition Fl_Image.H:93
void w(int W)
Sets the width of the image data.
Definition Fl_Image.H:87
void draw_empty(int X, int Y)
The protected method draw_empty() draws a box with an X in it.
Definition Fl_Image.cxx:71
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
The Fl_SVG_Image class supports loading, caching and drawing of scalable vector graphics (SVG) images...
Definition Fl_SVG_Image.H:135
A drawing surface that's susceptible to receive graphical output.
Definition Fl_Device.H:66
#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
void gl_start()
Creates an OpenGL context.
Definition gl_start.cxx:58
void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy)
Copy a rectangular area of the given offscreen buffer into the current drawing destination.
Definition fl_draw.H:769
void fl_draw_image(const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)
Draw an 8-bit per color RGB or luminance image.
Definition fl_draw.H:1026
void fl_draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D=1, int L=0)
Draw a gray-scale (1 channel) image.
Definition fl_draw.H:1034
opaque Fl_Offscreen
Platform-specific value representing an offscreen drawing buffer.
Definition platform_types.h:46
opaque fl_uintptr_t
An unsigned integral type large enough to store a pointer or an unsigned long value.
Definition platform_types.h:36
struct opaque * Fl_Region
Pointer to a platform-specific structure representing a collection of rectangles.
Definition platform_types.h:56