summaryrefslogtreecommitdiff
path: root/plugingui/painter.h
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2018-06-16 12:52:48 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-12 11:13:53 +0200
commit8ad5f7c39db55cab3f78fdefab323435261941fd (patch)
treefb5a3f4a29716a83e18a96b70ec9162d9e93b8c6 /plugingui/painter.h
parent20bdae6c72192c87bf95c6ac86c8cc049aa1ab5a (diff)
Add hovering to visualization.
Diffstat (limited to 'plugingui/painter.h')
-rw-r--r--plugingui/painter.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugingui/painter.h b/plugingui/painter.h
index fc4ce2b..2630b0c 100644
--- a/plugingui/painter.h
+++ b/plugingui/painter.h
@@ -29,11 +29,11 @@
#include <string>
#include "colour.h"
+#include "pixelbuffer.h"
namespace GUI
{
-class PixelBufferAlpha;
class Font;
class Drawable;
class Image;
@@ -60,6 +60,9 @@ public:
void drawImageStretched(int x, int y, const Drawable& image,
int width, int height);
+ template<typename Iterator>
+ void draw(Iterator begin, Iterator end, int x_offset, int y_offset, Colour const& colour);
+
typedef struct {
Image* topLeft;
Image* top;
@@ -90,4 +93,13 @@ private:
Colour colour;
};
+template<typename Iterator>
+void Painter::draw(Iterator begin, Iterator end, int x_offset, int y_offset, Colour const& colour)
+{
+ for (auto it = begin; it != end; ++it)
+ {
+ pixbuf.addPixel(x_offset + it->x, y_offset + it->y, colour);
+ }
+}
+
} // GUI::