DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Color.ih
1 
29 
30 // IMPLEMENTATION of inline methods.
32 
34 #include <cstdlib>
36 
37 
38 
40 // Implementation of inline methods //
41 
42 
44 // Implementation of inline functions and external operators //
45 
52 inline
53 std::ostream&
54 DGtal::operator<< ( std::ostream & out,
55  const Color & object )
56 {
57  object.selfDisplay ( out );
58  return out;
59 }
60 
61 
62 
63 inline Color &
64 DGtal::Color::setRGBi( const unsigned char aRedValue,
65  const unsigned char aGreenValue,
66  const unsigned char aBlueValue,
67  const unsigned char aAlphaValue ) {
68  myRed = aRedValue;
69  myGreen = aGreenValue;
70  myBlue = aBlueValue;
71  myAlpha = aAlphaValue;
72  return *this;
73 }
74 
75 
76 inline void
77 DGtal::Color::red( const unsigned char aRedValue )
78 {
79  myRed = aRedValue;
80 }
81 
82 inline void
83 DGtal::Color::green( unsigned char aGreenValue )
84 {
85  myGreen = aGreenValue;
86 }
87 
88 inline void
89 DGtal::Color::blue( unsigned char aBlueValue )
90 {
91  myBlue = aBlueValue;
92 }
93 
94 inline void
95 DGtal::Color::alpha( unsigned char aAlphaValue )
96 {
97  myAlpha = aAlphaValue;
98 }
99 
100 inline
101 unsigned char
103 {
104  return myRed;
105 }
106 
107 inline
108 unsigned char
110 {
111  return myGreen;
112 }
113 
114 inline
115 unsigned char
117 {
118  return myBlue;
119 }
120 
121 inline
122 unsigned char
124 {
125  return myAlpha;
126 }
127 
128 
129 inline
130 bool
132 {
133  return (*this) != Color::None;
134 }
135 
136 // //
138 
139