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 » U++ Library support » U++ Core » Color and RGBA
Re: Color and RGBA [message #35504 is a reply to message #35499] Thu, 23 February 2012 22:40 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

mirek wrote on Thu, 23 February 2012 14:52

Well, the main reason for this is that Color supports "special values" while we still want it to be 32bit entity.

OTOH, now thinking about it, it is true that Null could be represented as RGBA(0, 0, 0, 0) and RGBA(x, 0, 0, 0) could in theory represent other special values, because it is invalid in premultiplied format.

We would still need separate RGBA and Color, because RGBA is POD, but I guess things would improve. Also we might have problems with "non-premultiplied" data. Anything else I miss?


As I'm thinking about this I came to the conclusion that the most important is easy of use of the drawing API. What if Draw interface instead of Color class used RGBA structure (like in Painter). RGBA needs only a few useful constructors. According to the POD class definition ( http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/ISOcxx/do c/POD.html) structure with a constructor is still a POD. Color class have operator RGBA defined so it could still be easily used with Draw.
I'm not sure if that is a perfect solution but I also know that current one is not good if it comes to transparency support.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: division by zero check
Next Topic: Problem with Sys() [SOLVED]
Goto Forum:
  


Current Time: Tue May 14 20:01:03 CEST 2024

Total time taken to generate the page: 0.01621 seconds