From 42b2388610ab164075ac2197e6794fa40484f14d Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 30 Jun 2025 14:56:26 +0200 Subject: 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. --- FL/Fl_Image.H | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'FL') 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); -- cgit v1.2.3