当前位置: 首页>>代码示例>>C++>>正文


C++ ofVideoPlayer::update方法代码示例

本文整理汇总了C++中ofVideoPlayer::update方法的典型用法代码示例。如果您正苦于以下问题:C++ ofVideoPlayer::update方法的具体用法?C++ ofVideoPlayer::update怎么用?C++ ofVideoPlayer::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ofVideoPlayer的用法示例。


在下文中一共展示了ofVideoPlayer::update方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mousePressed

//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
	if( mode == "edit" ){
		for(int i = 0; i < thumbs.size(); i++){
			if(thumbs[i].r.inside(x,y)){
				mode = "full";
				selected = i;
				fullVid.loadMovie(thumbs[i].video);
				fullVid.setPosition(thumbs[i].pos);
				fullVid.update();
				break;
			}
		}
	}
	else if(mode == "full" ){
		thumbs[selected].pos = ofMap(x, 0, ofGetWidth(), 0, 0.9999, true);
		fullVid.setPosition(thumbs[selected].pos);
		fullVid.update();	
		bDown = true;			
	}

	if( mode == "move" ){
		for(int i = 0; i < thumbs.size(); i++){
			if(thumbs[i].r.inside(x,y)){
				selected = i;
				bDown = true;
				break;
			}
		}
		placedIndex = selected;
	}
	
}
开发者ID:Giladx,项目名称:autoMovie,代码行数:33,代码来源:testApp.cpp

示例2: update

//--------------------------------------------------------------
void testApp::update(){
    vid.update();
	if( mode == "full" ){
		fullVid.update();
		if( fullVid.isPlaying() && ofGetElapsedTimef() > timer ){
			fullVid.setPaused(true);
		}
	}
	
}
开发者ID:Giladx,项目名称:autoMovie,代码行数:11,代码来源:testApp.cpp

示例3: update

//--------------------------------------------------------------
void ofApp::update(){
//-------------------------
    
    bool bNewFrame = false;
    vidGrabber.update();
    bNewFrame = vidGrabber.isFrameNew();
    if (bNewFrame){  // if we have a new frame
        colorImg.setFromPixels(vidGrabber.getPixels());
        grayImage = colorImg;
        if (bLearnBakground == true){  // if we hit space, this grabs a "control" image
            grayBg = grayImage;		// copys the pixels from grayImage into grayBg
            bLearnBakground = false;
        }
        grayDiff.absDiff(grayBg, grayImage);
        grayDiff.threshold(threshold);
        // find contours which are between the size of 20 pixels and 1/3 the w*h pixels.
        // find max 10 blobs with no holes in them
        contourFinder.findContours(grayDiff, 20, (vidX*vidY)/3, 10, false);	// false == dont find holes in our blobs
    }
    
    if (bSendSerialMessage){
        serial.writeByte('a');
        nTimesRead = 0;
        nBytesRead = 0;
        int nRead;
        
        unsigned char bytesReturned[3];
        
        memset(bytesReadString, 0, 4);
        memset(bytesReturned, 0, 3);
        
        while( (nRead = serial.readBytes( bytesReturned, 3)) > 0){
            nTimesRead++;
            nBytesRead = nRead;
        };
        
        memcpy(bytesReadString, bytesReturned, 3);
        
        bSendSerialMessage = false;
        readTime = ofGetElapsedTimef();
    }
    
    mov1.update();
    
    for(unsigned int i = 0; i < p.size(); i++){
        p[i].setMode(currentMode);
        p[i].update();
    }
    for(unsigned int i = 0; i < attractPointsWithMovement.size(); i++){
        attractPointsWithMovement[i].x = attractPoints[i].x + ofSignedNoise(i * 10, ofGetElapsedTimef() * 0.7) * 12.0;
        attractPointsWithMovement[i].y = attractPoints[i].y + ofSignedNoise(i * -10, ofGetElapsedTimef() * 0.7) * 12.0;
    }
    
}
开发者ID:jessherzog,项目名称:storyEclipse,代码行数:55,代码来源:ofApp.cpp

示例4: 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();
     }
 }
开发者ID:GlocalSound,项目名称:Transcranial,代码行数:11,代码来源:main.cpp

示例5: nextVideo

void nextVideo(){
	if( whichVideo < thumbs.size() ){
		
		vid.loadMovie(thumbs[whichVideo].video);
		vid.play();
		vid.update();
		vid.setPosition(thumbs[whichVideo].pos);
		
		if( mode == "play" ){
			vid.setSpeed(0.25);
		}
		
		whichVideo++;
		framecounter = 0;
	}else{
		std::exit(0);
	}
}
开发者ID:Giladx,项目名称:autoMovie,代码行数:18,代码来源:testApp.cpp

示例6: mouseReleased

//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){
	if(mode == "full" && bDown){
		thumbs[selected].pos = ofMap(x, 0, ofGetWidth(), 0, 0.9999, true);
		thumbs[selected].savePos();
		fullVid.setPosition(thumbs[selected].pos);
		fullVid.update();
		fullVid.setPaused(false);		
		fullVid.play();
		timer = ofGetElapsedTimef() + NUM_SECS;		
	}
	
	if( mode == "move" ){
		if( bDown ){
			reorganizeThumbs();
		}
	}
	bDown = false;
}
开发者ID:Giladx,项目名称:autoMovie,代码行数:19,代码来源:testApp.cpp

示例7: mouseDragged

//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
	if(mode == "full" && bDown){
		thumbs[selected].pos = ofMap(x, 0, ofGetWidth(), 0, 0.9999, true);
		fullVid.setPosition(thumbs[selected].pos);
		fullVid.update();		
	}
	else if( mode == "move" && bDown ){

		for(int i = 0; i < thumbs.size(); i++){
			ofRectangle tr = thumbs[i].r;
			if( tr.inside(x,y) ){
				placedIndex = i;
				cout << "placedIndex " << placedIndex <<endl;
			}
		}

	}
}
开发者ID:Giladx,项目名称:autoMovie,代码行数:19,代码来源:testApp.cpp

示例8: update

//--------------------------------------------------------------
void ofApp::update(){
  video.update();
}
开发者ID:atmarksharp,项目名称:VideoFrameExporter,代码行数:4,代码来源:ofApp.cpp

示例9: update

 void update(){
     ofSetWindowTitle(ofToString(ofGetFrameRate()));
     player.update();
 }
开发者ID:ReallyRad,项目名称:WaterColor,代码行数:4,代码来源:main.cpp


注:本文中的ofVideoPlayer::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。