37 template <
typename T1>
39 :
Vector<4, T>(color[0] * scale, color[1] * scale, color[2] * scale, color[3] * scale)
43 template <
typename T1>
45 :
Vector<4, T>(color[0] * scale, color[1] * scale, color[2] * scale, color[3] * scale)
55 convertFromQColor(*
this, c);
65 Color(
const T&
r = T(),
const T&
g = T(),
const T&
b = T(),
const T&
a = T())
129 void r(
const T& val) {
136 void g(
const T& val) {
143 void b(
const T& val) {
150 void a(
const T& val) {
158 convertFromQColor(*
this, c);
161 operator QColor()
const {
return convertToQColor(*
this); }
229 double p = v * (1 - s);
230 double q = v * (1 - (s * f));
231 double t = v * (1 - (s * (1 - f)));
287 int i = (int)floor(h);
290 double p = v * (1 - s);
291 double q = v * (1 - (s * f));
292 double t = v * (1 - (s * (1 - f)));
339 T M = std::max(std::max(r, g), b);
340 T m = std::min(std::min(r, g), b);
347 h = fmod((g - b) / c, 6);
Defines the util::clamp function.
A utility class to encapsulate color data.
Definition: Color.hpp:32
Color(const Vector< 4, T1 > &color, const T &scale=1)
Constructor to convert from one color type to another.
Definition: Color.hpp:38
T & b()
Return the blue component.
Definition: Color.hpp:87
const T & r() const
Return the red component.
Definition: Color.hpp:101
const T & a() const
Return the alpha component.
Definition: Color.hpp:122
T & r()
Return the red component.
Definition: Color.hpp:73
void g(const T &val)
Set the green component.
Definition: Color.hpp:136
CU_HOST_DEVICE T & y()
Short access to the second element.
Definition: Vector.hpp:706
CU_HOST_DEVICE T & t()
Short access to the fourth element.
Definition: Vector.hpp:724
void r(const T &val)
Set the red component.
Definition: Color.hpp:129
T & a()
Return the alpha component.
Definition: Color.hpp:94
CU_HOST_DEVICE T & i()
Short access to the first element.
Definition: Vector.hpp:806
Color< T > convertHSVtoRGB(T h, T s, T v)
Return a color based on HSV values.
Definition: Color.hpp:212
T & g()
Return the green component.
Definition: Color.hpp:80
CU_HOST_DEVICE T & x()
Short access to the first element.
Definition: Vector.hpp:697
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
const T & g() const
Return the green component.
Definition: Color.hpp:108
Namespace containing all the utility classes.
Definition: Vector.hpp:47
const T & b() const
Return the blue component.
Definition: Color.hpp:115
Color< T > convertRGBtoHSV(const Color< T > &rgb)
Return a color based on HSV values.
Definition: Color.hpp:331
CU_HOST_DEVICE T & z()
Short access to the third element.
Definition: Vector.hpp:715
Color(const T &r=T(), const T &g=T(), const T &b=T(), const T &a=T())
Constructor.
Definition: Color.hpp:65
Color< T > & operator=(const Color< T > &c)
Assignment of color data.
Definition: Color.hpp:193
void a(const T &val)
Set the alpha component.
Definition: Color.hpp:150
void b(const T &val)
Set the blue component.
Definition: Color.hpp:143
Defines the Vector class template This file is shared by cuda, do not include headers that nvcc can't...
CU_HOST_DEVICE Vector & operator=(const Vector &vec)
Vector copy.
Definition: Vector.hpp:397