Go to the documentation of this file.00001
00002
00003 #ifndef _COLOR_H_
00004 #define _COLOR_H_
00005
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008
00009 namespace render
00010 {
00012
00022 class ENGINE_PUBLIC_EXPORT Color
00023 {
00024 public:
00025 Color(f32 red = 1.0f, f32 green = 1.0f, f32 blue = 1.0f, f32 alpha = 1.0f);
00026 Color(const Color& other);
00027
00028 inline Color& operator=(const Color& other);
00029
00030
00031 inline Color operator+(const Color& other) const;
00032 inline Color& operator+=(const Color& other);
00033
00034 inline Color operator-(const Color& other) const;
00035 inline Color& operator-=(const Color& other);
00036
00037 inline Color operator*(const Color& other) const;
00038 inline Color operator*(const f32 v) const;
00039 inline Color& operator*=(const f32 v);
00040
00041 inline Color operator/(const Color& other) const;
00042 inline Color operator/(const f32 v) const;
00043 inline Color& operator/=(const f32 v);
00044
00045 inline bool operator==(const Color& other) const;
00046 inline bool operator!=(const Color& other) const;
00047
00048 f32* get();
00049 const f32* get() const;
00050
00052 void setAsRGBA(const u32 val);
00053
00055 void setAsARGB(const u32 val);
00056
00058 void setAsBGRA(const u32 val);
00059
00061 void setAsABGR(const u32 val);
00062
00067 void setHSB(f32 hue, f32 saturation, f32 brightness);
00068
00070 u32 getAsRGBA() const;
00071
00073 u32 getAsARGB() const;
00074
00076 u32 getAsBGRA() const;
00077
00079 u32 getAsABGR() const;
00080
00081 f32 R, G, B, A;
00082
00083 static const Color ZERO;
00084 static const Color Black;
00085 static const Color White;
00086 static const Color Red;
00087 static const Color Green;
00088 static const Color Blue;
00089 };
00090
00091 }
00092
00093 #endif