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

a drawable line object More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::line:
bmptk::graphics::drawable

Public Member Functions

 line (frame &frame, const vector position, const vector size, const color fg=color::black(), int width=1)
 constructs a line from its frame, position, size, color, and width
 
void draw () const
 draw the line on f, at position, and to scale
 
- Public Member Functions inherited from bmptk::graphics::drawable
frameframe_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
 

Public Attributes

vector size
 the length of the line; can be read or written
 

Additional Inherited Members

- Protected Member Functions inherited from bmptk::graphics::drawable
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 inherited from bmptk::graphics::drawable
framefr
 parent frame
 
vector position
 the position
 
color fg
 foreground color
 
color bg
 background color
 
unsigned int width
 width of (for instance) lines
 

Detailed Description

a drawable line object

A line object is a drawable that represents a line. When it draws itself it will use the fg of its drawable part for the line, the bg of its drawable part will not be used. The line will be drawn using the specified width, by drawing adjacent pixels. The size of a line is its lenghth in the x and y directions, not its endpoint (it is one pixel beyond the end).

Definition at line 1267 of file graphics.h.

Member Data Documentation

vector bmptk::graphics::line::size

the length of the line; can be read or written

The position of a drawable is specified when it is drawn, it is not part of the drawable. You can think of the line starting at the origin. The size is the length in the x and y directions (not the endpoint!).

Definition at line 1276 of file graphics.h.


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