Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Enumerations | Functions
bmptk::graphics Namespace Reference

graphic elements More...

Classes

class  vector
 a relative or absolute (= relative to (0,0)) location on a grid More...
 
class  color
 a color (in the 3 * 8 bit RGB format + transparency) More...
 
class  event
 something that the users caused to happen on the screen More...
 
class  drawable
 an object that can be drawn in a frame More...
 
class  frame
 a rectangular block of writable pixels More...
 
class  frame_dummy
 writing to this frame does nothing More...
 
class  frame_buffer
 in-memory frame buffer that can be written in one go More...
 
class  frame_snapshot
 in-memory write-through frame buffer that can be written to a .bmp file More...
 
class  frame_tee
 writes to the (2..4) underlying frames More...
 
class  frame_filter
 apply a function to the color before writing More...
 
class  subframe
 frame that represents a rectangular part of another frame More...
 
class  line
 a drawable line object More...
 
class  rectangle
 a drawable rectangle object More...
 
class  circle
 a drawable circle object More...
 
class  image
 a recangular block that can be drawn at a position in a frame More...
 
class  image_pixels
 an image that can be read pixel by pixel More...
 
class  inline_rgb_photo
 a color photo stored as inline constant data (in ROM) More...
 
class  inline_bw_photo
 a black-and-wite photo stored as inline constant data (in ROM) More...
 
class  font
 the photo's (bitmaps) of characters More...
 
class  char_photo
 a photo of a single char from a font More...
 
class  inline_font
 a font stored as inline constant data (in ROM) More...
 
class  format
 specifies how a text is rendered on a screen More...
 
class  text
 a formatted text More...
 
class  frame_console
 frame that is an ostream subclass (so you can << to it) More...
 

Enumerations

enum  event_type {
  event_none, event_exit, event_down, event_touch,
  event_up, event_click
}
 types of events More...
 
enum  relief { relief_flat, relief_raised, relief_sunken }
 
enum  font_alignment { align_near, align_far, align_centre, align_fill }
 

Functions

const
bmptk::graphics::inline_font
font_default ()
 returns the default font
 
vector max (vector a, vector b, vector c=vector::origin(), vector d=vector::origin())
 returns the vector that is the maximum of the arguments on each axis
 
vector operator* (int n, const vector v)
 multiplies a vector by an integer by multiplying the coordinates
 
std::ostream & operator<< (std::ostream &s, const format &f)
 print a format
 

Detailed Description

graphic elements

Enumeration Type Documentation

enum event_type
related

types of events

This type represents an action the user performs on the screen, using a mouse or stylus (on a touch screen).

Enumerator:
event_none 

nothing happened

This event type is used when an event object is required, but nothing happened. The location has no meaning.

event_exit 

user requests application exit

This event type is used when the user requests the (sub)application to terminate. The location has no meaning.

event_down 

user lands on the screen

This event type is used when the user lands on the screen: the mouse button is pressed down, or the stylus first contacts the screen. The location indicates where this happened.

event_touch 

user moves while touching the screen

This event type is used when the user touches a new pixel, either because the cursor or stylus first touched down on the screen, or because the the mouse cursor or stylus was down and moved to a different pixel. The location indicates the (new) pixel.

This event type would typically be used by a freehand paint application.

event_up 

user takes off from the screen

This event type is used when the user has landed on the screen but now takes off (releases the mouse button, or moves the stylus from the screen). The location is the last location where the user was on the screen.

event_click 

user clicks on the screen

This event type is used when the user clicks on the screen, which is the same as down and up in rapid succession. The down and up events will also be generated. The location is the location of the up event.

Definition at line 461 of file graphics.h.

enum font_alignment
related

the alignment of a text

Enumerator:
align_near 

the text is put nearest to the near edge

align_far 

the text is put nearest to the far edge

align_centre 

the text is centered between the edges

align_fill 

the text is space-filled to occupy the space between the edges

Definition at line 1829 of file graphics.h.

enum relief
related

appearance of the border of a rectangle

Enumerator:
relief_flat 

the border is drawn flat, using the fg color

relief_raised 

the border is drawn raised, using the bright and shadow colors

relief_sunken 

the border is drawn raised, using the shadow and bright colors

Definition at line 1307 of file graphics.h.

Function Documentation

vector bmptk::graphics::max ( vector  a,
vector  b,
vector  c = vector::origin(),
vector  d = vector::origin() 
)

returns the vector that is the maximum of the arguments on each axis

For two vectors the returned vector is

return vector(
max( a.x_get(), b.x_get() ),
max( a.y_get(), b.y_get() )
);