summaryrefslogtreecommitdiff
path: root/plugingui/painter.h
diff options
context:
space:
mode:
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::