summaryrefslogtreecommitdiff
path: root/FL/Fl_Image.H
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-10-30 07:26:13 +0000
committerManolo Gouy <Manolo>2016-10-30 07:26:13 +0000
commit3ae2b1d74e35a4ac0d80b35e3eaa23088ccffeb4 (patch)
tree1a86ed98ee2cd762777d190f6e200403a006596b /FL/Fl_Image.H
parent2c043fb5b31839d7f7430cb410e175d2945acbe3 (diff)
Add virtual Fl_RGB_Image* Fl_Image::as_rgb_image() to detect whether an Fl_Image is derived from Fl_RGB_Image
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12061 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Image.H')
-rw-r--r--FL/Fl_Image.H8
1 files changed, 8 insertions, 0 deletions
diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H
index 203a91d3b..09d84a6de 100644
--- a/FL/Fl_Image.H
+++ b/FL/Fl_Image.H
@@ -30,6 +30,7 @@ class Fl_Widget;
class Fl_Pixmap;
struct Fl_Menu_Item;
struct Fl_Label;
+class Fl_RGB_Image;
/** \enum Fl_RGB_Scaling
@@ -186,6 +187,12 @@ public:
// get RGB image scaling method
static Fl_RGB_Scaling RGB_scaling();
+ /** Use this method if you have an Fl_Image object and want to know whether it is derived
+ from class Fl_RGB_Image.
+ If the method returns non-NULL, then the image in question is
+ derived from Fl_RGB_Image, and the returned value is a pointer to this image.
+ */
+ virtual Fl_RGB_Image *as_rgb_image() {return NULL;}
};
@@ -249,6 +256,7 @@ public:
\sa void Fl_RGB_Image::max_size(size_t)
*/
static size_t max_size() {return max_size_;}
+ virtual Fl_RGB_Image *as_rgb_image() {return this;}
};
#endif // !Fl_Image_H