|
From: <ba...@us...> - 2006-06-11 23:30:45
|
Revision: 340 Author: bardtx Date: 2006-06-11 16:30:40 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/cadcdev/?rev=340&view=rev Log Message: ----------- tiki: import combinatorial Color operators from Tsunami Modified Paths: -------------- tiki/include/Tiki/color.h Modified: tiki/include/Tiki/color.h =================================================================== --- tiki/include/Tiki/color.h 2006-06-08 20:44:50 UTC (rev 339) +++ tiki/include/Tiki/color.h 2006-06-11 23:30:40 UTC (rev 340) @@ -55,6 +55,21 @@ return *this; } + // These must be used in some cases because C++ is too dumb to + // handle the precedence sensibly... + Color mult(const Color & o) const { + return Color(a*o.a, r*o.r, g*o.g, b*o.b); + } + Color mult(float f) const { + return Color(a*f, r*f, g*f, b*f); + } + Color add(const Color & o) const { + return Color(a+o.a, r+o.r, g+o.g, b+o.b); + } + Color sub(const Color & o) const { + return Color(a-o.a, r-o.r, g-o.g, b-o.b); + } + operator uint32() const { float ta, tr, tg, tb; ta = (a < 0.0f) ? 0.0f : (a > 1.0f) ? 1.0f : a; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |