Bare Metal Programming Tool Kit
|
apply a function to the color before writing More...
#include <graphics.h>
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()) | |
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.