26 #ifndef __SYNFIG_COLOR_COLOR_HPP
27 #define __SYNFIG_COLOR_COLOR_HPP
39 #include <OpenEXR/half.h>
94 return Color(*
this)+=rhs;
98 {
return Color(*
this)-=rhs; }
101 {
return Color(*
this)*=rhs; }
104 {
return Color(*
this)/=rhs; }
107 {
return r_==rhs.r_ && g_==rhs.g_ && b_==rhs.b_ && a_==rhs.a_; }
110 {
return r_!=rhs.r_ || g_!=rhs.g_ || b_!=rhs.b_ || a_!=rhs.a_; }
113 {
return Color(-r_,-g_,-b_,-a_); }
117 {
return Color(1.0
f-r_,1.0
f-g_,1.0
f-b_,a_); }
124 return Color (r_*a_, g_*a_, b_*a_, a_);
132 return Color (r_*inva, g_*inva, b_*inva, a_);
133 }
else return alpha();
219 return sqrt(u*u+v*v);
226 set_g(y*DecodeYUV[1][0]+u*DecodeYUV[1][1]+v*DecodeYUV[1][2]);
227 set_b(y*DecodeYUV[2][0]+u*DecodeYUV[2][1]+v*DecodeYUV[2][2]);
248 const float s(sqrt(u*u+v*v));
260 {
return Color().set_yuv(y,u,v).set_a(a); }
275 const float s(
get_s());
277 u(s*(
float)Angle::sin(theta).
get()),
278 v(s*(
float)Angle::cos(theta).
get());
288 const float a(Angle::sin(theta).
get()), b(Angle::cos(theta).
get());
291 return set_uv(b*u-a*v,a*u+b*v);
299 s*(
float)Angle::sin(theta).
get(),
300 s*(
float)Angle::cos(theta).
get()
305 {
return Color().set_yuv(y,s,theta).set_a(a); }
328 #endif // __SYNFIG_COLOR_COLOR_HPP