void ofApp::update() { ofBackground(0); #ifdef INTERACTIVE if(playState <= 1) { #ifdef KINECT updateKinect(); #else updateWebcam(); #endif updateBlobs(); updateFBOs(); if(ofGetFrameNum() % 60 == 0) { updateBrightness(); } } else if(playState >= 2) { updateMovies(); } #else if (playState == 1) playState = 2; updateMovies(); #endif // Write if(ofGetMinutes() % 10 == 0) { writeDiagnostics(); } }
void WebcamDevice::run() { while(_isRunning) { switch(_detect) { case noDetection: _vcap >> *_frame; break; case faceDetection: _vcap >> *_frame; faceRT(); break; case chessDetection: _vcap >> *_frame; chessRT(); break; case qrDetection: _vcap >> *_frame; qrRT(); break; default: _vcap >> *_frame; break; } emit updateWebcam(); msleep(33); // 33 fps } }