本文整理汇总了C++中ofVideoPlayer::isFrameNew方法的典型用法代码示例。如果您正苦于以下问题:C++ ofVideoPlayer::isFrameNew方法的具体用法?C++ ofVideoPlayer::isFrameNew怎么用?C++ ofVideoPlayer::isFrameNew使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofVideoPlayer
的用法示例。
在下文中一共展示了ofVideoPlayer::isFrameNew方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void update() {
video.update();
if(video.isFrameNew()) {
copyGray(video, gray);
resize(video, graySmall, rescale, rescale);
threshold(gray, thresholded, thresholdValue);
dilate(thresholded, dilated, dilationAmount);
updateMotion();
updateContours();
}
}
示例2: draw
//--------------------------------------------------------------
void testApp::draw(){
ofBackgroundGradient(ofColor(0,0,0), ofColor(50, 50, 50), OF_GRADIENT_CIRCULAR);
ofSetColor(255);
if( mode == "edit" || mode == "move" ){
if( mode == "move" ){
ofSetColor(20, 90, 30);
ofRect(0,0,3000,3000);
ofSetColor(255);
}
for(int i = 0; i < thumbs.size(); i++){
thumbs[i].draw();
}
if( mode == "move" && bDown ){
ofSetColor(255, 190, 50);
ofRect(thumbs[placedIndex].r.x - 5, thumbs[placedIndex].r.y, 4, 80);
}
ofSetColor(255);
}else if( mode == "full" ){
fullVid.draw(0,0);
ofRect(thumbs[selected].pos * ofGetWidth(), ofGetHeight()-10, 4, 10);
}else{
vid.setAnchorPercent(0.5, 0.5);
vid.draw(ofGetWidth()/2, ofGetHeight()/2, ofGetWidth(), ofGetWidth() * ( vid.getHeight() / vid.getWidth() ));
if( vid.isFrameNew() ){
if( mode == "play" ){
img.grabScreen(0,0,ofGetWidth(),ofGetHeight());
img.saveImage("frames/" + ofToString(totalFrames) + ".jpg");
}
totalFrames++;
framecounter++;
if( framecounter > NUM_FRAMES ){
nextVideo();
}
}
}
}