From 78c2edc0ac7e6ea6cf388cb4eaed45ac44494af6 Mon Sep 17 00:00:00 2001 From: Jamie Allen Date: Tue, 21 Feb 2012 01:50:47 +0100 Subject: [PATCH] couple of todos added //TODO: Needs to return to a black screen - not to exit... // i.e.: operational sequence // 1) starts in a black screen // 2) we 'start' with keypress "s" the entire set of analyses // 3) at any point we need to be able to restart / stop-return-to-black / trigger each analysis individually // 4) should end in black screen as well // 5) final kill button --- example/RefractiveIndex.cpp | 14 ++++++++++++++ src/IResponseAnalysis.cpp | 23 ++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/example/RefractiveIndex.cpp b/example/RefractiveIndex.cpp index d12a055..df13735 100644 --- a/example/RefractiveIndex.cpp +++ b/example/RefractiveIndex.cpp @@ -200,6 +200,18 @@ void RefractiveIndex::update() void RefractiveIndex::draw() { ofBackground(0, 0, 0); + + //TODO: Needs to return to a black screen - not to exit... + + // i.e.: operational sequence + // 1) starts in a black screen + // 2) we 'start' with keypress "s" the entire set of analyses + // 3) at any point we need to be able to restart / stop-return-to-black / trigger each analysis individually + // 4) should end in black screen as well + // 5) final kill button + + ofRect(0,0,ofGetWidth(), ofGetHeight()); + if(_currentAnalysis) _currentAnalysis->draw(); } @@ -312,6 +324,8 @@ void RefractiveIndex::keyPressed (int key) _state = ISTATE_START; } */ + + } void RefractiveIndex::exit() diff --git a/src/IResponseAnalysis.cpp b/src/IResponseAnalysis.cpp index 4d47604..3a90438 100755 --- a/src/IResponseAnalysis.cpp +++ b/src/IResponseAnalysis.cpp @@ -117,9 +117,18 @@ void IResponseAnalysis::draw() case STATE_ACQUIRING: { - /// *** TODO *** /// - // still need to deal with latency frames here - i.e.: there are frames - /// *** TODO *** /// + ofEnableAlphaBlending(); + ofColor aColour; + int _fade_in_frames = _frame_cnt_max/10; + cout<< "_fade_in_frames" << _fade_in_frames<< endl; + + if (_frame_cnt < _fade_in_frames) { + + aColour.set(255, 255, 255, ofMap(_frame_cnt, 0, _fade_in_frames, 0, 255)); + ofSetColor(aColour); + ofRect(0, 0, ofGetWidth(), ofGetHeight()); + + } if (_frame_cnt < _frame_cnt_max) { @@ -131,6 +140,14 @@ void IResponseAnalysis::draw() _RUN_DONE = true; } + if (_frame_cnt >= (_frame_cnt_max-_fade_in_frames) && _frame_cnt < _frame_cnt_max) { + aColour.set(0, 0, 0, ofMap(_frame_cnt-(_frame_cnt_max-_fade_in_frames), 0, _fade_in_frames, 0, 255)); + ofSetColor(aColour); + ofRect(0, 0, ofGetWidth(), ofGetHeight()); + // cout << "FADE OUT STROBE TIME " << endl; + } + + ofDisableAlphaBlending(); _frame_cnt++; break;