From 51c71bdc15286c990a3a297b43299863d3968733 Mon Sep 17 00:00:00 2001 From: Jamie Allen Date: Mon, 20 Feb 2012 20:28:12 +0100 Subject: [PATCH] added vid grab to IResponse --- example/RefractiveIndex.cpp | 1 + src/IResponseAnalysis.cpp | 7 +++++++ src/ShadowScapesAnalysis.cpp | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/example/RefractiveIndex.cpp b/example/RefractiveIndex.cpp index b8090c2..decf166 100644 --- a/example/RefractiveIndex.cpp +++ b/example/RefractiveIndex.cpp @@ -189,6 +189,7 @@ void RefractiveIndex::state_analysis() void RefractiveIndex::update() { state_analysis(); + /* RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera diff --git a/src/IResponseAnalysis.cpp b/src/IResponseAnalysis.cpp index b56f847..571685a 100755 --- a/src/IResponseAnalysis.cpp +++ b/src/IResponseAnalysis.cpp @@ -200,6 +200,13 @@ void IResponseAnalysis::save_cb(Timer& timer) { _save_cnt++; + RefractiveIndex::_vidGrabber.grabFrame(); // get a new frame from the camera + + if (RefractiveIndex::_vidGrabber.isFrameNew()) + { + RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera + } + cout << "IResponseAnalysis::saving...\n"; string file_name = ofToString(_save_cnt,2)+"_"+ ofToString(c,2)+"_"+ofToString(_run_cnt,2)+".jpg"; diff --git a/src/ShadowScapesAnalysis.cpp b/src/ShadowScapesAnalysis.cpp index 19b09df..b1410fb 100755 --- a/src/ShadowScapesAnalysis.cpp +++ b/src/ShadowScapesAnalysis.cpp @@ -278,7 +278,6 @@ void ShadowScapesAnalysis::save_cb(Timer& timer) RefractiveIndex::_pixels = RefractiveIndex::_vidGrabber.getPixelsRef(); //get ofPixels from the camera } - cout << "ShadowScapesAnalysis::saving...\n"; string file_name;