summaryrefslogtreecommitdiff
path: root/src/Fl_Image.cxx
AgeCommit message (Collapse)Author
44 hourswipmaxim nikonov
3 dayswipmaxim nikonov
2026-01-20Improve docu of member variable Fl_SVG_Image::proportional - cont'd (#1361)ManoloFLTK
2025-07-16Remove warnings triggered by -Wredundant-decls (#1277)ManoloFLTK
2025-07-01Better handling of special case when scaling imageMatthias Melcher
When scaling image down by 2, 4, 8, etc., there is no sense in calling the bilinear scaling.
2025-06-30Improve bilinear image scaling below 50%Matthias Melcher
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.
2025-02-22Fix "Fl_RGB_Image::draw() seg faults when offset is too big" - cont'd (#1211)ManoloFLTK
2025-02-22Fix "Fl_RGB_Image::draw() seg faults when offset is too big" (#1211)ManoloFLTK
2024-12-26Fix integer overflow in image interpolation. (#73)Matthias Melcher
Force casting int to long whenever a pixel offset is calculated as offsets can cross the 2GB border for very large images.
2024-11-18Fix: Rounding issues with Fl_RGB_Image::draw() + window scaling (#1128)ManoloFLTK
2024-10-15Fix documentation typos and trailing whitespaceAlbrecht Schlosser
2024-09-07Add pointer to Fl_Image::scale() to documentation of Fl_Image::copy(int, int)ManoloFLTK
2024-01-13Fix yet another typo in documentationAlbrecht Schlosser
2023-11-01Fix typos in documentationManoloFLTK
2023-02-14Update doc of Fl_Image::copy() after new Fl_Anim_GIF_Image classManoloFLTK
2022-12-27Fix doxygen warnings (typos in argument names)Albrecht Schlosser
2022-12-17Adding length checks for in-memory image data (see #542) (#592)Matthias Melcher
SVG is now decompressed in memory Bitmap invalid array length handling to return an error RGB Image data reader to return error if image data is too short FLUID: Add size argument to bitmap and JPEG data
2022-04-20Improve docs of Fl_Image and related classes (#431)Albrecht Schlosser
Clarifications as discussed since April 15, 2022 07:00 UTC (see GitHub issue #431).
2022-04-15Fix documentation typoAlbrecht Schlosser
Fix missing opening quote. (#431 cont'd)
2022-04-15Clarify documentation of Fl_Image::copy() and more (#431)Albrecht Schlosser
- emphasize that Fl_Image::copy(W, H) creates an image with w() == data_w() == W and h() == data_h() == H - clarify some more docs of Fl_Image methods (ensure that data_w() and data_h() are used where appropriate rather than w() and h() - improve wording, examples, and formatting of related docs. Closes #431
2022-04-13Make Fl_Image::copy() 'const', including all derived classesAlbrecht Schlosser
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'.
2022-04-13Fix for issue #427 - continued.ManoloFLTK
2022-04-12Fix for issue #427: Problems with data_w, data_h, w, h of Fl_Image.ManoloFLTK
2022-03-26Add `const` to Fl_Image::fail() (PR #415)YX
2022-03-20Improve documentation of Fl_Image::copy()Albrecht Schlosser
Mention the new Fl_Image::release() method to delete all types of images.
2021-02-16Use <config.h> when appropriate.ManoloFLTK
2020-11-10Fix for issue #155 "SVG rendering spoiled by scaling".ManoloFLTK
2020-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
2020-02-22Fix the Fl_RGB_Image(Fl_Pixmap *pxm) c'tor when pxm is scaled.ManoloFLTK
2020-01-30New public static variable bool Fl_Image::register_images_doneManoloFLTK
Allows an app to detect whether fl_register_images() was called or not.
2019-03-26Use \deprecated Doxygen command where necessaryManoloFLTK
2018-05-09Remove a bunch of useless #include <FL/Fl_Printer.H> statements.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12909 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-19Documentation: simplify example code for Fl_Image::scale()Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12855 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-12Image drawing: simplify the code organisation to better support ↵Manolo Gouy
Fl_Image::scale(). Graphics drivers now use up to 6 virtual member functions to support Fl_Image drawing in the context of GUI and image rescaling : virtual void draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy) and virtual void draw_fixed(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_fixed(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) virtual void draw_fixed(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12828 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-28Image classes: memorise the width and the height of the cached form of the ↵Manolo Gouy
image to support GUI scaling git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12811 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-23Fix Fl_Image::copy() and its versions for derived image classes following ↵Manolo Gouy
the introduction of Fl_Image::scale() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12786 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-22Rename Fl_Image::pixel_w() and pixel_h() to Fl_Image::data_w() and data_h().Manolo Gouy
The docs of class Fl_Image and of Fl_Image::scale() are beefed up. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-20Extend the doc of Fl_Image::scale() member function.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12780 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-20Remove compilation warning with gcc-6.3 and -WreorderManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12777 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-03-19New member function Fl_Image::scale(int width, int height) to set the FLTK ↵Manolo Gouy
size of an image. Each image has now two sizes implemented as follows: - the pixel size is stored in private members pixel_w_ and pixel_h_ with public accessors pixel_w() and pixel_h() - the FLTK size is stored in private members w_ and h_ and read by w() and h() - when the image is constructed, the two sizes have the same value - the protected w(int) and h(int) member functions set both FLTK and pixel sizes. - the public scale(int, int) member function is essentially nothing but set the FLTK size and don't change the pixel size. - when the image is drawn, its FLTK size determines how big it is drawn, its pixel size determines how much data are available to draw it. FLTK 1.3.4 with FL_ABI_VERSION=10304 contained an equivalent member function but only for the Fl_Shared_Image class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12776 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-12Remove leading underscore from labeltyps as far as possible.Albrecht Schlosser
Removed obsolete '\todo' item from docs (done with recent commits). Removed redundant code from label assignment (e.g. use FL_IMAGE_LABEL instead of label type assignment + use of _FL_IMAGE_LABEL). See recent commits. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12448 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-11Add missing Fl_Labeltype and Fl_Boxtype definitions.Albrecht Schlosser
Some labeltypes and boxtypes were missing a #define for the enum without a leading underscore and the corresponding setup function to initialize the internal table of boxtypes and labeltypes, for instance _FL_MULTI_LABEL. This is now fixed so (hopefully) all boxtypes and labeltypes can and _should_ be used w/o leading underscore. Note: if there are still boxtypes or labeltypes that can't be used w/o leading underscore this should be considered a bug and is to be fixed ASAP. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12443 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-09-09Make virtual member function Fl_Image::draw_scaled(int X, int Y, int W, int ↵Manolo Gouy
H) protected rather than private. Consequently, remove the trailing _ from its name reserved for private class members. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12433 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-30Create virtual Fl_Image::draw_scaled_(int X, int Y, int W, int H) and its ↵Manolo Gouy
implementations for image classes. This allows to use the virtual function mechanism to adapt scaled image drawing both to the image type and the graphics driver type. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12410 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-05-17Introduce HiDPI + rescaling support for the X11 platform (+ partial support ↵Manolo Gouy
for WIN32) Corresponds to STR #3320 1) HiDPI support consists in detecting the adequate scaling factor for the screen on which FLTK maps a window, and scaling all FLTK units by this factor. FLTK tries to detect the correct value of this factor at startup (see more details below). Environment variable FLTK_SCALING_FACTOR can also be used to set this value. 2) Rescaling support consists in changing the scaling factor of all FLTK windows in reply to ctrl/+/-/0/ keystrokes. More details for the various platforms : - X11: Support is very advanced. Some details need still to be improved. Automatic detection of the correct starting value of the scaling factor works well with the gnome desktop. The present code contains no support for this on other desktops. FLTK_SCALING_FACTOR provides a workaround. -WIN32: Support is incomplete at this point, although many test applications have partial or complete HiDPI and scaling support. The current value of the system's scaling factor is correctly detected at application startup. Apps respond to changes of this value in real time. Support needs to define the FLTK_HIDPI_SUPPORT preprocessor variable at compile time. This way, standard builds produce a code with the default WIN32 HiDPI support, that is, where all graphics goes to an internal buffer that gets enlarged by the system and then mapped to the HiDPI display. To experiment with (or develop) the new HiDPI support requires a modified build procedure in which FLTK_HIDPI_SUPPORT is defined at compile time. When the support will be complete, the requirement for the definition of this preprocessor variable will be removed. The present commit contains support for a single scaling factor. Eventually, per-screen scaling factors should be implemented, as done for X11. - MacOS: this commit does not give new HiDPI for this platform. Eventually, window rescaling in reply to command/+/-/0/ is desirable. Per-screen scaling factor makes no sense on this platform because the OS itself takes care of the difference between the resolutions of traditional and retina displays. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12239 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-09Use Fl_Graphics_Driver::default_driver() when convenient.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12088 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-02Accept empty Fl_Pixmap in Fl_RGB_Image c'tor (STR #3348).Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12074 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-14Fix inconsistent interpretation of ld() in image handling (STR #3308).Albrecht Schlosser
Documentation has been fixed and clarified, and ld() handling is now consistent in Fl_(RGB_)Image, their subclasses and fl_draw_image() and similar functions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12029 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-27Add Doxygen comments for the Fl_RGB_Image::alloc_array and ::array public ↵Manolo Gouy
attributes. Also, document what is the value of alloc_array after construction of an Fl_RGB_Image object. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11897 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-09Fix typos, separate local variables of image scaling algorithms.Albrecht Schlosser
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11869 ea41ed52-d2ee-0310-a9c1-e6b18d33e121