summaryrefslogtreecommitdiff
path: root/FL/Fl_Image.H
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2014-10-14 11:53:51 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2014-10-14 11:53:51 +0000
commitd24a6b2633664959d0b0ab5fd1ab3aa140ab877f (patch)
tree91f87cbc88b4909cee27ba1c6644d6cd278d2df1 /FL/Fl_Image.H
parentf1bf759c646501707def7a27bc2ca76c30947ba4 (diff)
Move RGB image scaling algorithm methods in base class Fl_Image.
See also discussion in fltk.coredev of Sept 07, 2014 and later with subject "Fixing the nearest-neighbour scaling". git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10377 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Image.H')
-rw-r--r--FL/Fl_Image.H43
1 files changed, 20 insertions, 23 deletions
diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H
index b9298d78d..b1037da77 100644
--- a/FL/Fl_Image.H
+++ b/FL/Fl_Image.H
@@ -3,7 +3,7 @@
//
// Image header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2011 by Bill Spitzak and others.
+// Copyright 1998-2014 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
@@ -30,22 +30,31 @@ class Fl_Pixmap;
struct Fl_Menu_Item;
struct Fl_Label;
+/** \enum Fl_RGB_Scaling.
+ The scaling algorithm to use for RGB images.
+*/
+enum Fl_RGB_Scaling {
+ FL_RGB_SCALING_NEAREST = 0, ///< default RGB image scaling algorithm
+ FL_RGB_SCALING_BILINEAR ///< more accurate, but slower RGB image scaling algorithm
+};
+
/**
Fl_Image is the base class used for caching and
drawing all kinds of images in FLTK. This class keeps track of
common image data such as the pixels, colormap, width, height,
and depth. Virtual methods are used to provide type-specific
- image handling.</P>
+ image handling.
- <P>Since the Fl_Image class does not support image
+ Since the Fl_Image class does not support image
drawing by itself, calling the draw() method results in
a box with an X in it being drawn instead.
*/
class FL_EXPORT Fl_Image {
int w_, h_, d_, ld_, count_;
const char * const *data_;
+ static Fl_RGB_Scaling RGB_scaling_;
- // Forbid use of copy contructor and assign operator
+ // Forbid use of copy constructor and assign operator
Fl_Image & operator=(const Fl_Image &);
Fl_Image(const Fl_Image &);
@@ -152,15 +161,12 @@ class FL_EXPORT Fl_Image {
*/
void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} // platform dependent
virtual void uncache();
-};
-/** \enum Fl_RGB_Scaling
- The image-scaling algorithm to use.
- */
+ // set RGB image scaling method
+ static void RGB_scaling(Fl_RGB_Scaling);
-enum Fl_RGB_Scaling {
- FL_SCALING_NEAREST = 0, ///< default RGB image-scaling algorithm
- FL_SCALING_BILINEAR ///< alternative, slower and more accurate RGB image-scaling algorithm
+ // get RGB image scaling method
+ static Fl_RGB_Scaling RGB_scaling();
};
/**
@@ -168,9 +174,9 @@ enum Fl_RGB_Scaling {
of full-color images with 1 to 4 channels of color information.
Images with an even number of channels are assumed to contain
alpha information, which is used to blend the image with the
- contents of the screen.</P>
-
- <P>Fl_RGB_Image is defined in
+ contents of the screen.
+
+ Fl_RGB_Image is defined in
&lt;FL/Fl_Image.H&gt;, however for compatibility reasons
&lt;FL/Fl_RGB_Image.H&gt; should be included.
*/
@@ -179,7 +185,6 @@ class FL_EXPORT Fl_RGB_Image : public Fl_Image {
friend class Fl_GDI_Graphics_Driver;
friend class Fl_Xlib_Graphics_Driver;
static size_t max_size_;
- static Fl_RGB_Scaling scaling_;
public:
const uchar *array;
@@ -240,14 +245,6 @@ public:
\sa void Fl_RGB_Image::max_size(size_t)
*/
static size_t max_size() {return max_size_;}
-
- /** Sets the scaling method used for copy(int, int).
- Applies to all RGB images, defaults to FL_SCALING_NEAREST.
- */
- static void scaling(Fl_RGB_Scaling);
-
- /** Returns the currently used scaling method. */
- static Fl_RGB_Scaling scaling();
};
#endif // !Fl_Image_H