WoopsiUI::FrameBuffer Class Reference

#include <framebuffer.h>

Inheritance diagram for WoopsiUI::FrameBuffer:
WoopsiUI::MutableBitmapBase WoopsiUI::BitmapBase

List of all members.

Public Member Functions

 FrameBuffer (u16 *data, u16 width, u16 height)
const u16 * getData () const
virtual ~FrameBuffer ()
const u16 getPixel (s16 x, s16 y) const
virtual void setPixel (const s16 x, const s16 y, const u16 colour)
const u16 * getData (s16 x, s16 y) const
GraphicsnewGraphics ()
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)

Protected Member Functions

u16 *_bitmap __attribute__ ((aligned(4)))
 FrameBuffer (const FrameBuffer &bitmap)

Detailed Description

Bitmap subclass designed exclusively as a way to wrap the framebuffer in a bitmap object. It can then be treated as any other bitmap - it can be drawn to with setPixel(), blit() and blitFill() methods, and it can produce a Graphics object for more complex drawing functions.

The FrameBuffer class automatically switches from using the DS' framebuffer (more accurately, a 16-bit background) to using an SDL surface if Woopsi is compiled in SDL mode.


Constructor & Destructor Documentation

WoopsiUI::FrameBuffer::FrameBuffer ( u16 *  data,
u16  width,
u16  height 
)

Constructor.

Parameters:
data Pointer to the raw bitmap data.
width The width of the bitmap.
height The height of the bitmap.
virtual WoopsiUI::FrameBuffer::~FrameBuffer (  )  [inline, virtual]

Destructor.

WoopsiUI::FrameBuffer::FrameBuffer ( const FrameBuffer bitmap  )  [inline, protected]

Copy constructor is protected to prevent usage.


Member Function Documentation

u16* _bitmap WoopsiUI::FrameBuffer::__attribute__ ( (aligned(4))   )  [protected]
void WoopsiUI::FrameBuffer::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::FrameBuffer::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.

const u16* WoopsiUI::FrameBuffer::getData ( s16  x,
s16  y 
) const [inline, 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::FrameBuffer::getData (  )  const [inline, virtual]

Get a pointer to the internal bitmap.

Returns:
Pointer to the internal bitmap.

Implements WoopsiUI::BitmapBase.

const u16 WoopsiUI::FrameBuffer::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::FrameBuffer::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.
virtual void WoopsiUI::FrameBuffer::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:
Generated by  doxygen 1.6.3