Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Unfortunate change in Image interface -> going premultiplied...
Unfortunate change in Image interface -> going premultiplied... [message #10745] |
Fri, 27 July 2007 12:40 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
This is quite unfortunate and a result of my wrong design decision...
So far, Image RGBA format was "straight", unlike almost any other GUI library in existence.
Unfortunately, long term this is like uphill battle - many operations are really best implemented with premultiplied RGBA format. For example, *correct* rescaling would be many times slower with straight alpha, in fact the only reasonable way how to implement correct rescaling for straight format is to premultiply, rescale and unmultiply...
Therefore it is now required that RGBA pixels in Image are premultiplied, at least if it goes to most operations or is to be painted.
OTOH, it is true that for some operations straight format is better. That is why there are now Premultiply and Unmultiply operations (for ImageBuffer and Image). Also, there are some straight operations, these usually have "Straight" in the name.
Also, to convert Color to RGBA, you can now use operator*, which will correctly premultiply all channels.
Warning, this change is going to break some code - it took me about 2 hours to "fix" my codebase. OTOH, only code that deals with RGBA pixels is going to be affected, and usually it can be easily fixed using Premultiply/Unmultiply...
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue May 21 17:23:32 CEST 2024
Total time taken to generate the page: 0.01978 seconds
|