ViSP  2.8.0
vpRGBa.h
1 /****************************************************************************
2  *
3  * $Id: vpRGBa.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * RGBA pixel.
36  *
37  * Authors:
38  * Eric Marchand
39  * Fabien Spindler
40  *
41  *****************************************************************************/
42 
43 
44 #ifndef vpRGBa_h
45 #define vpRGBa_h
46 
53 #include <visp/vpColVector.h>
54 
55 
68 class VISP_EXPORT vpRGBa
69 {
70 public:
77  inline vpRGBa()
78  : R(0), G(0), B(0), A(0)
79  {
80  };
81 
93  inline vpRGBa(const unsigned char &R, const unsigned char &G,
94  const unsigned char &B, const unsigned char &A=0)
95  : R(R), G(G), B(B), A(A)
96  {
97  };
98 
99 
108  inline vpRGBa(const unsigned char &v)
109  : R(v), G(v), B(v), A(v)
110  {
111  };
112 
113 
117  inline vpRGBa(const vpRGBa &v)
118  {
119  *this = v ;
120  };
121 
131  inline vpRGBa(const vpColVector &v)
132  {
133  *this = v ;
134  }
135 
136  void operator=(const unsigned char &v) ;
137  void operator=(const vpRGBa &v) ;
138  void operator=(const vpColVector &v) ;
139  bool operator==(const vpRGBa &v);
140  bool operator!=(const vpRGBa &v);
141 
142  vpColVector operator-(const vpRGBa &v) const;
143  vpRGBa operator+(const vpRGBa &v) const;
144  vpColVector operator-(const vpColVector &v) const;
145  vpColVector operator+(const vpColVector &v) const;
146  vpColVector operator*(const float &v) const;
147  vpColVector operator*(const double &v) const;
148 
149  bool operator<(const vpRGBa &v) const;
150  bool operator>(const vpRGBa &v) const;
151 
152  public:
153  unsigned char R ;
154  unsigned char G ;
155  unsigned char B ;
156  unsigned char A ;
157 
158  friend VISP_EXPORT vpRGBa operator*(const double &x, const vpRGBa &rgb);
159 
160 } ;
161 
162 #endif
163 
164 /*
165  * Local variables:
166  * c-basic-offset: 2
167  * End:
168  */
unsigned char B
Blue component.
Definition: vpRGBa.h:155
vpRGBa()
Definition: vpRGBa.h:77
vpRGBa(const unsigned char &R, const unsigned char &G, const unsigned char &B, const unsigned char &A=0)
Definition: vpRGBa.h:93
unsigned char G
Green component.
Definition: vpRGBa.h:154
vpRGBa(const vpRGBa &v)
Definition: vpRGBa.h:117
Class that defines a RGB 32 bits structure.
Definition: vpRGBa.h:68
vpRGBa(const vpColVector &v)
Definition: vpRGBa.h:131
unsigned char A
Additionnal component.
Definition: vpRGBa.h:156
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
unsigned char R
Red component.
Definition: vpRGBa.h:153
vpRGBa(const unsigned char &v)
Definition: vpRGBa.h:108