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 » Draw, Display, Images, Bitmaps, Icons » Should RGBA have got 4 arguments constructor?
Re: Should RGBA have got 4 arguments constructor? [message #43410 is a reply to message #43397] Fri, 25 July 2014 20:26 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1100
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

Quote:

OK, but premultiplied alpha issue is still there... Should we add ASSERT
RGBA(byte r, byte g, byte b, byte a) {
    ASSERT(r <= a && g <= a && b <= a);
    this->r = r;
    this->g = g;
    this->b = b;
    this->a = a;
}

or perform conversion?


I don't know anything about "premultiplied alpha issue", but personally I think that implicit conversion would be safer for U++ users.

Moreover, I would like to noticed that it will be fine if we will have unit tests for RGBA. Each time the test failed we will know that something isn't ok in RGBA.

Sincerely,
Klugier


U++ - one framework to rule them all.
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Drawing performance issue
Next Topic: Painter and viewports
Goto Forum:
  


Current Time: Mon Jul 07 03:50:45 CEST 2025

Total time taken to generate the page: 0.03601 seconds