-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageImp.h
76 lines (61 loc) · 1.35 KB
/
ImageImp.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* ImageImp.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 IMAGEIMP_H_
#define IMAGEIMP_H_
#include "Gene.h"
#include "Pixel.h"
#include <string>
class ImageImp
{
public:
virtual ~ImageImp();
/**
* Clears the image to black or transparent, depending on implementation.
*/
virtual void clear() =0;
/**
* Loads image from file.
*
* @param filename
*/
virtual void loadFromFile(const std::string& filename) =0;
/**
* Draws the gene on the image.
*
* @param gene
*/
virtual void drawGene(const Gene& gene) =0;
/**
* @return Width of the image.
*/
virtual unsigned int getWidth() =0;
/**
* @return Height of the image.
*/
virtual unsigned int getHeight() =0;
/**
* @return The pixel at location (x,y)
*/
virtual const PIXEL* get(unsigned int x, unsigned int y) =0;
/**
* Returns the horizontal pixel line at height y
*
* @param y
* @return
*/
virtual const PIXEL* getScanline(unsigned int y) =0;
protected:
ImageImp();
ImageImp(const unsigned int width, const unsigned int height);
};
#endif /* IMAGEIMP_H_ */