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

frame that represents a rectangular part of another frame More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::subframe:
bmptk::graphics::frame

Public Member Functions

vector translate_outfrom (const vector p) const
 translate a subframe coordinate to a master frame coordinate
 
vector translate_into (const vector p) const
 translate a master frame coordinate to a subframe coordinate
 
 subframe (frame &f, vector top_left, vector direction, bool swapped=false)
 create a subframe, endpoints specified as vectors
 
- Public Member Functions inherited from bmptk::graphics::frame
 frame (const vector size)
 create a frame of specified size
 
vector size_get () const
 get the size of the frame
 
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
 

Public Attributes

framemaster
 the master of this subframe
 
const vector top_left
 location within the master of this subframes topleft pixel
 
const vector bottom_right
 location within the master of this subframes bottomright pixel
 
const bool swapped
 whether the subframe coordinates are swapped
 

Protected Member Functions

void checked_write (const vector p, const color c)
 checked_write implementation as requiredby frame
 

Additional Inherited Members

- Protected Attributes inherited from bmptk::graphics::frame
const vector size
 frame size
 
color bg
 most recently applied background color (as used in clear())
 

Detailed Description

frame that represents a rectangular part of another frame

A subframe is created by specifying the master frame, the top-left pixel of the subfram within the master frame, and the direction in which the subframe extends within the master frame. ( top_left + direction - direction.direction() ) == bottom-right pixel of the subframe. The direction can point towards all four quadrants, hence the subframe can appear mirrored within the master frame.

Definition at line 1157 of file graphics.h.

Member Function Documentation

void bmptk::graphics::subframe::checked_write ( const vector  p,
const color  c 
)
inlineprotectedvirtual

checked_write implementation as requiredby frame

When scale == 0 checked_write will do nothing, hence the subframe will not appear in the master frame.

Implements bmptk::graphics::frame.

Definition at line 1235 of file graphics.h.


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