Add Painter.draw_bitmap for Bitmap types.

This commit is contained in:
Jared Boone 2016-02-03 13:23:46 -08:00
parent deade67fd8
commit 76013a656c
2 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,10 @@ int Painter::draw_string(Point p, const Style& style, const std::string text) {
return width;
}
void Painter::draw_bitmap(const Point p, const Bitmap& bitmap, const Color foreground, const Color background) {
display.draw_bitmap(p, bitmap.size, bitmap.data, foreground, background);
}
void Painter::draw_hline(Point p, int width, const Color c) {
display.fill_rectangle({ p, { width, 1 } }, c);
}

View File

@ -50,6 +50,8 @@ public:
int draw_string(Point p, const Style& style, const std::string text);
void draw_bitmap(const Point p, const Bitmap& bitmap, const Color background, const Color foreground);
void draw_rectangle(const Rect r, const Color c);
void fill_rectangle(const Rect r, const Color c);