summaryrefslogtreecommitdiff
path: root/src/Fl_Pixmap.cxx
AgeCommit message (Collapse)Author
46 hourswipmaxim nikonov
2022-09-26Replace all calls to sprintf() by calls to snprintf().ManoloFLTK
2022-04-14Fix for issue #429 : Segfault with Ctrl+/- with current git versionManoloFLTK
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-24Remove platform-dependent type Fl_Bitmask (not in documented public API).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.
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-14Remove Fl_Pixmap::prepare() and Fl_Bitmap::prepare() that were used only once.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12834 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-04-13Homogenise and simplify the API of Fl_Graphics_Driver::cache(image-type *) ↵Manolo Gouy
virtual member functions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12833 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-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
2018-01-31Replace FL/x.H with FL/platform.H - step 2 (STR #3435).Albrecht Schlosser
This second step replaces FL/x.H with FL/platform.H in all source files. Dependencies have been adjusted as well. This commit completes the replacement of FL/x.H with FL/platform.H. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-16Avoid crash in Fl_Pixmap::copy() when the source Fl_Pixmap contains bad ↵Manolo Gouy
pixmap data. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12635 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-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-08MacOS: use less temporary copies of image data for image printing.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12086 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-05Slightly improve the parameter list of member function int ↵Manolo Gouy
Fl_Graphics_Driver::start_image(...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12079 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-03Factorize repeated code across platform-specific graphics drivers and image ↵Manolo Gouy
types git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12077 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
2016-03-26Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, ↵Manolo Gouy
Fl_Region, Fl_Bitmask). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-25Remove a bunch of useless #include <FL/x.H> directives.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11422 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-05Complete the platform-neutral implementation of fl_XXX_offscreen() functions.Manolo Gouy
It is necessary to have a stack of the fl_begin_offscreen() calls, so that nested such calls apply fl_end_offscreen() to the matching fl_begin_offscreen(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11289 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-04Fix a problem seen in fluid on the Mac OS platform.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11285 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-25Remove useless declarations.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11215 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-31Needed for Linux/Unix build.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11098 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-27Removed all references to Quartz driver files from library headers in Xcode. ↵Matthias Melcher
Works in Xcode. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11065 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-271) Added a new way to detect whether the drawing operation is using the ↵Manolo Gouy
platform's native driver and whether we are printing: virtual int Fl_Graphics_Driver::has_feature(driver_feature feature) This is also because it is not convenient to derive a printer-specific driver with its own implementation of virtual functions when this implementation differs only in one line of code. 2) Solved the problem of inclusion of non public header by the public header FL/Fl_Device.H: bracket this with #if FL_LIBRARY / #endif so this non public header is included only when building FLTK itself. 3) Removed several (but not all) of the FLTK_ABI_VERSION guards that are no longer useful for code targeting FLTK 1.4. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11063 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-12-30Add configure and CMake checks for X11/Xregion.h.Albrecht Schlosser
Configure and CMake now both check if X11/Xregion.h exists on the build system and set HAVE_X11_XREGION_H in config.h accordingly. src/Fl_Pixmap.cxx: modified to use the configure test as proposed by Manolo in fltk.coredev on Dec 13 2015 in thread "Using X11 backend on OS X". git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10983 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-22Documentation only: removed warnings that appeared with Doxygen 1.8.10Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10977 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-12Allow compilation with old Mac OS versions + USE_X11 mode with whichManolo Gouy
header X11/Xregion.h is not available. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10958 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-22Indentation fix.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10772 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-21Fix Fl_Pixmap (background) drawing to respect the clip region (STR #3206).Albrecht Schlosser
STR title: (Re-)drawing artefacts with scheme plastic after STR 3059. It turned out that drawing a pixmap could enlarge the clip region if the intersection of the clip region and the pixmap was not a single rectangle. Hence drawing the background pixmap would draw outside the clip region and leave artefacts when a widget was drawn on top of it. See STR #3206. Thanks to Manolo who had the idea and provided a patch to draw into the individual rectangles of a multi-rectangle clip region. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10771 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-15Fix documentation and make platform specific code better distinguishable.Albrecht Schlosser
This commit doesn't change any code (comments only). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10753 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-03-11Implementation of Fl_Shared_Image::scale(width, height) for scaled image ↵Manolo Gouy
drawing - cont'd Shorter implementation based on Fl_Graphics_Driver::draw_scaled(Fl_Image *,...). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10616 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-03-10Added Fl_Shared_Image::scale(width, height) to support scaled image drawing ↵Manolo Gouy
(STR #3185). Useful for printing, PostScript or PDF output, or retina displays. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10615 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-02-23WN32: Fl_Pixmap::draw(X,Y,W,H,cx,cy) did not print well when cx or cy was ↵Manolo Gouy
not null. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10589 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-11-06Replaced 10302 with 10301 for FLTK_ABI_VERSIONMatthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9706 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-05-01Fix STR#2831: regression in Fl_Pixmap drawing under X11.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9421 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-03-29Maybe fix for the Fl_Pixmap issue building 9310 on mingw/WinXP.Ian MacArthur
PLEASE check this is OK, I don't have access to test systems here... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9311 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-03-28WIN32: Fl_Pixmap printing uses a global variable called win_pixmap_bg_color ↵Manolo Gouy
equal to the color used for the pixmap background, and treats this color as transparent. FLTK assigns to this variable a color unused by the processed pixmap. In theory this variable should be specific to each processed pixmap. In practice, it's very unlikely that several values are needed. A new member variable is added to the Fl_Pixmap object to hold this value. This member is made static if FLTK_ABI_VERSION < 10302 for ABI compatibility. The correct thing, though, is for a non-static member. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9308 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-03-18Fix STR#2810: removed all uses of function Fl_Device::class_name().Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9293 ea41ed52-d2ee-0310-a9c1-e6b18d33e121