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 |
|
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.
|
|
|
|
|
Color and RGBA
By: unodgs on Wed, 22 February 2012 12:24
|
|
|
Re: Color and RGBA
By: mirek on Thu, 23 February 2012 20:52
|
|
|
Re: Color and RGBA
By: unodgs on Thu, 23 February 2012 22:40
|
|
|
Re: Color and RGBA
By: Tom1 on Thu, 23 February 2012 22:49
|
|
|
Re: Color and RGBA
By: unodgs on Fri, 24 February 2012 08:06
|
|
|
Re: Color and RGBA
By: Tom1 on Fri, 24 February 2012 13:32
|
|
|
Re: Color and RGBA
By: mirek on Fri, 24 February 2012 14:03
|
|
|
Re: Color and RGBA
By: mirek on Fri, 24 February 2012 14:05
|
|
|
Re: Color and RGBA
By: Tom1 on Fri, 24 February 2012 14:57
|
|
|
Re: Color and RGBA
By: mirek on Fri, 24 February 2012 15:40
|
|
|
Re: Color and RGBA
By: mirek on Sun, 04 March 2012 00:29
|
Goto Forum:
Current Time: Tue May 14 20:01:03 CEST 2024
Total time taken to generate the page: 0.01621 seconds
|