Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
mirek is currently offline  mirek
Messages: 14267
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... Smile

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...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: fixed compiling SQL_PostgreSql reference (Bas)
Next Topic: Optimized painting when there is a lot of out of screen widgets...
Goto Forum:
  


Current Time: Wed Aug 27 12:39:38 CEST 2025

Total time taken to generate the page: 0.06091 seconds