CrossFramework Library

XBase/Color4.hpp

説明を見る。
00001 
00006 #if defined(XBASE_INCLUDED_COLOR4_HPP)
00007 #else
00008 #define XBASE_INCLUDED_COLOR4_HPP
00009 
00010 //------------------------------------------------------------
00011 #include <XBase/BuiltInTypes.hpp>
00012 #include <XBase/ShortString.hpp>
00013 
00014 //------------------------------------------------------------
00015 namespace XBase {
00016     struct Color3POD;
00017     struct Vector4POD;
00018 }
00019 
00020 //------------------------------------------------------------
00021 namespace XBase {
00023 
00024 
00025     struct Color4POD
00026     {
00027         //============================================================
00029 
00030         static const Color4POD Zero();     
00031         static const Color4POD One();      
00032         static const Color4POD UnitR();    
00033         static const Color4POD UnitG();    
00034         static const Color4POD UnitB();    
00035         static const Color4POD UnitA();    
00036 
00037 
00038         //============================================================
00040 
00041         f32 r; 
00042         f32 g; 
00043         f32 b; 
00044         f32 a; 
00045 
00046         
00047         //============================================================
00049 
00050         const Color3POD toRGB()const;
00051         const Color3POD toRRR()const;
00052         const Color3POD toGGG()const;
00053         const Color3POD toBBB()const;
00054         const Color3POD toAAA()const;
00055         const Color4POD toRRRR()const;
00056         const Color4POD toGGGG()const;
00057         const Color4POD toBBBB()const;
00058         const Color4POD toAAAA()const;
00059         const Vector4POD toVector4()const;
00061 
00062         //============================================================
00064 
00065         bool equals( const Color4POD& )const;       
00066         bool equalsStrict( const Color4POD& )const; 
00067 
00068 
00069         //============================================================
00071 
00072         const Color4POD add( f32 )const; 
00073         const Color4POD sub( f32 )const; 
00074         const Color4POD mul( f32 )const; 
00075         const Color4POD div( f32 )const; 
00076         const Color4POD add( const Color4POD& )const; 
00077         const Color4POD sub( const Color4POD& )const; 
00078         const Color4POD mul( const Color4POD& )const; 
00079         const Color4POD div( const Color4POD& )const; 
00080         const Color4POD neg()const; 
00081         void addAssign( f32 ); 
00082         void subAssign( f32 ); 
00083         void mulAssign( f32 ); 
00084         void divAssign( f32 ); 
00085         void addAssign( const Color4POD& ); 
00086         void subAssign( const Color4POD& ); 
00087         void mulAssign( const Color4POD& ); 
00088         void divAssign( const Color4POD& ); 
00089 
00090         
00091         //============================================================
00093 
00094         const Color4POD operator+( f32 )const; 
00095         const Color4POD operator-( f32 )const; 
00096         const Color4POD operator*( f32 )const; 
00097         const Color4POD operator/( f32 )const; 
00098         const Color4POD operator+( const Color4POD& )const; 
00099         const Color4POD operator-( const Color4POD& )const; 
00100         const Color4POD operator*( const Color4POD& )const; 
00101         const Color4POD operator/( const Color4POD& )const; 
00102         const Color4POD operator-()const; 
00103         Color4POD& operator+=( f32 ); 
00104         Color4POD& operator-=( f32 ); 
00105         Color4POD& operator*=( f32 ); 
00106         Color4POD& operator/=( f32 ); 
00107         Color4POD& operator+=( const Color4POD& ); 
00108         Color4POD& operator-=( const Color4POD& ); 
00109         Color4POD& operator*=( const Color4POD& ); 
00110         Color4POD& operator/=( const Color4POD& ); 
00111 
00112 
00113         //============================================================
00115 
00116 
00117         const ShortString toShortString()const;
00119     };
00120 
00122     class Color4 : public Color4POD
00123     {
00124     public:
00125         //============================================================
00127 
00128         Color4(); 
00129         Color4( const Color4POD& aRGBA ); 
00130         Color4( f32 aR , f32 aG , f32 aB , f32 aA ); 
00131 
00132     };
00134 }
00135 //------------------------------------------------------------
00136 #endif
00137 // EOF
 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義