Began proof-of-concept memory module.
[aesalon.git] / include / artisan / gviewport / RenderedImage.h
blob3531574ffac519038d175dc5ebbddbb20748d139
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/artisan/gviewport/RenderedImage.h
8 */
10 #ifndef AesalonArtisan_GViewport_RenderedImage_H
11 #define AesalonArtisan_GViewport_RenderedImage_H
13 #include <QPainter>
14 #include <QImage>
15 #include <QMutex>
17 #include "Rect.h"
19 namespace Artisan {
20 namespace GViewport {
22 class RenderedImage {
23 private:
24 Rect m_dataRange;
25 Rect m_pixelSize;
26 QImage m_image;
27 QPainter *m_painter;
28 QMutex m_paintLock;
29 public:
30 RenderedImage(const Rect &dataRange = Rect(), const Rect &pixelSize = Rect());
31 ~RenderedImage();
33 const Rect &dataRange() const { return m_dataRange; }
34 const Rect &pixelSize() const { return m_pixelSize; }
36 void merge(RenderedImage &other);
38 void startPainting();
39 QPainter &painter() { return *m_painter; }
40 void stopPainting();
42 void paintOnto(QPaintDevice *device);
44 RenderedImage &operator=(const RenderedImage &other);
47 } // namespace GViewport
48 } // namespace Artisan
50 #endif