summaryrefslogtreecommitdiff
path: root/FL/Fl_Shared_Image.H
diff options
context:
space:
mode:
Diffstat (limited to 'FL/Fl_Shared_Image.H')
-rw-r--r--FL/Fl_Shared_Image.H22
1 files changed, 19 insertions, 3 deletions
diff --git a/FL/Fl_Shared_Image.H b/FL/Fl_Shared_Image.H
index bcb41219f..5f96f7f2d 100644
--- a/FL/Fl_Shared_Image.H
+++ b/FL/Fl_Shared_Image.H
@@ -3,7 +3,7 @@
//
// Shared image header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -41,7 +41,12 @@ class FL_EXPORT Fl_Shared_Image : public Fl_Image {
friend class Fl_JPEG_Image;
friend class Fl_PNG_Image;
-
+
+private:
+ static Fl_RGB_Scaling scaling_algorithm_; // method used to rescale RGB source images
+#if FLTK_ABI_VERSION >= 10304
+ Fl_Image *scaled_image_;
+#endif
protected:
static Fl_Shared_Image **images_; // Shared images
@@ -66,7 +71,7 @@ protected:
void add();
void update();
- public:
+public:
/** Returns the filename of the shared image */
const char *name() { return name_; }
/** Returns the number of references of this shared image. When reference is below 1, the image is deleted. */
@@ -80,14 +85,25 @@ protected:
virtual void desaturate();
virtual void draw(int X, int Y, int W, int H, int cx, int cy);
void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
+ void scale(int width, int height, int proportional = 1, int can_expand = 0);
virtual void uncache();
static Fl_Shared_Image *find(const char *n, int W = 0, int H = 0);
static Fl_Shared_Image *get(const char *n, int W = 0, int H = 0);
+ static Fl_Shared_Image *get(Fl_RGB_Image *rgb, int own_it = 1);
static Fl_Shared_Image **images();
static int num_images();
static void add_handler(Fl_Shared_Handler f);
static void remove_handler(Fl_Shared_Handler f);
+ /** Sets what algorithm is used when resizing a source image.
+ The default algorithm is FL_RGB_SCALING_BILINEAR.
+ Drawing an Fl_Shared_Image is sometimes performed by first resizing the source image
+ and then drawing the resized copy. This occurs, e.g., when drawing to screen under Linux or MSWindows
+ after having called Fl_Shared_Image::scale().
+ This function controls what method is used when the image to be resized is an Fl_RGB_Image.
+ \version 1.3.4 and requires compiling with FLTK_ABI_VERSION = 10304
+ */
+ static void scaling_algorithm(Fl_RGB_Scaling algorithm) {scaling_algorithm_ = algorithm; }
};
//