Remove prototype boost serialiation code.
[mussa.git] / alg / color.hpp
1 #ifndef _GLCOLOR_H_
2 #define _GLCOLOR_H_
3
4 #include <boost/shared_ptr.hpp>
5
6 #include <ostream>
7
8 class Color;
9 typedef boost::shared_ptr<Color> ColorRef;
10
11 //! convienece class for handling opengl colors
12 class Color
13 {
14 public:
15   Color();
16   Color(const Color &);
17   //! initialize with red, green, blue, alpha
18   Color(float r, float g, float b, float a=1.0);
19   Color(const ColorRef);
20
21   //! set all channels simultaneously 
22   void set(float r, float g, float b, float a=1.0);
23   //! return an array of 4 colors (stored by class)
24   const float* const get() const;
25   void setR(float);
26   float r() const;
27   void setG(float);
28   float g() const;
29   void setB(float);
30   float b() const;
31   void setA(float);
32   float a() const;
33
34   enum color_channels { RedChannel, GreenChannel, BlueChannel, AlphaChannel };
35   friend bool operator==(const Color&, const Color&);
36   friend std::ostream& operator<<(std::ostream&, const Color&);
37
38 protected:
39   float colors[4];
40
41 };
42 #endif
43