![]() |
Bare Metal Programming Tool Kit
|
an object that can be drawn in a frame More...
#include <graphics.h>
Public Member Functions | |
| frame & | frame_get () const |
| get the parent frame | |
| const vector | position_get () const |
| get the position | |
| color | fg_get () const |
| get the forgeround color | |
| color | bg_get () const |
| get the background color | |
| unsigned int | width_get () const |
| get the width | |
| void | position_set (const vector pos) |
| set the position | |
| void | fg_set (const color c) |
| set the forgeround color | |
| void | bg_set (const color c) |
| set the background color | |
| void | width_set (unsigned int w) |
| set the width | |
| virtual void | draw () const =0 |
| draw yourself | |
Protected Member Functions | |
| void | drawable_draw_pixel (const vector address, const color c) const |
| draw one pixel on f, at position | |
| drawable (frame &fr, const vector position=vector::origin(), const color fg=color::black(), const color bg=color::transparent(), unsigned int width=1) | |
| constructor, specify frame, position, fg, bg colors, (line) width | |
Protected Attributes | |
| frame & | fr |
| parent frame | |
| vector | position |
| the position | |
| color | fg |
| foreground color | |
| color | bg |
| background color | |
| unsigned int | width |
| width of (for instance) lines | |
an object that can be drawn in a frame
A drawable is an abstract object that can be drawn in a frame. A drawable knows the frame the location (anchor point) within this it has has has a forgeground and background color and a (line) width. What these properties exactly mean depends on the specific drawable.
A drawable contains two colors and one integer. It has a reference to a frame. This frame must still exist when the drwabale is asked to draw itself.
Definition at line 605 of file graphics.h.
|
inlineprotected |
constructor, specify frame, position, fg, bg colors, (line) width
The default is to draw in black forgeground, with transparent (meaning: do not draw) background, line width (when applicable) 1 pixel.
Definition at line 646 of file graphics.h.
|
protected |
draw one pixel on f, at position
This is the function that the draw function in a concrete drawable should use to draw each pixel of itself. Address is the location of the pixel that is to be drawn, c its color.
1.8.2