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);
126 const unsigned int val_4 = 4;
130 const unsigned int index_0 = 0;
131 const unsigned int index_1 = 1;
132 const unsigned int index_2 = 2;
133 const unsigned int index_3 = 3;
134 R =
static_cast<unsigned char>(v[index_0]);
135 G =
static_cast<unsigned char>(v[index_1]);
136 B =
static_cast<unsigned char>(v[index_2]);
137 A =
static_cast<unsigned char>(v[index_3]);
148 return (
R == v.
R) && (
G == v.
G) && (
B == v.
B) && (
A == v.
A);
165 const unsigned int index_0 = 0;
166 const unsigned int index_1 = 1;
167 const unsigned int index_2 = 2;
168 const unsigned int index_3 = 3;
169 n[index_0] =
static_cast<double>(
R) -
static_cast<double>(v.
R);
170 n[index_1] =
static_cast<double>(
G) -
static_cast<double>(v.
G);
171 n[index_2] =
static_cast<double>(
B) -
static_cast<double>(v.
B);
172 n[index_3] =
static_cast<double>(
A) -
static_cast<double>(v.
A);
185 n.
R =
static_cast<unsigned char>(
R + v.
R);
186 n.
G =
static_cast<unsigned char>(
G + v.
G);
187 n.
B =
static_cast<unsigned char>(
B + v.
B);
188 n.
A =
static_cast<unsigned char>(
A + v.
A);
200 const unsigned int index_0 = 0;
201 const unsigned int index_1 = 1;
202 const unsigned int index_2 = 2;
203 const unsigned int index_3 = 3;
204 n[index_0] =
R - v[index_0];
205 n[index_1] =
G - v[index_1];
206 n[index_2] =
B - v[index_2];
207 n[index_3] =
A - v[index_3];
219 const unsigned int index_0 = 0;
220 const unsigned int index_1 = 1;
221 const unsigned int index_2 = 2;
222 const unsigned int index_3 = 3;
223 n[index_0] =
R + v[index_0];
224 n[index_1] =
G + v[index_1];
225 n[index_2] =
B + v[index_2];
226 n[index_3] =
A + v[index_3];
238 const unsigned int index_0 = 0;
239 const unsigned int index_1 = 1;
240 const unsigned int index_2 = 2;
241 const unsigned int index_3 = 3;
257 const unsigned int index_0 = 0;
258 const unsigned int index_1 = 1;
259 const unsigned int index_2 = 2;
260 const unsigned int index_3 = 3;
270 double gray1 = (0.2126 *
R) + (0.7152 *
G) + (0.0722 *
B);
271 double gray2 = (0.2126 * v.
R) + (0.7152 * v.
G) + (0.0722 * v.
B);
273 return (gray1 < gray2);
278 double gray1 = (0.2126 *
R) + (0.7152 *
G) + (0.0722 *
B);
279 double gray2 = (0.2126 * v.
R) + (0.7152 * v.
G) + (0.0722 * v.
B);
281 return (gray1 > gray2);
294 rgba.
R =
static_cast<unsigned char>(rgb.
R * x);
295 rgba.
G =
static_cast<unsigned char>(rgb.
G * x);
296 rgba.
B =
static_cast<unsigned char>(rgb.
B * x);
328 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