#include <bitmap.h>
Public Member Functions | |
Bitmap (u16 width, u16 height) | |
virtual | ~Bitmap () |
const u16 | getPixel (s16 x, s16 y) const |
const u16 * | getBitmap () const |
const u16 | getWidth () const |
const u16 | getHeight () const |
virtual void | drawPixel (s16 x, s16 y, u16 colour) |
virtual void | drawFilledRect (s16 x, s16 y, u16 width, u16 height, u16 colour) |
virtual void | drawHorizLine (s16 x, s16 y, u16 width, u16 colour) |
virtual void | drawVertLine (s16 x, s16 y, u16 height, u16 colour) |
virtual void | drawRect (s16 x, s16 y, u16 width, u16 height, u16 colour) |
virtual void | drawLine (s16 x1, s16 y1, s16 x2, s16 y2, u16 colour) |
virtual void | drawCircle (s16 x0, s16 y0, u16 radius, u16 colour) |
virtual void | drawFilledCircle (s16 x0, s16 y0, u16 radius, u16 colour) |
virtual void | drawText (s16 x, s16 y, FontBase *font, const char *string) |
virtual void | drawText (s16 x, s16 y, FontBase *font, const char *string, u16 colour) |
virtual void | drawBitmap (s16 x, s16 y, u16 width, u16 height, const u16 *bitmap, s16 bitmapX, s16 bitmapY, u16 bitmapWidth, u16 bitmapHeight) |
virtual void | floodFill (s16 x, s16 y, u16 newColour) |
virtual void | drawEllipse (s16 xCentre, s16 yCentre, s16 horizRadius, s16 vertRadius, u16 colour) |
virtual void | drawFilledEllipse (s16 xCentre, s16 yCentre, s16 horizRadius, s16 vertRadius, u16 colour) |
Protected Member Functions | |
u16 *_bitmap | __attribute__ ((aligned(4))) |
bool | popStack (s16 *x, s16 *y, WoopsiArray< s32 > *stack) |
void | pushStack (s16 x, s16 y, WoopsiArray< s32 > *stack) |
bool | clipBitmapCoordinates (s16 *x, s16 *y, u16 *width, u16 *height) |
Bitmap (const Bitmap &bitmap) | |
Protected Attributes | |
u16 | _width |
u16 | _height |
Class providing bitmap manipulation (drawing, etc) functions.
Bitmap::Bitmap | ( | u16 | width, | |
u16 | height | |||
) |
Constructor.
width | The width of the bitmap. | |
height | The height of the bitmap. |
virtual WoopsiUI::Bitmap::~Bitmap | ( | ) | [inline, virtual] |
Destructor.
WoopsiUI::Bitmap::Bitmap | ( | const Bitmap & | bitmap | ) | [inline, protected] |
Copy constructor is protected to prevent usage.
u16* _bitmap WoopsiUI::Bitmap::__attribute__ | ( | (aligned(4)) | ) | [protected] |
bool Bitmap::clipBitmapCoordinates | ( | s16 * | x, | |
s16 * | y, | |||
u16 * | width, | |||
u16 * | height | |||
) | [protected] |
Clip the supplied rectangular dimensions to the size of the internal bitmap.
x | The x co-ordinate of the rectangle to clip (modified by the function). | |
y | The y co-ordinate of the rectangle to clip (modified by the function). | |
width | The width of the rectangle to clip (modified by the function). | |
height | The height of the rectangle to clip (modified by the function). |
void Bitmap::drawBitmap | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
const u16 * | bitmap, | |||
s16 | bitmapX, | |||
s16 | bitmapY, | |||
u16 | bitmapWidth, | |||
u16 | bitmapHeight | |||
) | [virtual] |
Draw an external bitmap to the internal bitmap.
x | The x co-ordinate to draw the bitmap to. | |
y | The y co-ordinate to draw the bitmap to. | |
width | The width of the bitmap to draw. | |
height | The height of the bitmap to draw. | |
bitmap | Pointer to the bitmap to draw. | |
bitmapX | The x co-ordinate within the supplied bitmap to use as the origin. | |
bitmapY | The y co-ordinate within the supplied bitmap to use as the origin. | |
bitmapWidth | The width of the supplied bitmap. | |
bitmapHeight | The height of the supplied bitmap. |
void Bitmap::drawCircle | ( | s16 | x0, | |
s16 | y0, | |||
u16 | radius, | |||
u16 | colour | |||
) | [virtual] |
Draw an unfilled circle to the internal bitmap.
x0 | The x co-ordinate of the circle. | |
y0 | The y co-ordinate of the circle. | |
radius | The radius of the circle. | |
colour | The colour of the circle. |
void Bitmap::drawEllipse | ( | s16 | xCentre, | |
s16 | yCentre, | |||
s16 | horizRadius, | |||
s16 | vertRadius, | |||
u16 | colour | |||
) | [virtual] |
Draw an unfilled ellipse to the bitmap.
xCentre | The x co-ordinate of the ellipse's centre. | |
yCentre | The y co-ordinate of the ellipse's centre. | |
horizRadius | The size of the ellipse's horizontal radius. | |
vertRadius | The size of the ellipse's vertical radius. | |
colour | The colour of the ellipse. |
void Bitmap::drawFilledCircle | ( | s16 | x0, | |
s16 | y0, | |||
u16 | radius, | |||
u16 | colour | |||
) | [virtual] |
Draw a filled circle to the internal bitmap.
x0 | The x co-ordinate of the circle. | |
y0 | The y co-ordinate of the circle. | |
radius | The radius of the circle. | |
colour | The colour of the circle. |
void Bitmap::drawFilledEllipse | ( | s16 | xCentre, | |
s16 | yCentre, | |||
s16 | horizRadius, | |||
s16 | vertRadius, | |||
u16 | colour | |||
) | [virtual] |
Draw a filled ellipse to the bitmap.
xCentre | The x co-ordinate of the ellipse's centre. | |
yCentre | The y co-ordinate of the ellipse's centre. | |
horizRadius | The size of the ellipse's horizontal radius. | |
vertRadius | The size of the ellipse's vertical radius. | |
colour | The colour of the ellipse. |
void Bitmap::drawFilledRect | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
u16 | colour | |||
) | [virtual] |
Draw a filled rectangle to the internal bitmap.
x | The x co-ordinate of the rectangle. | |
y | The y co-ordinate of the rectangle. | |
width | The width of the rectangle. | |
height | The height of the rectangle. | |
colour | The colour of the rectangle. |
void Bitmap::drawHorizLine | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | colour | |||
) | [virtual] |
Draw a horizontal line to the internal bitmap.
x | The x co-ordinate of the line. | |
y | The y co-ordinate of the line. | |
width | The width of the line. | |
colour | The colour of the line. |
void Bitmap::drawLine | ( | s16 | x1, | |
s16 | y1, | |||
s16 | x2, | |||
s16 | y2, | |||
u16 | colour | |||
) | [virtual] |
Draw a line to the internal bitmap.
x1 | The x co-ordinate of the start point of the line. | |
y1 | The y co-ordinate of the start point of the line. | |
x2 | The x co-ordinate of the end point of the line. | |
y2 | The y co-ordinate of the end point of the line. | |
colour | The colour of the line. |
void Bitmap::drawPixel | ( | s16 | x, | |
s16 | y, | |||
u16 | colour | |||
) | [virtual] |
Draw a pixel to the internal bitmap.
x | The x co-ordinate of the pixel. | |
y | The y co-ordinate of the pixel. | |
colour | The colour of the pixel. |
void Bitmap::drawRect | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
u16 | colour | |||
) | [virtual] |
Draw an unfilled rectangle to the internal bitmap.
x | The x co-ordinate of the rectangle. | |
y | The y co-ordinate of the rectangle. | |
width | The width of the rectangle. | |
height | The height of the rectangle. | |
colour | The colour of the rectangle. |
void Bitmap::drawText | ( | s16 | x, | |
s16 | y, | |||
FontBase * | font, | |||
const char * | string, | |||
u16 | colour | |||
) | [virtual] |
Draw a string to the internal bitmap in a specific colour.
x | The x co-ordinate of the string. | |
y | The y co-ordinate of the string. | |
font | The font to draw with. | |
string | The string to output. | |
colour | The colour of the string. |
void Bitmap::drawText | ( | s16 | x, | |
s16 | y, | |||
FontBase * | font, | |||
const char * | string | |||
) | [virtual] |
Draw a string to the internal bitmap.
x | The x co-ordinate of the string. | |
y | The y co-ordinate of the string. | |
font | The font to draw with. | |
string | The string to output. |
void Bitmap::drawVertLine | ( | s16 | x, | |
s16 | y, | |||
u16 | height, | |||
u16 | colour | |||
) | [virtual] |
Draw a vertical line to the internal bitmap.
x | The x co-ordinate of the line. | |
y | The y co-ordinate of the line. | |
height | The height of the line. | |
colour | The colour of the line. |
void Bitmap::floodFill | ( | s16 | x, | |
s16 | y, | |||
u16 | newColour | |||
) | [virtual] |
Fill a region of the internal bitmap with the specified colour.
x | The x co-ordinate to use as the starting point of the fill. | |
y | The y co-ordinate to use as the starting point of the fill. | |
newColour | The colour to fill with. |
const u16* WoopsiUI::Bitmap::getBitmap | ( | ) | const [inline] |
Get a pointer to the internal bitmap.
const u16 WoopsiUI::Bitmap::getHeight | ( | ) | const [inline] |
Get the bitmap's height.
const u16 Bitmap::getPixel | ( | s16 | x, | |
s16 | y | |||
) | const |
Get the colour of the pixel at the specified co-ordinates
x | The x co-ordinate of the pixel. | |
y | The y co-ordinate of the pixel. |
const u16 WoopsiUI::Bitmap::getWidth | ( | ) | const [inline] |
Get the bitmap's width.
bool Bitmap::popStack | ( | s16 * | x, | |
s16 * | y, | |||
WoopsiArray< s32 > * | stack | |||
) | [protected] |
Remove the last item from the flood fill stack and insert its properties into the supplied x and y variables.
x | The x co-ordinate of the pixel from the stack (output by the function). | |
y | The y co-ordinate of the pixel from the stack (output by the function). | |
stack | Pointer to the stack to pop from. |
void Bitmap::pushStack | ( | s16 | x, | |
s16 | y, | |||
WoopsiArray< s32 > * | stack | |||
) | [protected] |
Push new co-ordinates onto the stack.
x | The x co-ordinate of the pixel to add to the stack. | |
y | The y co-ordinate of the pixel to add to the stack. | |
stack | The stack to add a new value to. |
u16 WoopsiUI::Bitmap::_height [protected] |
Height of the bitmap
u16 WoopsiUI::Bitmap::_width [protected] |
Width of the bitmap