Woopsi 1.0
GUI Framework for Nintendo DS Homebrew
|
#include <gradient.h>
Public Member Functions | |
Gradient (s16 x, s16 y, u16 width, u16 height, u16 fromColour, u16 toColour) | |
Protected Member Functions | |
virtual void | drawContents (GraphicsPort *port) |
virtual void | onResize (u16 width, u16 height) |
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.
WoopsiUI::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.
virtual void WoopsiUI::Gradient::cacheRowColours | ( | ) | [protected, virtual] |
Precalculate the gradient colours to save processing time when drawing.
virtual void WoopsiUI::Gradient::calculate | ( | ) | [protected, virtual] |
Precalculates the properties of the gradient to save processing time later.
virtual void WoopsiUI::Gradient::drawContents | ( | GraphicsPort * | port | ) | [protected, virtual] |
Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.
port | The GraphicsPort to draw to. |
Reimplemented from WoopsiUI::Gadget.
virtual void WoopsiUI::Gradient::onResize | ( | u16 | width, |
u16 | height | ||
) | [protected, 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