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