Carna  Version 3.3.2
Color.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef COLOR_H_6014714286
13 #define COLOR_H_6014714286
14 
15 #include <Carna/Carna.h>
16 #include <Carna/base/noncopyable.h>
17 #include <Carna/base/math.h>
18 
23 namespace Carna
24 {
25 
26 namespace base
27 {
28 
29 
30 
31 // ----------------------------------------------------------------------------------
32 // Color
33 // ----------------------------------------------------------------------------------
34 
41 class CARNA_LIB Color
42 {
43 
44 public:
45 
46  const static Color WHITE;
47  const static Color WHITE_NO_ALPHA;
48  const static Color BLACK;
49  const static Color BLACK_NO_ALPHA;
50  const static Color RED;
51  const static Color RED_NO_ALPHA;
52  const static Color GREEN;
53  const static Color GREEN_NO_ALPHA;
54  const static Color BLUE;
55  const static Color BLUE_NO_ALPHA;
56 
61  Color( const math::Vector4f& );
62 
66  Color( unsigned char r, unsigned char g, unsigned char b, unsigned char a );
67 
71  Color();
72 
73  unsigned char r;
74  unsigned char g;
75  unsigned char b;
76  unsigned char a;
77 
82  operator math::Vector4f() const;
83 
87  bool operator==( const Color& other ) const;
88 
92  bool operator<( const Color& other ) const;
93 
97  Color& operator=( const Color& other );
98 
99 }; // Color
100 
101 
102 
103 } // namespace Carna :: base
104 
105 } // namespace Carna
106 
107 #endif // COLOR_H_6014714286
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
unsigned char a
Holds the alpha component.
Definition: Color.h:76
unsigned char r
Holds the red component.
Definition: Color.h:73
Eigen::Matrix< float, 4, 1 > Vector4f
Defines vector.
Definition: math.h:195
unsigned char g
Holds the green component.
Definition: Color.h:74
static const Color GREEN
Holds Color(0, 255, 0, 255).
Definition: Color.h:52
static const Color RED
Holds Color(255, 0, 0, 255).
Definition: Color.h:50
unsigned char b
Holds the blue component.
Definition: Color.h:75
Represents a color. Objects from this class are copyable and assignable.
Definition: Color.h:41
static const Color BLUE
Holds Color(0, 0, 255, 255).
Definition: Color.h:54
static const Color WHITE_NO_ALPHA
Holds Color(255, 255, 255, 0).
Definition: Color.h:47
static const Color RED_NO_ALPHA
Holds Color(255, 0, 0, 0).
Definition: Color.h:51
static const Color BLACK
Holds Color(0, 0, 0, 255).
Definition: Color.h:48
static const Color WHITE
Holds Color(255, 255, 255, 255).
Definition: Color.h:46
static const Color BLACK_NO_ALPHA
Holds Color(0, 0, 0, 0).
Definition: Color.h:49
static const Color GREEN_NO_ALPHA
Holds Color(0, 255, 0, 0).
Definition: Color.h:53
static const Color BLUE_NO_ALPHA
Holds Color(0, 0, 255, 0).
Definition: Color.h:55