Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
bmptk::graphics::frame Class Referenceabstract

a rectangular block of writable pixels More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::frame:
bmptk::chips::pcd8544< arg_sce, arg_res, arg_dc, arg_sdin, arg_sclk, x_size, y_size > bmptk::graphics::frame_buffer bmptk::graphics::frame_dummy bmptk::graphics::frame_filter bmptk::graphics::frame_snapshot bmptk::graphics::frame_tee bmptk::graphics::subframe bmptk::chips::pcd8544< sce, res, dc, sdin, sclk, 84, 48 >

Public Member Functions

 frame (const vector size)
 create a frame of specified size
 
vector size_get () const
 get the size of the frame
 
virtual vector translate_outfrom (const vector p) const
 translate a subframe coordinate to a master frame coordinate
 
virtual vector translate_into (const vector p) const
 translate a master frame coordinate to a subframe coordinate
 
bool is_valid (vector p)
 whether p is within the frame
 
color bg_get ()
 get the backround color
 
void write (const vector p, const color c)
 write one pixel, address specified by vector
 
virtual void clear (const color c=color::white())
 fill the full frame with the indicated color
 
virtual void flush ()
 for buffered frames: write the changes to the underlying frame
 

Protected Member Functions

virtual void checked_write (const vector p, const color c)=0
 write one pixel
 

Protected Attributes

const vector size
 frame size
 
color bg
 most recently applied background color (as used in clear())
 

Detailed Description

a rectangular block of writable pixels

A frame is an abstract class, representing a rectangle block of pixels. Pixels are addressed by vectors. By convention, (0,0) is the upper left pixel (origin). Each pixel has a color, which can be written.

The pixel operation checked_write is pure virtual. This operations must be implemented by a concrete frame.

Definition at line 704 of file graphics.h.

Member Function Documentation

color bmptk::graphics::frame::bg_get ( )
inline

get the backround color

This method retruns the argument used in the most recentlt clear method call.

Definition at line 752 of file graphics.h.

virtual void bmptk::graphics::frame::checked_write ( const vector  p,
const color  c 
)
protectedpure virtual
virtual void bmptk::graphics::frame::clear ( const color  c = color::white())
virtual
virtual void bmptk::graphics::frame::flush ( )
inlinevirtual

for buffered frames: write the changes to the underlying frame

For buffered frames this method must be called to write the canges 'through' to the underlying frame. Most frames are not buffered, for such frames an empty default is provided.

Reimplemented in bmptk::graphics::frame_filter, bmptk::graphics::frame_tee, bmptk::graphics::frame_snapshot, and bmptk::graphics::frame_buffer.

Definition at line 772 of file graphics.h.

void bmptk::graphics::frame::write ( const vector  p,
const color  c 
)
inline

write one pixel, address specified by vector

This function checks wether the p is valid (writing to a pixel outside the frame is ignored).

Definition at line 758 of file graphics.h.


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