REDO of the cleanup of the save callbacks so i can put the fucking latency code in...

(git hub did something weird)
This commit is contained in:
Jamie Allen 2012-02-19 23:00:34 +01:00
parent 6395b1c0a0
commit d536774cc8
9 changed files with 52 additions and 81 deletions

View File

@ -150,18 +150,15 @@ void CamNoiseAnalysis::draw()
// this runs at save_cb timer rate = DELTA_T_SAVE
void CamNoiseAnalysis::save_cb(Timer& timer)
{
_save_cnt++;
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
string thisLocation = RefractiveIndex::_location;
string file = _whole_file_path+"/"+file_name;
cout << "ColorSingleAnalysis::saving...\n";
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_saved_filenames.push_back(file);
//if(_save_cnt >= NUM_SAVE_PER_RUN)
// _RUN_DONE = true;
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}

View File

@ -174,19 +174,16 @@ void ColorMultiAnalysis::draw()
// this runs at save_cb timer rate = DELTA_T_SAVE
void ColorMultiAnalysis::save_cb(Timer& timer)
{
_save_cnt++;
// UPDATE THE COLOR ON THE SCREEN
//float c_last = c;
cout << "ColorMultiAnalysis::saving...\n";
// cout << "COLORMULTIANALYSIS::saving...\n";
// cout << "c_last... " << c << endl;
string file_name = ofToString(_save_cnt,2)+"_"+ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
// cout<<_whole_file_path<<endl;
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
//if(_save_cnt >= NUM_SAVE_PER_RUN){
// _RUN_DONE = true;
//}
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}

View File

@ -156,15 +156,13 @@ void ColorSingleAnalysis::save_cb(Timer& timer)
{
_save_cnt++;
// cout << "ColorSingleAnalysis::saving...\n";
cout << "ColorSingleAnalysis::saving...\n";
string file_name =ofToString(_save_cnt,2)+"_"+fileNameTag+"_"+ofToString(_run_cnt,2)+".jpg";
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
//cout<<_whole_file_path+"/"+file_name<<endl;
//if(_save_cnt >= NUM_SAVE_PER_RUN)
// _RUN_DONE = true;
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}

View File

@ -167,32 +167,17 @@ void DiffNoiseAnalysis::draw()
// this runs at save_cb timer rate = DELTA_T_SAVE
void DiffNoiseAnalysis::save_cb(Timer& timer)
{
float rand10 = ofRandom(0,10);
if (rand10 > 5.0) {
cout << "DiffNoiseAnalysis::saving...\n";
cout << "c_last... " << c << endl;
cout<<"rand10... " <<rand10<<endl;
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
string thisLocation = RefractiveIndex::_location;
//RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
// fileName = imageSaveFolderPath+whichAnalysis+"_"+ofToString(100.0*i*scanLineSpeed/ofGetHeight(),2)+"%_"+ofToString(i)+".jpg";
//ofSaveImage(vectorOfPixels[i], fileName, OF_IMAGE_QUALITY_BEST);
string file = _whole_file_path+"/"+file_name;
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_saved_filenames.push_back(file);
}
_save_cnt++;
cout << "DiffNoiseAnalysis::saving...\n";
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
_save_cnt++;
//if(_save_cnt >= NUM_SAVE_PER_RUN)
// _RUN_DONE = true;
}

View File

@ -113,16 +113,10 @@ void IResponseAnalysis::save_cb(Timer& timer)
_save_cnt++;
cout << "IResponseAnalysis::saving...\n";
//cout << "c_last... " << c << endl;
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
string thisLocation = RefractiveIndex::_location;
//RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera
// fileName = imageSaveFolderPath+whichAnalysis+"_"+ofToString(100.0*i*scanLineSpeed/ofGetHeight(),2)+"%_"+ofToString(i)+".jpg";
//ofSaveImage(vectorOfPixels[i], fileName, OF_IMAGE_QUALITY_BEST);
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
//if(_save_cnt >= NUM_SAVE_PER_RUN)
// _RUN_DONE = true;
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}

View File

@ -128,18 +128,12 @@ void RelaxRateAnalysis::draw()
void RelaxRateAnalysis::save_cb(Timer& timer)
{
_save_cnt++;
cout << "RelaxRateAnalysis::saving...\n";
//cout << "c_last... " << c << endl;
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
string thisLocation = RefractiveIndex::_location;
string file = _whole_file_path+"/"+file_name;
ofSaveImage(RefractiveIndex::_pixels, file, OF_IMAGE_QUALITY_BEST);
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_saved_filenames.push_back(file);
//if(_save_cnt >= NUM_SAVE_PER_RUN)
// _RUN_DONE = true;
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}

View File

@ -211,7 +211,10 @@ void ShadowScapesAnalysis::draw()
void ShadowScapesAnalysis::save_cb(Timer& timer)
{
_save_cnt++;
cout << "ShadowScapesAnalysis::saving...\n";
string file_name;
if(_dir == H) {
@ -227,6 +230,7 @@ void ShadowScapesAnalysis::save_cb(Timer& timer)
}
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_save_cnt++;
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}

View File

@ -306,7 +306,10 @@ void ShapeFromShadingAnalysis::draw()
}
ofDisableAlphaBlending();
}
} else {
_RUN_DONE = true;
}
_frame_cnt++;
//cout << "_frame_cnt:" << _frame_cnt << endl;
@ -337,14 +340,14 @@ void ShapeFromShadingAnalysis::draw()
// this runs at save_cb timer rate = DELTA_T_SAVE
void ShapeFromShadingAnalysis::save_cb(Timer& timer)
{
//cout << "ShapeFromShadingAnalysis::saving...\n";
_save_cnt++;
cout << "ShapeFromShadingAnalysis::saving...\n";
string file_name = ofToString(_save_cnt,2)+"_"+ quad +"_"+ofToString(_run_cnt,2)+".jpg";
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_save_cnt++;
//if(_save_cnt >= NUM_SAVE_PER_RUN)
// _RUN_DONE = true;
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}

View File

@ -152,17 +152,16 @@ void StrobeAnalysis::draw()
// this runs at save_cb timer rate = DELTA_T_SAVE
void StrobeAnalysis::save_cb(Timer& timer)
{
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(_strobe_on) +"_"+ofToString(_run_cnt,2)+".jpg";
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_save_cnt++;
cout << "_save_cnt" << _save_cnt << endl;
cout << "StrobeAnalysis::saving...\n";
cout << "_save_cnt_max" << _save_cnt_max << endl;
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(_strobe_on) +"_"+ofToString(_run_cnt,2)+".jpg";
//TODO: something fucked here with my calc of _save_cnt_max - new structure should fix it?
//if(_save_cnt >= _save_cnt_max-10) {
// _RUN_DONE = true;
//}
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
}