FLTK: Fl_Image_Surface.H Source File

FLTK

Fl_Image_Surface.H
1 //
2 // "$Id$"
3 //
4 // Draw-to-image code for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2014 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18
19 #ifndef Fl_Image_Surface_H
20 #define Fl_Image_Surface_H
21
22 #include <FL/Fl_Copy_Surface.H>
23 #include <FL/Fl_Image.H>
24 #include <FL/Fl_Shared_Image.H>
25
26
47 class FL_EXPORT Fl_Image_Surface : public Fl_Surface_Device {
48 private:
49 void prepare_(int w, int h, int highres);
50 Fl_Offscreen offscreen;
51 int width;
52 int height;
53 Fl_Paged_Device *helper;
54 #ifdef __APPLE__
55 #elif defined(WIN32)
56 HDC _sgc;
57 Window _sw;
58 Fl_Surface_Device *_ss;
59 int _savedc;
60 #else
61 Fl_Surface_Device *previous;
62 Window pre_window;
63 GC gc;
64 #endif
65 public:
66 static const char *class_id;
67 const char *class_name() {return class_id;};
68 #if FLTK_ABI_VERSION >= 10304 || defined(FL_DOXYGEN)
69 Fl_Image_Surface(int w, int h, int highres = 0);
70 #else
71 Fl_Image_Surface(int w, int h, int highres);
72 Fl_Image_Surface(int w, int h);
73 #endif
74 ~Fl_Image_Surface();
75 void set_current();
76 void draw(Fl_Widget*, int delta_x = 0, int delta_y = 0);
77 void draw_decorated_window(Fl_Window* win, int delta_x = 0, int delta_y = 0);
78 Fl_RGB_Image *image();
79 Fl_Shared_Image *highres_image();
80 };
81
82 #ifdef __APPLE__
83 /* Mac class to implement translate()/untranslate() for a flipped bitmap graphics context */
84 class FL_EXPORT Fl_Quartz_Flipped_Surface_ : public Fl_Quartz_Surface_ {
85 public:
86 static const char *class_id;
87 const char *class_name() {return class_id;};
88 Fl_Quartz_Flipped_Surface_(int w, int h);
89 void translate(int x, int y);
90 void untranslate();
91 virtual ~Fl_Quartz_Flipped_Surface_() {};
92 };
93 #endif
94
95 #endif // Fl_Image_Surface_H
96
97 //
98 // End of "$Id$".
99 //
Fl_Image_Surface::class_name
const char * class_name()
Returns the name of the class of this object.
Definition: Fl_Image_Surface.H:67
Fl_Image_Surface
Directs all graphics requests to an Fl_Image.
Definition: Fl_Image_Surface.H:47
Fl_Surface_Device
A drawing surface that's susceptible to receive graphical output.
Definition: Fl_Device.H:556
Fl_Window
This widget produces an actual window.
Definition: Fl_Window.H:57
Fl_Paged_Device
Represents page-structured drawing surfaces.
Definition: Fl_Paged_Device.H:38
Fl_Widget
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:101
Fl_Shared_Image.H
Fl_Shared_Image class.
Fl_Surface_Device::set_current
virtual void set_current(void)
Make this surface the current drawing surface.
Definition: Fl_Device.cxx:44
Fl_Image.H
Fl_Image, Fl_RGB_Image classes.
Fl_RGB_Image
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:202
Fl_Shared_Image
This class supports caching, loading, scaling, and drawing of image files.
Definition: Fl_Shared_Image.H:50
- © 1998-2016 by Bill Spitzak and others.