stromx  0.8.0
Color.h
1 /*
2  * Copyright 2013 Matthias Fuchs
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef STROMX_RUNTIME_COLOR_H
18 #define STROMX_RUNTIME_COLOR_H
19 
20 #ifdef __GNUG__
21  #include <tr1/cstdint>
22 #else
23  #include <cstdint>
24 #endif
25 
26 #include <iostream>
27 
28 #include "stromx/runtime/Config.h"
29 
30 namespace stromx
31 {
32  namespace runtime
33  {
35  class Color
36  {
37  public:
40  : m_r(0), m_g(0), m_b(0) {}
41 
43  Color(const uint8_t r, const uint8_t g, const uint8_t b)
44  : m_r(r), m_g(g), m_b(b) {}
45 
47  uint8_t r() const { return m_r; }
48 
50  uint8_t g() const { return m_g; }
51 
53  uint8_t b() const { return m_b; }
54 
55  private:
56  uint8_t m_r;
57  uint8_t m_g;
58  uint8_t m_b;
59  };
60 
61  STROMX_RUNTIME_API std::ostream& operator<< (std::ostream& out, const Color & color);
62  STROMX_RUNTIME_API std::istream& operator>> (std::istream& in, Color & color);
63  STROMX_RUNTIME_API bool operator==(const Color & lhs, const Color & rhs);
64  }
65 }
66 
67 #endif // STROMX_RUNTIME_COLOR_H
RGB color.
Definition: Color.h:35
uint8_t g() const
Definition: Color.h:50
Color()
Definition: Color.h:39
uint8_t b() const
Definition: Color.h:53
The stromx class library.
Definition: AdjustRgbChannels.cpp:29
Color(const uint8_t r, const uint8_t g, const uint8_t b)
Definition: Color.h:43
uint8_t r() const
Definition: Color.h:47