Go to the documentation of this file.
40 template <
typename T1>
42 :
Vector<4,T>(color[0],color[1],color[2],color[3]) {}
44 template <
typename T1>
46 :
Vector<4, T>(color[0] * scale, color[1] * scale, color[2] * scale, color[3] * scale) {}
59 Color(
const T&
r = T(),
const T&
g = T(),
const T&
b = T(),
const T&
a = T())
65 T&
r() {
return this->
x(); }
70 T&
g() {
return this->
y(); }
75 T&
b() {
return this->
z(); }
80 T&
a() {
return this->
t(); }
85 const T&
r()
const {
return this->
x(); }
90 const T&
g()
const {
return this->
y(); }
95 const T&
b()
const {
return this->
z(); }
100 const T&
a()
const {
return this->
t(); }
105 void r(
const T& val) { this->
x(val); }
110 void g(
const T& val) { this->
y(val); }
115 void b(
const T& val) { this->
z(val); }
120 void a(
const T& val) { this->
t(val); }
183 double p = v * (1 - s);
184 double q = v * (1 - (s * f));
185 double t = v * (1 - (s * (1 - f)));
241 int i = (int)floor(h);
244 double p = v * (1 - s);
245 double q = v * (1 - (s * f));
246 double t = v * (1 - (s * (1 - f)));
301 h = fmod((g - b) / c, 6);
321 template <>
template <>
323 :
Vector<4,
uchar>(color[0] * 255,color[1] * 255,color[2] * 255,color[3] * 255) {}
325 template <>
template <>
326 inline Colorf::Color(
const Colorb &color)
327 : Vector<4,float>(color[0] / 255.,color[1] / 255.,color[2] / 255.,color[3] / 255.) {}
mgx_EXPORT QColor convertToQColor(const Color< float > &c)
CU_HOST_DEVICE Vector & operator=(const T &value)
Set all the elements to value.
CompositeMode
Color composition modes.
CU_HOST_DEVICE T & z()
Short access to the third element.
Color< T > convertRGBtoHSV(const Color< T > &rgb)
Return a color based on HSV values.
Color< T > convertHSVtoRGB(T h, T s, T v)
Return a color based on HSV values.
void r(const T &val)
Set the red component.
T & g()
Return the green component.
mgx_EXPORT void convertFromQColor(Color< float > &c, const QColor &col)
Colorb stringToColorb(const QString &s)
Map Gui input string to Colorb.
const T & b() const
Return the blue component.
Color< T > & operator=(const Color< T > &c)
Assignment of color data.
CU_HOST_DEVICE T & x()
Short access to the first element.
Color(const T &r=T(), const T &g=T(), const T &b=T(), const T &a=T())
Constructor.
void g(const T &val)
Set the green component.
Distributed matrix library.
const T & g() const
Return the green component.
CU_HOST_DEVICE T & t()
Short access to the fourth element.
T & b()
Return the blue component.
T CU_HOST_DEVICE max(const T a, const T b)
std::vector< Colorb > ColorbVec
Color(const Color< T1 > &color)
Constructor to convert from one color type to another.
T & r()
Return the red component.
Color(const Vector< 4, T > ©)
void a(const T &val)
Set the alpha component.
Namespace containing all the utility classes.
comp::CompositeMode stringToCompMode(const QString &s)
Map Gui input string to Composition mode.
Colorb composite(const Colorb &dest, const Colorb &source, comp::CompositeMode mode=comp::OVER)
Compose a source with dest.
const T & r() const
Return the red component.
Color< T > & operator=(const QColor &c)
void b(const T &val)
Set the blue component.
CU_HOST_DEVICE T min(const T a, const T b)
const T & a() const
Return the alpha component.
QStringList compModes()
Get the list of composition modes.
A utility class to encapsulate color data.
CU_HOST_DEVICE T & y()
Short access to the second element.
T & a()
Return the alpha component.
Color(const Vector< 4, T1 > &color, const T &scale)