v1.1.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
Sifteo::StampDrawable Struct Reference

A VRAM accessor for the STAMP mode, a special purpose 16-color framebuffer mode which supports color-keying and tiling. More...

#include <sifteo/video/framebuffer.h>

Public Member Functions

CubeID cube () const
 Return the CubeID associated with this drawable.
 
void disableKey ()
 Disable transparency. More...
 
template<unsigned tWidth, unsigned tHeight>
FBDrawable< tWidth, tHeight, 4 > & getFB ()
 Obtain an FBDrawable accessor for the framebuffer memory, using the supplied framebuffer dimensions. More...
 
template<unsigned tWidth, unsigned tHeight>
FBDrawable< tWidth, tHeight, 4 > & initFB ()
 Obtain an FBDrawable accessor for the framebuffer memory, using the supplied framebuffer dimensions. More...
 
void resizeFB (Int2 pixelSize)
 Change the geometry of the framebuffer memory used by this stamp. More...
 
void setBox (Int2 topLeft, Int2 size)
 Set both the horizontal and vertical windows, to define a 2D box of pixels that we'll draw into. More...
 
void setHWindow (uint8_t firstColumn, uint8_t numColumns)
 Set the horizontal window. This is the mode-specific X-axis counterpart to VideoBuffer::setWindow(). More...
 
void setKeyIndex (unsigned index)
 Set the palette index of the "key" color. More...
 
_SYSVideoBuffer & videoBuffer ()
 Return the VideoBuffer associated with this drawable.
 

Detailed Description

A VRAM accessor for the STAMP mode, a special purpose 16-color framebuffer mode which supports color-keying and tiling.

It is so named because it can be used like a rubber stamp, to draw patterns or images over top of whatever already exists on the display.

Member Function Documentation

void Sifteo::StampDrawable::disableKey ( )
inline

Disable transparency.

This is equivalent to setting the key index to a color which is never used.

template<unsigned tWidth, unsigned tHeight>
FBDrawable<tWidth, tHeight, 4>& Sifteo::StampDrawable::getFB ( )
inline

Obtain an FBDrawable accessor for the framebuffer memory, using the supplied framebuffer dimensions.

Does not automatically resize the framebuffer to those dimensions; this is for cases when you know the framebuffer is already set up. If you don't know this for sure, or you're accessing the framebuffer for the first time without an explicit call to resize(), use initFB() instead.

template<unsigned tWidth, unsigned tHeight>
FBDrawable<tWidth, tHeight, 4>& Sifteo::StampDrawable::initFB ( )
inline

Obtain an FBDrawable accessor for the framebuffer memory, using the supplied framebuffer dimensions.

Automatically resizes the framebuffer to the specified dimensions, if necessary. Just like VideoBuffer::initMode() we automatically issue a System::finish() before resizing the framebuffer.

void Sifteo::StampDrawable::resizeFB ( Int2  pixelSize)
inline

Change the geometry of the framebuffer memory used by this stamp.

The framebuffer can be any size, so long as the width is an even number of pixels (corresponding to an integer number of bytes), the total number of pixels <= 1536, and each dimension is <= 128.

void Sifteo::StampDrawable::setBox ( Int2  topLeft,
Int2  size 
)
inline

Set both the horizontal and vertical windows, to define a 2D box of pixels that we'll draw into.

If either dimension of this box is larger than our framebuffer, the framebuffer will be tiled.

void Sifteo::StampDrawable::setHWindow ( uint8_t  firstColumn,
uint8_t  numColumns 
)
inline

Set the horizontal window. This is the mode-specific X-axis counterpart to VideoBuffer::setWindow().

We start drawing at 'firstColumn', and draw a total of 'numColumns' pixels per line. If numColumns is greater than the framebuffer width, the framebuffer repeats horizontally.

void Sifteo::StampDrawable::setKeyIndex ( unsigned  index)
inline

Set the palette index of the "key" color.

Any pixel with this palette index is skipped, leaving a transparent "hole" at that pixel.


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