-
Notifications
You must be signed in to change notification settings - Fork 0
/
Image.cpp
64 lines (52 loc) · 1.11 KB
/
Image.cpp
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
/**
* Image.cpp
*
* 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 ;) )
*/
#include "Factory.h"
#include "Image.h"
#include <iostream>
void Image::clear()
{
m_imp->clear();
}
Image::Image()
{
FactoryPtr factory = Factory::Instance();
m_imp = factory->makeImageImp();
}
unsigned int Image::getWidth()
{
return m_imp->getWidth();
}
unsigned int Image::getHeight()
{
return m_imp->getHeight();
}
Image::~Image()
{
delete m_imp;
}
void Image::loadFromFile(const std::string& filename)
{
std::cout << "[ Image::loadFromFile() ] Only TargetImage can load file: " << filename << std::endl;
}
const RGBA32* Image::get(unsigned int x, unsigned int y)
{
return m_imp->get(x,y);
}
void Image::drawGene(const Gene&)
{
std::cout << "[ Image::drawGene() ] Only PhenotypeImage draws gene" << std::endl;
}
ImageImp& Image::getImageImp()
{
return *m_imp;
}