Woopsi 1.0 GUI Framework for Nintendo DS Homebrew

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

# WoopsiUI::Bitmap Class Reference

`#include <bitmap.h>`

Inheritance diagram for WoopsiUI::Bitmap:

List of all members.

## Public Member Functions
| Bitmap (u16 width, u16 height)
virtual | ~Bitmap ()
const u16 | getPixel (s16 x, s16 y) const
void | setPixel (const s16 x, const s16 y, const u16 colour)
const u16 * | getData () const
const u16 * | getData (s16 x, s16 y) const
Graphics * | newGraphics ()
void | blit (const s16 x, const s16 y, const u16 *data, const u32 size)
void | blitFill (const s16 x, const s16 y, const u16 colour, const u32 size)
void | copy (s16 x, s16 y, u32 size, u16 *dest) const
## Protected Member Functions
u16 *_bitmap | __attribute__ ((aligned(4)))
| Bitmap (const Bitmap &bitmap)

## Detailed Description

Class providing bitmap manipulation (drawing, etc) functions. Creates a new internal bitmap data array and uses it to draw onto.

## Constructor & Destructor Documentation

WoopsiUI::Bitmap::Bitmap | ( | u16 | width,
|  | u16 | height
| ) |  |

Constructor.

Parameters:

  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.

## Member Function Documentation

u16* _bitmap WoopsiUI::Bitmap::__attribute__ | ( | (aligned(4)) |  | ) | `[protected]`

Bitmap

void WoopsiUI::Bitmap::blit | ( | const s16 | x,
|  | const s16 | y,
|  | const u16 * | data,
|  | const u32 | size
| ) |  | `[virtual]`

Blit data to the specified co-ordinates using the DMA hardware.

Parameters:

  x | The x co-ordinate to blit to.
  y | The y co-ordinate to blit to.
  data | The data to blit.
  size | The number of u16s to blit.

Implements WoopsiUI::MutableBitmapBase.

void WoopsiUI::Bitmap::blitFill | ( | const s16 | x,
|  | const s16 | y,
|  | const u16 | colour,
|  | const u32 | size
| ) |  | `[virtual]`

Fill at the specified co-ordinates using the DMA hardware.

Parameters:

  x | The x co-ordinate to blit to.
  y | The y co-ordinate to blit to.
  colour | The colour to fill with.
  size | The number of u16s to blit.

Implements WoopsiUI::MutableBitmapBase.

void WoopsiUI::Bitmap::copy | ( | s16 | x,
|  | s16 | y,
|  | u32 | size,
|  | u16 * | dest
| ) |  | const`[virtual]`

Copies data from the supplied co-ordinates sequentially into dest. If the amount to be copied exceeds the available width of the bitmap, copying will wrap around from the right-hand edge of the bitmap to the left-hand edge. The dest parameter must point to an area of memory large enough to contain the copied data.

Parameters:

  x | The x co-ordinate to copy from.
  y | The y co-ordinate to copy from.
  size | The number of pixels to copy.
  dest | Pointer to the memory that will be copied into.

Implements WoopsiUI::BitmapBase.

const u16* WoopsiUI::Bitmap::getData | ( | s16 | x,
|  | s16 | y
| ) |  | const`[virtual]`

Get a pointer to the internal bitmap data at the specified co-ordinates.

Parameters:

  x | The x co-ord of the data.
  y | The y co-ord of the data.

Returns:
  Pointer to the internal bitmap data.

Implements WoopsiUI::BitmapBase.

const u16* WoopsiUI::Bitmap::getData | ( |  | ) | const`[inline, virtual]`

Get a pointer to the internal bitmap.

Returns:
  Pointer to the internal bitmap.

Implements WoopsiUI::BitmapBase.

const u16 WoopsiUI::Bitmap::getPixel | ( | s16 | x,
|  | s16 | y
| ) |  | const`[virtual]`

Get the colour of the pixel at the specified co-ordinates

Parameters:

  x | The x co-ordinate of the pixel.
  y | The y co-ordinate of the pixel.

Returns:
  The colour of the pixel.

Implements WoopsiUI::BitmapBase.

Graphics* WoopsiUI::Bitmap::newGraphics | ( |  | ) |

Get a new graphics object that can draw to this bitmap. Object must be deleted when it is no longer needed.

Returns:
  A new Graphics object.

void WoopsiUI::Bitmap::setPixel | ( | const s16 | x,
|  | const s16 | y,
|  | const u16 | colour
| ) |  | `[virtual]`

Set the colour of the specified pixel.

Parameters:

  x | X co-ord of the pixel to set.
  y | Y co-ord of the pixel to set.
  colour | New colour of the pixel.

Implements WoopsiUI::MutableBitmapBase.

The documentation for this class was generated from the following file:

- bitmap.h