summaryrefslogtreecommitdiff
path: root/FL/Fl_Image.H
AgeCommit message (Collapse)Author
3 dayswi[maxim nikonov
3 dayswipmaxim nikonov
2026-01-22Fix "Setting window custom cursor from SVG image crashes" (#1363)ManoloFLTK
2025-07-08Replace 'FL_OVERRIDE' with 'override' in public headersAlbrecht Schlosser
... except FL/fl_attr.h where FL_OVERRIDE is #define'd
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.
2024-01-13#887: Fixes Fl_Shared_Image reference countingMatthias Melcher
- adds documentation to all calls - changes implementation details on ::copy() and copy(w,h)
2023-11-27Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_BitmapManoloFLTK
2023-01-24Remove warnings when building doc with DoxygenManoloFLTK
2023-01-21Animated GIF support (Fl_Anim_GIF_Image class) (#375)wcout
2022-12-30Use `FL_OVERRIDE` for all overridden virtual methods (#611)Matthias Melcher
FL_OVERRIDE is defined as `override` for C++11 and higher FL_OVERRIDE is defined as `override` for VisualC 2015 and newer Don't interfere with Fl_Widget::override()
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-12-09Remove compiler warnings about unused parameters (issue #307)ManoloFLTK
2021-09-09Improve documentation of Fl_Image (Issue #272)Albrecht Schlosser
Try to explain what count() returns and what data() contains which can be different by image type.
2021-03-21Remove unnecessary system includes from public headersAlbrecht Schlosser
Add includes of system headers in the implementation files where necessary.
2020-11-19Rename private member function with trailing underscore.ManoloFLTK
2020-11-17Replace virtual Fl_RGB_Image::cache_size() by virtual Fl_Image::cache_size()ManoloFLTK
2020-11-12Fix for issue #155 - continuedManoloFLTK
Restores proper separation of what is in libfltk and what is in libfltk_images
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-06-15Allow using an Fl_SVG_Image object as window icon.ManoloFLTK
Fix for issue #90: Setting an svg image as a window icon causes a segfault.
2020-06-06Add two virtual methods to class Fl_ImageAlbrecht Schlosser
(1) The new virtual method Fl_Image::release() which is equivalent to 'delete this' automatically extends to Fl_Shared_Image::release() which makes the latter method virtual. This new method in the base class makes Fl_Image::release() callable on all objects derived from Fl_Image. (2) Add virtual method Fl_Shared_Image *Fl_Image::as_shared_image() This new method can be used to detect whether an Fl_Image instance is an Fl_Shared_Image or not.
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-04-14Doxygen: rewording for more clarity.ManoloFLTK
2019-02-06Remove Fl_Image::as_rgb_image() virtual member function.ManoloFLTK
It's not used in the library, so its utility remains to be proven.
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-26Documentation: give more detail for Fl_Image::w(int W) and Fl_Image::h(int H) Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12802 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-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-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-08-30Improve Doxygen comments related to image drawingManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12407 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-02Replace declarations such as "friend class Fl_Xlib_Graphics_Driver;" by ↵Manolo Gouy
platform-independent declarations. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12076 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-30Add virtual Fl_RGB_Image* Fl_Image::as_rgb_image() to detect whether an ↵Manolo Gouy
Fl_Image is derived from Fl_RGB_Image git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12061 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-02-09Move ifdef's in RGB_Image into driver system.Matthias Melcher
- change image caching variable types to uintptr_t - added driver function to uncache image data - cleaning up (Xlib and GDI will likely throw syntax errors. Trying to fix ASAP) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11138 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-04Created pseudo code for all FL_PORTED section so that FLTK compiles and ↵Matthias Melcher
links (Xcode, hello, other C flags: -D FL_PORTING -U __APPLE__ -U __APPLE_QUARTZ__) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@10993 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-03Updated platform specific #if's to report unimplemented code when compiling ↵Matthias Melcher
with FL_PORTING defined and WIN32 and __APPLE__ undefined> git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@10989 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-05-24Moved docs for fail() from prototype in Fl_Image.H -> implementation in ↵Greg Ercolano
Fl_Image.cxx. Also added coded example to assist app programmers in usage. (Matt: feel free to modify the example code as needed) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10734 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-05-24Fixes these errors on Linux:Greg Ercolano
../FL/Fl_Image.H:58: error: ISO C++ forbids initialization of member 'ERR_NO_IMAGE' ../FL/Fl_Image.H:58: error: making 'ERR_NO_IMAGE' static git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10733 ea41ed52-d2ee-0310-a9c1-e6b18d33e121