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:
parent
6395b1c0a0
commit
d536774cc8
@ -150,18 +150,15 @@ void CamNoiseAnalysis::draw()
|
|||||||
// this runs at save_cb timer rate = DELTA_T_SAVE
|
// this runs at save_cb timer rate = DELTA_T_SAVE
|
||||||
void CamNoiseAnalysis::save_cb(Timer& timer)
|
void CamNoiseAnalysis::save_cb(Timer& timer)
|
||||||
{
|
{
|
||||||
|
|
||||||
_save_cnt++;
|
_save_cnt++;
|
||||||
|
|
||||||
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
|
cout << "ColorSingleAnalysis::saving...\n";
|
||||||
string thisLocation = RefractiveIndex::_location;
|
|
||||||
|
|
||||||
string file = _whole_file_path+"/"+file_name;
|
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);
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
|
|
||||||
_saved_filenames.push_back(file);
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
|
|
||||||
//if(_save_cnt >= NUM_SAVE_PER_RUN)
|
|
||||||
// _RUN_DONE = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,19 +174,16 @@ void ColorMultiAnalysis::draw()
|
|||||||
// this runs at save_cb timer rate = DELTA_T_SAVE
|
// this runs at save_cb timer rate = DELTA_T_SAVE
|
||||||
void ColorMultiAnalysis::save_cb(Timer& timer)
|
void ColorMultiAnalysis::save_cb(Timer& timer)
|
||||||
{
|
{
|
||||||
|
|
||||||
_save_cnt++;
|
_save_cnt++;
|
||||||
|
|
||||||
// UPDATE THE COLOR ON THE SCREEN
|
cout << "ColorMultiAnalysis::saving...\n";
|
||||||
//float c_last = c;
|
|
||||||
|
|
||||||
// cout << "COLORMULTIANALYSIS::saving...\n";
|
|
||||||
// cout << "c_last... " << c << endl;
|
|
||||||
string file_name = ofToString(_save_cnt,2)+"_"+ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
|
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);
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
|
|
||||||
//if(_save_cnt >= NUM_SAVE_PER_RUN){
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
// _RUN_DONE = true;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -156,15 +156,13 @@ void ColorSingleAnalysis::save_cb(Timer& timer)
|
|||||||
{
|
{
|
||||||
_save_cnt++;
|
_save_cnt++;
|
||||||
|
|
||||||
// cout << "ColorSingleAnalysis::saving...\n";
|
cout << "ColorSingleAnalysis::saving...\n";
|
||||||
|
|
||||||
string file_name =ofToString(_save_cnt,2)+"_"+fileNameTag+"_"+ofToString(_run_cnt,2)+".jpg";
|
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);
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
|
|
||||||
//cout<<_whole_file_path+"/"+file_name<<endl;
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
|
|
||||||
//if(_save_cnt >= NUM_SAVE_PER_RUN)
|
|
||||||
// _RUN_DONE = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,31 +168,16 @@ void DiffNoiseAnalysis::draw()
|
|||||||
void DiffNoiseAnalysis::save_cb(Timer& timer)
|
void DiffNoiseAnalysis::save_cb(Timer& timer)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
_save_cnt++;
|
||||||
float rand10 = ofRandom(0,10);
|
|
||||||
|
|
||||||
if (rand10 > 5.0) {
|
|
||||||
|
|
||||||
cout << "DiffNoiseAnalysis::saving...\n";
|
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 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);
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
|
|
||||||
_saved_filenames.push_back(file);
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
|
|
||||||
}
|
|
||||||
_save_cnt++;
|
_save_cnt++;
|
||||||
//if(_save_cnt >= NUM_SAVE_PER_RUN)
|
|
||||||
// _RUN_DONE = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,16 +113,10 @@ void IResponseAnalysis::save_cb(Timer& timer)
|
|||||||
_save_cnt++;
|
_save_cnt++;
|
||||||
|
|
||||||
cout << "IResponseAnalysis::saving...\n";
|
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
|
string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg";
|
||||||
// fileName = imageSaveFolderPath+whichAnalysis+"_"+ofToString(100.0*i*scanLineSpeed/ofGetHeight(),2)+"%_"+ofToString(i)+".jpg";
|
|
||||||
//ofSaveImage(vectorOfPixels[i], fileName, OF_IMAGE_QUALITY_BEST);
|
|
||||||
|
|
||||||
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
|
|
||||||
//if(_save_cnt >= NUM_SAVE_PER_RUN)
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
// _RUN_DONE = true;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,18 +128,12 @@ void RelaxRateAnalysis::draw()
|
|||||||
void RelaxRateAnalysis::save_cb(Timer& timer)
|
void RelaxRateAnalysis::save_cb(Timer& timer)
|
||||||
{
|
{
|
||||||
_save_cnt++;
|
_save_cnt++;
|
||||||
|
|
||||||
cout << "RelaxRateAnalysis::saving...\n";
|
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 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, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
|
|
||||||
ofSaveImage(RefractiveIndex::_pixels, file, 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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -211,7 +211,10 @@ void ShadowScapesAnalysis::draw()
|
|||||||
void ShadowScapesAnalysis::save_cb(Timer& timer)
|
void ShadowScapesAnalysis::save_cb(Timer& timer)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
_save_cnt++;
|
||||||
|
|
||||||
cout << "ShadowScapesAnalysis::saving...\n";
|
cout << "ShadowScapesAnalysis::saving...\n";
|
||||||
|
|
||||||
string file_name;
|
string file_name;
|
||||||
|
|
||||||
if(_dir == H) {
|
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);
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
_save_cnt++;
|
|
||||||
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -306,6 +306,9 @@ void ShapeFromShadingAnalysis::draw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ofDisableAlphaBlending();
|
ofDisableAlphaBlending();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
_RUN_DONE = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_frame_cnt++;
|
_frame_cnt++;
|
||||||
@ -337,14 +340,14 @@ void ShapeFromShadingAnalysis::draw()
|
|||||||
// this runs at save_cb timer rate = DELTA_T_SAVE
|
// this runs at save_cb timer rate = DELTA_T_SAVE
|
||||||
void ShapeFromShadingAnalysis::save_cb(Timer& timer)
|
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";
|
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);
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
_save_cnt++;
|
|
||||||
|
|
||||||
//if(_save_cnt >= NUM_SAVE_PER_RUN)
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
// _RUN_DONE = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,17 +152,16 @@ void StrobeAnalysis::draw()
|
|||||||
// this runs at save_cb timer rate = DELTA_T_SAVE
|
// this runs at save_cb timer rate = DELTA_T_SAVE
|
||||||
void StrobeAnalysis::save_cb(Timer& timer)
|
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++;
|
_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";
|
||||||
|
|
||||||
|
ofSaveImage(RefractiveIndex::_pixels, _whole_file_path+"/"+file_name, OF_IMAGE_QUALITY_BEST);
|
||||||
|
|
||||||
|
_saved_filenames.push_back(_whole_file_path+"/"+file_name);
|
||||||
|
|
||||||
//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;
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user