00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _CEGUIColourRect_h_
00032 #define _CEGUIColourRect_h_
00033
00034 #include "CEGUIBase.h"
00035 #include "CEGUIcolour.h"
00036
00037
00038 namespace CEGUI
00039 {
00044 class CEGUIEXPORT ColourRect
00045 {
00046 public:
00051 ColourRect(void);
00052
00053
00058 ColourRect(const colour& col);
00059
00060
00065 ColourRect(const colour& top_left, const colour& top_right, const colour& bottom_left, const colour& bottom_right);
00066
00067
00078 void setAlpha(float alpha);
00079
00080
00091 void setTopAlpha(float alpha);
00092
00093
00104 void setBottomAlpha(float alpha);
00105
00106
00117 void setLeftAlpha(float alpha);
00118
00119
00130 void setRightAlpha(float alpha);
00131
00132
00140 bool isMonochromatic() const;
00141
00142
00159 ColourRect getSubRectangle( float left, float right, float top, float bottom ) const;
00160
00173 colour getColourAtPoint( float x, float y ) const;
00174
00175
00183 void setColours(const colour& col);
00184
00185
00193 void modulateAlpha(float alpha);
00194
00199 ColourRect& operator*=(const ColourRect& other);
00200
00201 inline ColourRect operator*(const float val) const
00202 {
00203 return ColourRect(
00204 d_top_left * val,
00205 d_top_right * val,
00206 d_bottom_left * val,
00207 d_bottom_right * val
00208 );
00209 }
00210
00211 inline ColourRect operator+(const ColourRect& val) const
00212 {
00213 return ColourRect(
00214 d_top_left + val.d_top_left,
00215 d_top_right + val.d_top_right,
00216 d_bottom_left + val.d_bottom_left,
00217 d_bottom_right + val.d_bottom_right
00218 );
00219 }
00220
00221
00222 colour d_top_left, d_top_right, d_bottom_left, d_bottom_right;
00223 };
00224
00225 }
00226
00227
00228 #endif // end of guard _CEGUIColourRect_h_