Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpRGBf.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * 32-bit floating point RGB pixel.
32 */
33
34#ifndef vpRGBf_h
35#define vpRGBf_h
36
43#include <visp3/core/vpColVector.h>
44
56class VISP_EXPORT vpRGBf
57{
58public:
64 inline vpRGBf() : R(0), G(0), B(0) {}
65
75 inline vpRGBf(float r, float g, float b)
76 : R(r), G(g), B(b)
77 {
78 }
79
87 inline vpRGBf(float v) : R(v), G(v), B(v) {}
88
92 inline vpRGBf(const vpRGBf &v) : R(v.R), G(v.G), B(v.B) {}
93
101 inline vpRGBf(const vpColVector &v) : R(0), G(0), B(0) { *this = v; }
102
103 vpRGBf &operator=(float v);
104 vpRGBf &operator=(const vpRGBf &v);
105#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
106 vpRGBf &operator=(const vpRGBf &&v);
107#endif
108 vpRGBf &operator=(const vpColVector &v);
109 bool operator==(const vpRGBf &v) const;
110 bool operator!=(const vpRGBf &v) const;
111
112 vpColVector operator-(const vpRGBf &v) const;
113 vpRGBf operator+(const vpRGBf &v) const;
114 vpColVector operator-(const vpColVector &v) const;
115 vpColVector operator+(const vpColVector &v) const;
116 vpColVector operator*(float v) const;
117 vpColVector operator*(double v) const;
118
119 bool operator<(const vpRGBf &v) const;
120 bool operator>(const vpRGBf &v) const;
121
122 friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpRGBf &rgb);
123
124public:
125 float R;
126 float G;
127 float B;
128
129 friend VISP_EXPORT vpRGBf operator*(double x, const vpRGBf &rgb);
130};
131
132#endif
Implementation of column vector and the associated operations.
vpRGBf()
Definition vpRGBf.h:64
vpRGBf(const vpColVector &v)
Definition vpRGBf.h:101
float B
Blue component.
Definition vpRGBf.h:127
vpRGBf(float r, float g, float b)
Definition vpRGBf.h:75
vpRGBf(float v)
Definition vpRGBf.h:87
float G
Green component.
Definition vpRGBf.h:126
vpRGBf(const vpRGBf &v)
Definition vpRGBf.h:92
float R
Red component.
Definition vpRGBf.h:125
vpColVector operator*(const double &x, const vpColVector &v)