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

apply a function to the color before writing More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::frame_filter:
bmptk::graphics::frame

Public Member Functions

 frame_filter (frame &f, color(&filter)(color))
 construct a frame_filter from the underlying frame and a filter function
 
 frame_filter (frame &f, void(&writer)(frame &f, vector p, color c, color bg))
 construct a frame_filter from the underlying frame and a writer function
 
void checked_write (const vector p, const color c)
 apply the filter function, write the result to the underlying frame
 
void flush ()
 flush the underlying frame
 
void clear (const color c=color::white())
 clear the underlying frame with the filtered color, and remember it
 
- 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
 
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
 

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

apply a function to the color before writing

When a frame_filter is consructed a filter function is specified that will be applied to the color of each pixel before it is written.

Alternatively, a writer function can be specified that is called to write a pixel. Besides changing the color, it can for instance write to one or more (different) points.

Definition at line 1077 of file graphics.h.


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