-
Notifications
You must be signed in to change notification settings - Fork 0
/
QtImageImp.h
51 lines (39 loc) · 1.01 KB
/
QtImageImp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* QtImageImp.h
*
* Created on: Aug 3, 2011
* Author: Jeroen Vlek
* Email: [email protected]
* Website: www.perceptivebits.com
* License: Free Beer (Feel free to use it in every
* way possible and if you like it, make
* sure to give me credit and buy me a drink
* if we ever meet ;) )
*/
#ifndef QTIMAGEIMP_H_
#define QTIMAGEIMP_H_
#include "Gene.h"
#include "ImageImp.h"
#include "Pixel.h"
#include <QImage>
#include <QPainter>
/**
* A Qt based implementation of the ImageImp class.
*/
class QtImageImp: public ImageImp, public QImage
{
public:
QtImageImp();
QtImageImp(const unsigned int width, const unsigned int height);
virtual ~QtImageImp();
void clear();
void drawGene(const Gene& gene);
void loadFromFile(const std::string& filename);
const PIXEL* get(unsigned int x, unsigned int y);
const PIXEL* getScanline(unsigned int y);
unsigned int getWidth();
unsigned int getHeight();
private:
QPainter* m_painter;
};
#endif /* QTIMAGEIMP_H_ */