Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

RawImagePyramid.cc

Go to the documentation of this file.
00001 #include "RawImagePyramid.h"
00002 
00003 #include "Shared/RobotInfo.h"
00004 
00005 RawImagePyramid::RawImagePyramid() : layers(NUM_PYRAMID_LAYERS) {
00006   int currWidth = RobotInfo::CameraResolutionX/2;
00007   int currHeight = RobotInfo::CameraResolutionY/2;
00008 
00009   for(unsigned int layer = 0; layer < NUM_PYRAMID_LAYERS; layer++) {
00010     layers[layer] = new RawImage(currWidth,currHeight);
00011 
00012     currWidth = (currWidth+1)/2;
00013     currHeight = (currHeight+1)/2;
00014   }
00015 }
00016 
00017 RawImagePyramid::~RawImagePyramid() {
00018   for(unsigned int i = 0; i < NUM_PYRAMID_LAYERS; i++) {
00019     delete layers[i];
00020   }
00021 
00022   layers.clear();
00023 }
00024 
00025 void RawImagePyramid::loadFromRawY() {
00026   layers[0]->loadFromRawY();
00027 
00028   for(unsigned int i = 1; i < NUM_PYRAMID_LAYERS; i++) {
00029     layers[i-1]->buildNextLayer(*layers[i]);
00030   }
00031 }
00032 
00033 void RawImagePyramid::printLayer(unsigned int layer) {
00034   layers[layer]->printImage();
00035 }
00036 

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:49 2016 by Doxygen 1.6.3