4 * Created on: Oct 28, 2011
8 #include "imageModificationManager.h"
10 ImageMManager::ImageMManager() {
13 ImageMManager::ImageMManager(ImageMManager* manager) {
14 this->m_PixelMap = manager->GetModificationMap();
15 this->m_RegionStruct = manager->GetModifiedRegion();
17 ImageMManager::~ImageMManager() {
21 void ImageMManager::CleanModifiedRegion() {
23 int min = std::numeric_limits<int>::min();
24 int max = std::numeric_limits<int>::max();
25 this->m_RegionStruct.minX = max;
26 this->m_RegionStruct.maxX = min;
27 this->m_RegionStruct.minY = max;
28 this->m_RegionStruct.maxY = min;
29 this->m_RegionStruct.minZ = max;
30 this->m_RegionStruct.maxZ = min;
31 this->m_PixelMap.clear();
34 void ImageMManager::CalculateMinMaxRegion(const int& i, const int& j,
36 if (i <= this->m_RegionStruct.minX) {
37 this->m_RegionStruct.minX = i;
39 if (i > this->m_RegionStruct.maxX) {
40 this->m_RegionStruct.maxX = i;
42 if (j <= this->m_RegionStruct.minY) {
43 this->m_RegionStruct.minY = j;
45 if (j > this->m_RegionStruct.maxY) {
46 this->m_RegionStruct.maxY = j;
48 if (k <= this->m_RegionStruct.minZ) {
49 this->m_RegionStruct.minZ = k;
51 if (k > this->m_RegionStruct.maxZ) {
52 this->m_RegionStruct.maxZ = k;
56 void ImageMManager::AddModifiedPixel(const int& i, const int& j, const int& k) {
57 this->m_PixelMap[i][j][k] = true;
58 this->CalculateMinMaxRegion(i, j, k);
61 RegionStructUR ImageMManager::GetModifiedRegion() {
62 return (this->m_RegionStruct);
65 ImageMManager::PixelModMap ImageMManager::GetModificationMap() {
66 return (this->m_PixelMap);