Crazy Eddie's GUI System  0.8.7
CEGUI::ColourRect Class Reference

Class that holds details of colours for the four corners of a rectangle. More...

+ Inheritance diagram for CEGUI::ColourRect:
+ Collaboration diagram for CEGUI::ColourRect:

Public Member Functions

 ColourRect (void)
 Default constructor.
 
 ColourRect (const Colour &col)
 Constructor for ColourRect objects (via single colour). Also handles default construction.
 
 ColourRect (const Colour &top_left, const Colour &top_right, const Colour &bottom_left, const Colour &bottom_right)
 Constructor for ColourRect objects.
 
void setAlpha (float alpha)
 Set the alpha value to use for all four corners of the ColourRect. More...
 
void setTopAlpha (float alpha)
 Set the alpha value to use for the top edge of the ColourRect. More...
 
void setBottomAlpha (float alpha)
 Set the alpha value to use for the bottom edge of the ColourRect. More...
 
void setLeftAlpha (float alpha)
 Set the alpha value to use for the left edge of the ColourRect. More...
 
void setRightAlpha (float alpha)
 Set the alpha value to use for the right edge of the ColourRect. More...
 
bool isMonochromatic () const
 Determinate the ColourRect is monochromatic or variegated. More...
 
ColourRect getSubRectangle (float left, float right, float top, float bottom) const
 Gets a portion of this ColourRect as a subset ColourRect. More...
 
Colour getColourAtPoint (float x, float y) const
 Get the colour at a point in the rectangle. More...
 
void setColours (const Colour &col)
 Set the colour of all four corners simultaneously. More...
 
void modulateAlpha (float alpha)
 Module the alpha components of each corner's colour by a constant. More...
 
ColourRectoperator*= (const ColourRect &other)
 Modulate all components of this colour rect with corresponding components from another colour rect.
 
ColourRect operator* (const float val) const
 
ColourRect operator+ (const ColourRect &val) const
 

Public Attributes

Colour d_top_left
 
Colour d_top_right
 
Colour d_bottom_left
 
Colour d_bottom_right
 ColourRect component colours.
 

Detailed Description

Class that holds details of colours for the four corners of a rectangle.

Member Function Documentation

Colour CEGUI::ColourRect::getColourAtPoint ( float  x,
float  y 
) const

Get the colour at a point in the rectangle.

Parameters
xThe x coordinate of the point
yThe y coordinate of the point
Returns
The colour at the specified point.
ColourRect CEGUI::ColourRect::getSubRectangle ( float  left,
float  right,
float  top,
float  bottom 
) const

Gets a portion of this ColourRect as a subset ColourRect.

Parameters
leftThe left side of this subrectangle (in the range of 0-1 float)
rightThe right side of this subrectangle (in the range of 0-1 float)
topThe top side of this subrectangle (in the range of 0-1 float)
bottomThe bottom side of this subrectangle (in the range of 0-1 float)
Returns
A ColourRect from the specified range
bool CEGUI::ColourRect::isMonochromatic ( ) const

Determinate the ColourRect is monochromatic or variegated.

Returns
True if all four corners of the ColourRect has same colour, false otherwise.
void CEGUI::ColourRect::modulateAlpha ( float  alpha)

Module the alpha components of each corner's colour by a constant.

Parameters
alphaThe constant factor to modulate all alpha colour components by.
void CEGUI::ColourRect::setAlpha ( float  alpha)

Set the alpha value to use for all four corners of the ColourRect.

Parameters
alphaAlpha value to use.
Returns
Nothing.
void CEGUI::ColourRect::setBottomAlpha ( float  alpha)

Set the alpha value to use for the bottom edge of the ColourRect.

Parameters
alphaAlpha value to use.
Returns
Nothing.
void CEGUI::ColourRect::setColours ( const Colour col)

Set the colour of all four corners simultaneously.

Parameters
colcolour that is to be set for all four corners of the ColourRect;
void CEGUI::ColourRect::setLeftAlpha ( float  alpha)

Set the alpha value to use for the left edge of the ColourRect.

Parameters
alphaAlpha value to use.
Returns
Nothing.
void CEGUI::ColourRect::setRightAlpha ( float  alpha)

Set the alpha value to use for the right edge of the ColourRect.

Parameters
alphaAlpha value to use.
Returns
Nothing.
void CEGUI::ColourRect::setTopAlpha ( float  alpha)

Set the alpha value to use for the top edge of the ColourRect.

Parameters
alphaAlpha value to use.
Returns
Nothing.