ViSP  2.9.0
vpColor.h
1 /****************************************************************************
2  *
3  * $Id: vpColor.h 4649 2014-02-07 14:57:11Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 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  * Color definition.
36  *
37  * Authors:
38  * Eric Marchand
39  * Fabien Spindler
40  *
41  *****************************************************************************/
42 
43 
44 #ifndef vpColor_hh
45 #define vpColor_hh
46 
47 
48 #include <visp/vpConfig.h>
49 #include <visp/vpRGBa.h>
50 
125 class VISP_EXPORT vpColor : public vpRGBa
126 {
127  public:
129  typedef enum {
130  id_black=0,
149  id_unknown
154  } vpColorIdentifier;
155 
160  /* Predefined colors. */
161  static const vpColor black ;
162  static const vpColor white ;
163  static const vpColor lightGray;
164  static const vpColor gray;
165  static const vpColor darkGray;
166  static const vpColor lightRed;
167  static const vpColor red ;
168  static const vpColor darkRed;
169  static const vpColor lightGreen;
170  static const vpColor green;
171  static const vpColor darkGreen;
172  static const vpColor lightBlue;
173  static const vpColor blue ;
174  static const vpColor darkBlue;
175  static const vpColor yellow ;
176  static const vpColor cyan;
177  static const vpColor orange;
178  static const vpColor purple;
179  static const vpColor none;
180 
181  static const unsigned int nbColors;
182  static const vpColor allColors[];
183 
191  inline vpColor()
192  : vpRGBa(), id(id_unknown)
193  {};
204  inline vpColor(unsigned char r, unsigned char g, unsigned char b,
206  : vpRGBa(r, g, b), id(cid)
207  {};
208 
209  friend VISP_EXPORT bool operator==( const vpColor &c1, const vpColor &c2 );
210  friend VISP_EXPORT bool operator!=( const vpColor &c1, const vpColor &c2 );
222  inline void setColor(unsigned char r, unsigned char g, unsigned char b) {
223  this->R = r;
224  this->G = g;
225  this->B = b;
226  this->A = 0;
227  id = id_unknown;
228  };
229 
236  static inline vpColor getColor(const unsigned int &i) {
238  };
239 
240 };
241 
242 #endif
vpColor()
Definition: vpColor.h:191
void setColor(unsigned char r, unsigned char g, unsigned char b)
Definition: vpColor.h:222
static const vpColor allColors[]
Definition: vpColor.h:182
static const vpColor black
Definition: vpColor.h:161
static const vpColor darkRed
Definition: vpColor.h:168
Class to define colors available for display functionnalities.
Definition: vpColor.h:125
static const vpColor none
Definition: vpColor.h:179
static const vpColor lightGray
Definition: vpColor.h:163
static const vpColor darkBlue
Definition: vpColor.h:174
static const vpColor green
Definition: vpColor.h:170
static const vpColor lightRed
Definition: vpColor.h:166
Class that defines a RGB 32 bits structure.
Definition: vpRGBa.h:68
static const vpColor red
Definition: vpColor.h:167
static const vpColor orange
Definition: vpColor.h:177
vpColorIdentifier id
Definition: vpColor.h:156
bool operator==(const vpRGBa &v)
Definition: vpRGBa.cpp:112
static const vpColor cyan
Definition: vpColor.h:176
static const vpColor lightGreen
Definition: vpColor.h:169
vpColorIdentifier
Definition: vpColor.h:129
static const vpColor gray
Definition: vpColor.h:164
static const vpColor darkGray
Definition: vpColor.h:165
static const vpColor darkGreen
Definition: vpColor.h:171
static vpColor getColor(const unsigned int &i)
Definition: vpColor.h:236
static const vpColor yellow
Definition: vpColor.h:175
static const vpColor lightBlue
Definition: vpColor.h:172
static const vpColor purple
Definition: vpColor.h:178
static const vpColor white
Definition: vpColor.h:162
bool operator!=(const vpRGBa &v)
Definition: vpRGBa.cpp:130
static const unsigned int nbColors
Definition: vpColor.h:181
static const vpColor blue
Definition: vpColor.h:173
vpColor(unsigned char r, unsigned char g, unsigned char b, vpColor::vpColorIdentifier cid=vpColor::id_unknown)
Definition: vpColor.h:204