summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2025-06-30 14:56:26 +0200
committerMatthias Melcher <github@matthiasm.com>2025-06-30 14:56:26 +0200
commit42b2388610ab164075ac2197e6794fa40484f14d (patch)
treef856910fedcc7cc1122f1d2b4f78111a556a0a63 /FL
parent3459e43ca830959d2b4ca71796a34ae7b21a819e (diff)
Improve bilinear image scaling below 50%
The original code can not scale well below 50%. To improve filtering in a fast way, huge images are scaled by powers of two before fine scaling using the original bilinear scale.
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Image.H6
1 files changed, 6 insertions, 0 deletions
diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H
index 8b8b433e8..6cf1e1267 100644
--- a/FL/Fl_Image.H
+++ b/FL/Fl_Image.H
@@ -354,6 +354,12 @@ private:
fl_uintptr_t id_;
fl_uintptr_t mask_;
int cache_w_, cache_h_; // size of image when cached
+
+ Fl_RGB_Image *copy_scale_down_2h_() const;
+ Fl_RGB_Image *copy_scale_down_2v_() const;
+ Fl_RGB_Image *copy_bilinear_(int W, int H) const;
+ Fl_RGB_Image *copy_nearest_neighbor_(int W, int H) const;
+ Fl_RGB_Image *copy_optimize_(int W, int H) const;
public:
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0);