Go to the documentation of this file.00001 #ifndef __NYTRO_Color_H
00002 #define __NYTRO_Color_H
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "system/nyCommon.h"
00012
00013 namespace Nytro
00014 {
00015 namespace Graphics
00016 {
00018 class NYTRO_API Color
00019 {
00020 public:
00021
00022 Color();
00023 Color( const Color& rColor );
00024 Color( float32 aR, float32 aG, float32 aB, float32 aA = 1 );
00025 ~Color();
00026
00028 float32 getRed();
00030 float32 getGreen();
00032 float32 getBlue();
00034 float32 getAlpha();
00036 uint32 getRGBA();
00037
00039 void set( float32 aR, float32 aG, float32 aB, float32 aA = 1 );
00041 void setRed( float32 aValue );
00043 void setGreen( float32 aValue );
00045 void setBlue( float32 aValue );
00047 void setAlpha( float32 aValue );
00049 void setRGBA( uint32 aValue );
00050
00051 Color operator + ( Color& rColor );
00052 Color operator - ( Color& rColor );
00053 Color operator * ( Color& rColor );
00054 Color operator / ( Color& rColor );
00055 Color operator + ( float32 aValue );
00056 Color operator - ( float32 aValue );
00057 Color operator * ( float32 aValue );
00058 Color operator / ( float32 aValue );
00059 Color& operator += ( Color& rColor );
00060 Color& operator -= ( Color& rColor );
00061 Color& operator *= ( Color& rColor );
00062 Color& operator /= ( Color& rColor );
00063 Color& operator += ( float32 aValue );
00064 Color& operator -= ( float32 aValue );
00065 Color& operator *= ( float32 aValue );
00066 Color& operator /= ( float32 aValue );
00067 const Color& operator = ( const Color& rOriginal );
00068 const Color& operator = ( const string& rOriginal );
00069
00070 bool operator == ( const Color& crOther )
00071 {
00072 return r == crOther.r && g == crOther.g && b == crOther.b && a == crOther.a;
00073 }
00074
00075 bool operator <= ( const Color& crOther )
00076 {
00077 return r <= crOther.r && g <= crOther.g && b <= crOther.b && a <= crOther.a;
00078 }
00079
00080 bool operator >= ( const Color& crOther )
00081 {
00082 return r >= crOther.r && g >= crOther.g && b >= crOther.b && a >= crOther.a;
00083 }
00084
00085 bool operator < ( const Color& crOther )
00086 {
00087 return r < crOther.r && g < crOther.g && b < crOther.b && a < crOther.a;
00088 }
00089
00090 bool operator > ( const Color& crOther )
00091 {
00092 return r > crOther.r && g > crOther.g && b > crOther.b && a > crOther.a;
00093 }
00094
00095 bool operator != ( const Color& crOther )
00096 {
00097 return r != crOther.r || g != crOther.g || b != crOther.b || a != crOther.a;
00098 }
00099
00100 public:
00101
00102 float32 r, g, b, a;
00103 };
00104 };
00105 };
00106
00107 #endif