40 #include <visp3/core/vpColor.h>
41 #include <visp3/core/vpException.h>
42 #include <visp3/core/vpRGBa.h>
101 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
107 this->
R = std::move(v.R);
108 this->
G = std::move(v.G);
109 this->
B = std::move(v.B);
110 this->
A = std::move(v.A);
129 const unsigned int index_0 = 0;
130 const unsigned int index_1 = 1;
131 const unsigned int index_2 = 2;
132 const unsigned int index_3 = 3;
133 R =
static_cast<unsigned char>(v[index_0]);
134 G =
static_cast<unsigned char>(v[index_1]);
135 B =
static_cast<unsigned char>(v[index_2]);
136 A =
static_cast<unsigned char>(v[index_3]);
147 return (
R == v.
R) && (
G == v.
G) && (
B == v.
B) && (
A == v.
A);
164 const unsigned int index_0 = 0;
165 const unsigned int index_1 = 1;
166 const unsigned int index_2 = 2;
167 const unsigned int index_3 = 3;
168 n[index_0] =
static_cast<double>(
R) -
static_cast<double>(v.
R);
169 n[index_1] =
static_cast<double>(
G) -
static_cast<double>(v.
G);
170 n[index_2] =
static_cast<double>(
B) -
static_cast<double>(v.
B);
171 n[index_3] =
static_cast<double>(
A) -
static_cast<double>(v.
A);
184 n.
R =
static_cast<unsigned char>(
R + v.
R);
185 n.
G =
static_cast<unsigned char>(
G + v.
G);
186 n.
B =
static_cast<unsigned char>(
B + v.
B);
187 n.
A =
static_cast<unsigned char>(
A + v.
A);
199 const unsigned int index_0 = 0;
200 const unsigned int index_1 = 1;
201 const unsigned int index_2 = 2;
202 const unsigned int index_3 = 3;
203 n[index_0] =
R - v[index_0];
204 n[index_1] =
G - v[index_1];
205 n[index_2] =
B - v[index_2];
206 n[index_3] =
A - v[index_3];
218 const unsigned int index_0 = 0;
219 const unsigned int index_1 = 1;
220 const unsigned int index_2 = 2;
221 const unsigned int index_3 = 3;
222 n[index_0] =
R + v[index_0];
223 n[index_1] =
G + v[index_1];
224 n[index_2] =
B + v[index_2];
225 n[index_3] =
A + v[index_3];
237 const unsigned int index_0 = 0;
238 const unsigned int index_1 = 1;
239 const unsigned int index_2 = 2;
240 const unsigned int index_3 = 3;
256 const unsigned int index_0 = 0;
257 const unsigned int index_1 = 1;
258 const unsigned int index_2 = 2;
259 const unsigned int index_3 = 3;
269 double gray1 = (0.2126 *
R) + (0.7152 *
G) + (0.0722 *
B);
270 double gray2 = (0.2126 * v.
R) + (0.7152 * v.
G) + (0.0722 * v.
B);
272 return (gray1 < gray2);
277 double gray1 = (0.2126 *
R) + (0.7152 *
G) + (0.0722 *
B);
278 double gray2 = (0.2126 * v.
R) + (0.7152 * v.
G) + (0.0722 * v.
B);
280 return (gray1 > gray2);
293 rgba.
R =
static_cast<unsigned char>(rgb.
R * x);
294 rgba.
G =
static_cast<unsigned char>(rgb.
G * x);
295 rgba.
B =
static_cast<unsigned char>(rgb.
B * x);
327 os <<
"(" <<
static_cast<int>(rgba.
R) <<
"," <<
static_cast<int>(rgba.
G) <<
"," <<
static_cast<int>(rgba.
B) <<
"," <<
static_cast<int>(rgba.
A) <<
")";
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
unsigned int getRows() const
Implementation of column vector and the associated operations.
vpColVector operator*(const double &x, const vpColVector &v)
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
vpColVector operator-(const vpRGBa &v) const
unsigned char B
Blue component.
unsigned char R
Red component.
bool operator<(const vpRGBa &v) const
vpRGBa operator+(const vpRGBa &v) const
unsigned char G
Green component.
unsigned char A
Additionnal component.
bool operator>(const vpRGBa &v) const
vpRGBa & operator=(const unsigned char &v)
vpColVector operator*(const float &v) const
bool operator!=(const vpRGBa &v) const
bool operator==(const vpRGBa &v) const