| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #3020
Application: | FLTK Library |
Status: | 2 - Closed w/o Resolution |
Priority: | 1 - Request for Enhancement, e.g. asking for a feature |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Image Support |
Summary: | Function for blending two images with different depth of color. |
Version: | 1.3-feature |
Created By: | kdiman |
Assigned To: | AlbrechtS |
Fix Version: | Will Not Fix |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | kdiman 12:50 Dec 17, 2013 |
| Dear devs.
Will be very useful, if FLTK will have a similar function:
/// \return pointer on allocated object of Fl_Image, which /// contains result of blending two images taken from args Fl_Image* fl_image_average(Fl_Image *bg, Fl_Image *fg){ // calculate max depth from two images, // and if its different - to make that equal // for blending (supporting mix GRAY<=>RGB<=>RGBA) }
-- regards | |
|
#2 | AlbrechtS 01:01 Jan 02, 2014 |
| I don't know if this would be useful for many users, and as such useful to be included in FLTK, but if...
The "specs" seem unclear. Which color depth should the resulting image have? That of the foreground image, or the maximum of both images? Anything else?
Also, for blending two images, we would IMHO need an explicit alpha value, or the fg image would need to have an alpha channel included, so the function prototype would probably better be something like:
Fl_Image* fl_image_average(Fl_Image *bg, Fl_Image *fg, int alpha=0)
where alpha=0 could be used as a flag to mean "use the fg image's alpha channel" and other values would be applied directly for all pixels (ignoring any existing alpha channel(s)).
Also, Fl_Image is the base class for some image classes like Fl_RGB_Image and others. What class should the resulting image be? It would probably be best to make the resulting image always an Fl_RGB_Image w/o alpha channel, so that the prototype would become:
Fl_RGB_Image* fl_image_average(Fl_Image *bg, Fl_Image *fg, int alpha=0).
That's only my 2ct, w/o saying that this should be implemented or not. | |
|
#3 | kdiman 23:35 Jan 02, 2014 |
| Yes! Your prototype of the function is better! I have taken Fl_Image because it is base class, which can casted, and alpha's arg is good and useful idea - offered by you!
IMHO: all modern graphical libraries has to support blending images with alpha channel. This can to grow auditorium of users/devs that lib. That can to take about 250 strings of code, but will useful for many devs/users. - THIS WAS IMHO.
-- regards | |
|
#4 | kdiman 00:33 Jan 03, 2014 |
| And for adding to your improved the prototype of function:
Fl_RGB_Image* fl_image_average(Fl_Image *bg, Fl_Image *fg, int alpha=0, int fg_offx=0, int fg_offy);
To there were added offset for fg image... | |
|
#5 | AlbrechtS 15:25 Jan 05, 2023 |
| There are image libraries better suited to do such operations than FLTK.
This won't be implemented in our "Fast Light" GUI library. | |
[ Return to Bugs & Features ]
|
| |