Bare Metal Programming Tool Kit
|
a rectangular block of writable pixels More...
#include <graphics.h>
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()) | |
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.
|
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.
|
protectedpure virtual |
write one pixel
A concrete frame class must implement this function. It can safely assume that the address is within the frame.
Implemented in bmptk::graphics::subframe, bmptk::graphics::frame_filter, bmptk::graphics::frame_tee, bmptk::graphics::frame_snapshot, bmptk::graphics::frame_buffer, bmptk::graphics::frame_dummy, bmptk::chips::pcd8544< arg_sce, arg_res, arg_dc, arg_sdin, arg_sclk, x_size, y_size >, and bmptk::chips::pcd8544< sce, res, dc, sdin, sclk, 84, 48 >.
|
virtual |
fill the full frame with the indicated color
This method fills the screen with the indicated color and save this color for bg_get().
Reimplemented in bmptk::graphics::frame_filter, bmptk::graphics::frame_tee, bmptk::graphics::frame_snapshot, bmptk::graphics::frame_buffer, bmptk::chips::pcd8544< arg_sce, arg_res, arg_dc, arg_sdin, arg_sclk, x_size, y_size >, and bmptk::chips::pcd8544< sce, res, dc, sdin, sclk, 84, 48 >.
|
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.
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.