本文整理汇总了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;
}
}
示例2: update
//--------------------------------------------------------------
void testApp::update(){
vid.update();
if( mode == "full" ){
fullVid.update();
if( fullVid.isPlaying() && ofGetElapsedTimef() > timer ){
fullVid.setPaused(true);
}
}
}
示例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;
}
}
示例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();
}
}
示例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);
}
}
示例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;
}
示例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;
}
}
}
}
示例8: update
//--------------------------------------------------------------
void ofApp::update(){
video.update();
}
示例9: update
void update(){
ofSetWindowTitle(ofToString(ofGetFrameRate()));
player.update();
}