Commit Graph

43 Commits

Author SHA1 Message Date
Matthias Melcher
332a87aa43 #887: Fixes Fl_Shared_Image reference counting
- adds documentation to all calls
- changes implementation details on ::copy()
and copy(w,h)
2024-01-13 19:32:32 +01:00
Matthias Melcher
c10183379f #188: Fixes Fl_Shared_Image ref count and find op
- ported froward from 1.3.9
- fixes ref count for original and other images
- fixes binary search issues
2023-12-12 22:44:49 +01:00
Matthias Melcher
44c874b731
Use FL_OVERRIDE for all overridden virtual methods (#611)
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-30 19:14:36 +01:00
Matthias Melcher
12da87ba0c
Adding length checks for in-memory image data (see #542) (#592)
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-12-17 16:01:35 +01:00
Albrecht Schlosser
804c48515d Improve docs of Fl_Image and related classes (#431)
Clarifications as discussed since April 15, 2022 07:00 UTC (see GitHub
issue #431).
2022-04-20 17:26:33 +02:00
Albrecht Schlosser
10537b7143 Make Fl_Image::copy() 'const', including all derived classes
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-13 16:50:30 +02:00
Albrecht Schlosser
a638f5a545 Add method Fl_Shared_Image::image()
This public method returns a pointer to the internal Fl_Image
object (const Fl_Image *). This is only for reference, the internal
image must not be modified by user code but it can be inspected and
copied to another image.
2022-03-30 15:56:27 +02:00
Albrecht Schlosser
f9e8ef0b7a Fix "Fl_Shared_Image: use of unitialized data" (#216)
- fix issue as proposed
- fix more potential access to uninitialized data issues
- document Fl_Shared_Image::add_handler()
- document typedef Fl_Shared_Image::Fl_Shared_Handler()
2021-04-28 13:36:34 +02:00
Albrecht Schlosser
f09e17c3c5 Remove $Id$ tags, update URL's, and more
- 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-07-06 20:28:20 +02:00
Albrecht Schlosser
1dd4929585 Add two virtual methods to class Fl_Image
(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-06-06 06:27:47 +02:00
Manolo Gouy
b8a50851fd Fix Fl_Image::copy() and its versions for derived image classes following 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-23 17:03:24 +00:00
Manolo Gouy
916b44e361 New member function Fl_Image::scale(int width, int height) to set the FLTK 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-03-19 17:43:18 +00:00
Manolo Gouy
d9a99c64fd Doxygen doc of class Fl_Shared_Image: add that the SVG format is also supported.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12588 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-12 09:23:48 +00:00
Albrecht Schlosser
64052828ca Add public accessor Fl_Shared_Image::original().
This public, inline, and read-only accessor is intended for debugging
purposes but can be useful for user code as well.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12472 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-02 11:18:41 +00:00
Manolo Gouy
df8c9ba80c Add missing default values for virtual member functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12411 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-08-30 17:44:09 +00:00
Manolo Gouy
06b98099f9 Documentation: drawing a scaled shared image no longer involves resizing the source image under MSWindows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12156 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-01-02 09:48:23 +00:00
Albrecht Schlosser
cf413d53fc Fl_Shared_Image documentation enhancements and clarifications.
Minor code changes (e.g. renaming of variables) included, but no functional
changes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12003 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-01 22:43:56 +00:00
Manolo Gouy
b43a5cf1fe Create virtual void Fl_Graphics_Driver::draw(Fl_Shared_Image*,...)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11936 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-12 12:02:38 +00:00
Manolo Gouy
93d1c43b7a Remove FL_ABI_VERSION directives
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11692 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-24 19:39:27 +00:00
Manolo Gouy
8e3f66073f 1) Added a new way to detect whether the drawing operation is using the 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-27 18:11:20 +00:00
Manolo Gouy
1c3163f206 More detailed Doxygen doc of Fl_Shared_Image::scale() and Fl_Image::draw(X,Y,W,H,cx,cy).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10618 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-03-12 08:59:14 +00:00
Manolo Gouy
dbde470f8d Added Fl_Shared_Image::scale(width, height) to support scaled image drawing (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-03-10 21:06:22 +00:00
Greg Ercolano
4f4a8fc3c7 Modifications to all LGPL headers for STR #2685.
(to clarify static exception LGPL by changing license references)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8864 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-07-19 04:49:30 +00:00
Matthias Melcher
fe25f19767 Adding embedded documentation to Fluid if installed odcs are not found. Falls back to the internet if that does not exist either. Also, adds JPEG and PNG images to the Shared Image list if they were loaded from memory - see example use in fluid.cxx which loads and embedded html document containing an embedded PNG image.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8306 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-24 17:04:22 +00:00
Matthias Melcher
e454f97acc Fixed Copyright to 2010.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7903 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-28 21:06:39 +00:00
Manolo Gouy
fe76949b83 Made fl_register_images() seen by Doxygen.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7505 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-04-14 20:47:34 +00:00
Matthias Melcher
167d767e0f Changed the copyright to 2009 for header files. Still todo: src and test directory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6614 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-01-01 16:11:32 +00:00
Fabien Costantini
5a71578b1b Doxygen pdf documentation: Changed pdf mime type to application/pdf. Removed all Widget class headers from file section as they already are in the class section, this saves many pages. Also disabled the referenced by/from systematic inserts for each functions as this is more a core developer documentation feature than a fltk user manual feature, also saves many pages. Didn't use the LATEX_COMPACT feature yet, not happy with its result, will comment it later.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6439 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-15 13:46:06 +00:00
Fabien Costantini
ae697b80b2 Doxygen documentation : took the opportunity to update copyright info as we modified already in batch almost all sources, added also a fil doxygen command to class headers to harmonize with original matt Fl_Widget dox. format.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6265 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-09-16 07:26:22 +00:00
Fabien Costantini
7ddd3b8c50 Doxygen Documentation WP5 Done, WP6 half finished so that all Fl_Image class hierarchy is up-to-date. Also completed the documentation of the useful Fl_Shared_Image.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6241 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-09-14 18:19:41 +00:00
Michael R Sweet
1c399af444 Update source file headers with STR web page.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4288 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2005-04-16 00:13:17 +00:00
Michael R Sweet
add37faa25 Copyright updates.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4052 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2005-02-24 21:55:12 +00:00
Michael R Sweet
a3d0905c9e Copyright updates and prep for 1.1.5rc1.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3391 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-04-11 04:39:01 +00:00
Michael R Sweet
00cb676e11 Copyright update for 1.1.3 release (not quite yet, but soon...)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2936 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2003-01-30 21:46:07 +00:00
Michael R Sweet
8276f8b307 Implement Fl_Shared_Image::uncache().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2679 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-10-20 03:13:56 +00:00
Michael R Sweet
1aecada52c DLL changes (still some more to go...)
Move BMP, GIF, and PNM image loaders to fltkimages project.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2583 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-08-14 16:19:48 +00:00
Michael R Sweet
d0f18c45b5 Boy, aren't WIN32 compilers *so* much fun.
Fix more export problems, make some more static inline methods regular
functions, don't use FL_NORMAL_SIZE in a static initializer since BC++
doesn't seem to support it...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2531 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-07-14 21:25:39 +00:00
Michael R Sweet
6a6e4ab66c Separate the extra image functions into fltk_images.
Add new fl_register_images() function to register the extra file formats
with Fl_Shared_Image.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2329 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-06-28 21:04:37 +00:00
Michael R Sweet
acd6bd5cc8 Clean up string includes.
Fix Fl_Shared_Image::add_handler() and friends.

Fix Fl_PNM_Image loader.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2260 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-05-25 13:38:25 +00:00
Michael R Sweet
2deb2fdfc9 Add image handler to Fl_Shared_Image class to support additional file
formats.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2048 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-03-29 11:59:56 +00:00
Michael R Sweet
64b4177ef4 Copyright updates...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1903 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-01-01 15:11:33 +00:00
Michael R Sweet
70abac1b8b Fix bugs in copy() methods.
Add Fl_Shared_Image class, with get() and release() methods.

Update Fl_Help_View to use Fl_Shared_Image class.

Update image demo to accept a filename, and to use the Fl_Shared_Image
class.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1714 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2001-11-24 02:46:19 +00:00
No Author
3cb5ebe0e8 This commit was manufactured by cvs2svn to create branch 'branch-1.1'.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1513 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2001-08-01 21:24:49 +00:00