diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-03-20 19:59:22 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-04-13 16:50:30 +0200 |
| commit | 10537b7143a06a4c0c1c4caba4f0150f9e290090 (patch) | |
| tree | d265896f0d66a20391cbeb55b0f133fb3f1a90ca /FL/Fl_Image.H | |
| parent | 95b5623b96e37e46ef80e75326453ea840172ce7 (diff) | |
Make Fl_Image::copy() 'const', including all derived classes
Copying an image does not (and must not) change the original object,
hence copy() should always be 'const'.
This is *necessary* if the given Fl_Image object is 'const'.
Diffstat (limited to 'FL/Fl_Image.H')
| -rw-r--r-- | FL/Fl_Image.H | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H index 31b005dc4..49b277740 100644 --- a/FL/Fl_Image.H +++ b/FL/Fl_Image.H @@ -234,7 +234,7 @@ public: Fl_Image(int W, int H, int D); virtual ~Fl_Image(); - virtual Fl_Image *copy(int W, int H); + virtual Fl_Image *copy(int W, int H) const; /** Creates a copy of the specified image. The image should be released when you are done with it. @@ -247,7 +247,7 @@ public: \see Fl_Image::release() \see Fl_Image::copy(int w, int h) */ - Fl_Image *copy() { return copy(w(), h()); } + Fl_Image *copy() const { return copy(w(), h()); } virtual void color_average(Fl_Color c, float i); /** The inactive() method calls @@ -340,8 +340,8 @@ public: Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0); Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg=FL_GRAY); virtual ~Fl_RGB_Image(); - virtual Fl_Image *copy(int W, int H); - Fl_Image *copy() { return Fl_Image::copy(); } + virtual Fl_Image *copy(int W, int H) const; + Fl_Image *copy() const { return Fl_Image::copy(); } virtual void color_average(Fl_Color c, float i); virtual void desaturate(); virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); |
