mid-commit AbstractAnalysis::saveimage

This commit is contained in:
dviid 2012-02-20 14:08:58 +01:00
parent 3649211943
commit b5cebe9304
3 changed files with 15 additions and 4 deletions

View File

@ -316,3 +316,13 @@ int AbstractAnalysis::getRecordedValueFromFileName(string str){
} }
void AbstractAnalysis::saveimage(string filename)
{
if(RefractiveIndex::_pixels.isAllocated()) {
ofSaveImage(RefractiveIndex::_pixels, filename, OF_IMAGE_QUALITY_BEST);
_saved_filenames.push_back(filename);
} else {
ofLog(OF_LOG_ERROR) << "RefractiveIndex::_pixels NOT allocated...";
}
}

View File

@ -39,6 +39,7 @@ public:
protected: protected:
virtual void create_dir(); virtual void create_dir();
virtual void saveimage(string filename);
// acquire images - all the children (see - do_synthesize) // acquire images - all the children (see - do_synthesize)
virtual void acquire() = 0; virtual void acquire() = 0;

View File

@ -420,9 +420,9 @@ void ShapeFromShadingAnalysis::save_cb(Timer& timer)
//cout << "ShapeFromShadingAnalysis::saving...\n"; //cout << "ShapeFromShadingAnalysis::saving...\n";
string file_name = ofToString(_save_cnt,2)+"_"+ quad +"_"+ofToString(_run_cnt,2)+".jpg"; string file_name = ofToString(_save_cnt,2)+"_"+ quad +"_"+ofToString(_run_cnt,2)+".jpg";
_saved_filenames.push_back(ofToDataPath("")+_whole_file_path+"/"+file_name);
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST); saveimage(file_name);
_save_cnt++; _save_cnt++;
//if(_save_cnt >= NUM_SAVE_PER_RUN) //if(_save_cnt >= NUM_SAVE_PER_RUN)