#include <gradient.h>
Public Member Functions | |
Gradient (s16 x, s16 y, u16 width, u16 height, u16 fromColour, u16 toColour) | |
virtual void | draw (Rect clipRect) |
virtual bool | resize (u16 width, u16 height) |
Protected Member Functions | |
virtual void | calculate () |
virtual void | cacheRowColours () |
virtual | ~Gradient () |
Gradient (const Gradient &gradient) | |
Protected Attributes | |
u16 | _fromColour |
u16 | _toColour |
s16 | _numberR |
s16 | _numberG |
s16 | _numberB |
s16 | _deltaR |
s16 | _deltaG |
s16 | _deltaB |
s16 * | _rowColour |
Class providing a vertical gradient-filled background.
Gradient::Gradient | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
u16 | fromColour, | |||
u16 | toColour | |||
) |
Constructor.
x | The x co-ordinate of the gadget. | |
y | The y co-ordinate of the gadget. | |
width | The width of the gadget. | |
height | The height of the gadget. | |
fromColour | The start colour for the gradient (top colour). | |
toColour | The end colour for the gradient (bottom colour). |
virtual WoopsiUI::Gradient::~Gradient | ( | ) | [inline, protected, virtual] |
Destructor.
WoopsiUI::Gradient::Gradient | ( | const Gradient & | gradient | ) | [inline, protected] |
Copy constructor is protected to prevent usage.
void Gradient::cacheRowColours | ( | ) | [protected, virtual] |
Precalculate the gradient colours to save processing time when drawing.
void Gradient::calculate | ( | ) | [protected, virtual] |
Precalculates the properties of the gradient to save processing time later.
void Gradient::draw | ( | Rect | clipRect | ) | [virtual] |
Draw the region of the gadget that falls within the clipping rectangle. Should not be called.
clipRect | The clipping region to draw within. |
Reimplemented from WoopsiUI::Gadget.
bool Gradient::resize | ( | u16 | width, | |
u16 | height | |||
) | [virtual] |
Resize the gadget and recalculate the gradient.
width | The new gadget width. | |
height | The new gadget height. |
Reimplemented from WoopsiUI::Gadget.
s16 WoopsiUI::Gradient::_deltaB [protected] |
Value that blue component is incremented at each new gradient step
s16 WoopsiUI::Gradient::_deltaG [protected] |
Value that green component is incremented at each new gradient step
s16 WoopsiUI::Gradient::_deltaR [protected] |
Value that red component is incremented at each new gradient step
u16 WoopsiUI::Gradient::_fromColour [protected] |
Initial gradient colour
s16 WoopsiUI::Gradient::_numberB [protected] |
Number of steps to get from start to finish colour in blue component
s16 WoopsiUI::Gradient::_numberG [protected] |
Number of steps to get from start to finish colour in green component
s16 WoopsiUI::Gradient::_numberR [protected] |
Number of steps to get from start to finish colour in red component
s16* WoopsiUI::Gradient::_rowColour [protected] |
Array of precalculated gradient colours for each step
u16 WoopsiUI::Gradient::_toColour [protected] |
Final gradient colour