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


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

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


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

示例1: draw

        void draw(){
            wc.begin();
            if(!switchVideo){
                wc.setUniformTexture("colorMap", img.getTexture(),  1);
                wc.setUniformTexture("heightMap",gray.getTexture(), 2);
            }
            else{
                wc.setUniformTexture("colorMap", player.getTexture(), 1);
                fboDepth.begin();
                player.draw(0,0);
                fboDepth.end();
                wc.setUniformTexture("heightMap",fboDepth.getDepthTexture(),2);
            }
            wc.setUniform1f("time", ofGetElapsedTimef()*time);
            wc.setUniform1f("gradientStep", stepGradient);
            wc.setUniform1f("advectStep",   advectStep);
            wc.setUniform1f("flipHeightMap",flipHeightMap);
            wc.setUniform4f("advectMatrix",advectMatrix->w,advectMatrix->x,advectMatrix->y,advectMatrix->z);

            fbo.draw(0,0);

            wc.end();
            img.draw(0,0,img.getWidth()/4,img.getHeight()/4);
            player.draw(img.getWidth()/4,0,img.getWidth()/4,img.getHeight()/4);
            gui.draw();
        }
开发者ID:ReallyRad,项目名称:WaterColor,代码行数:26,代码来源:main.cpp

示例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();
			}		

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

示例3: draw

//--------------------------------------------------------------
void ofApp::draw(){
  ofPushMatrix();
  ofScale(vsr,vsr);
  video.draw(0,0);
  ofPopMatrix();
}
开发者ID:atmarksharp,项目名称:VideoFrameExporter,代码行数:7,代码来源:ofApp.cpp

示例4: draw

//--------------------------------------------------------------
void ofApp::draw(){
//-------------------------
    
    int  limit = contourFinder.nBlobs;
    int maxArea = 0;
    int elementNum = -1;
    ofColor yellow(255, 255, 171);
    ofColor white(255, 1);
    
//-------------------------
    
    // loop pages, back and forth
    if (_i < 0) {
        _i = 14;
    }
    if (_i > 14){
        _i = 0;
    }
    
    switch (_i) {
    
        case 0: // blink eyes - ellipse, fill black when clicked DONE
            img1.draw(30, 60);
            ofSetColor(255, 180, 0, alpha);
            ofDrawCircle(265, 225, 45);
            ofDrawCircle(440, 230, 45);
            if (ofGetMousePressed() == true){
                alpha = 0;
            } else {
                alpha = 255;
            }
            music1.setPaused(false);
            ofSetColor(255);
            font.drawString("Omphalotus wasnt like all the other mushrooms.", 40, 40);
            font.drawString("He had eyes. ...and could walk.", 40, 55);
            break;
            
        case 1: // cap sensor DONE
            img2.draw(30, 60);
            music2.setPaused(false);
            bSendSerialMessage = true;
            if (nBytesRead != 1){
                ofSetColor(220);
            } else {
                ofSetColor(0);
            }
            font.drawString("...and talk. He glowed in the dark too.", 40, 40);
            break;
            
        case 2: // earth video speed, mouse move DONE
            bSendSerialMessage = false;
            ofClearAlpha();
            img3.draw(30, 60);
            mov1.draw(215, 480);
            mov1.setSpeed(vidSpeed);
            music3.setPaused(false);
            font.drawString("He didnt know what to do with the days, he felt lost and lonely.", 40, 40);
            font.drawString("Like the world was too big, and he was too small.", 40, 55);
            break;
            
        case 3: // ketchup DONE
            ofEnableAlphaBlending();
            bSendSerialMessage = false;
            img4.draw(30, 60);
            music4.setPaused(false);
            font.drawString("He thought of turning himself in to the omelet factory,", 40, 40);
            font.drawString("but even then, theyd turn him away because he is too poisonous.", 40, 55);
            ofSetColor(250, 58, 20);
            line.draw();
            ofSetColor(255);
            break;
            
        case 4:
            bSendSerialMessage = false;
            ofClearAlpha();
            img5.draw(30, 60);
            music5.setPaused(false);
            font.drawString("It was late one evening he squished sadly past a slime mold on a rock.", 40, 40);
            break;
            
        case 5: // stars in eyes
            bSendSerialMessage = false;
            ofClearAlpha();
            img6.draw(30, 60);
            music6.setPaused(false);
            font.drawString("Hello, what a lovely evening!", 40, 40);
            font.drawString("...squeaked the slime mold.", 40, 55);
            break;
            
        case 6: // drops in eyes
            bSendSerialMessage = false;
            ofClearAlpha();
            img8.draw(30, 60);
            music7.setPaused(false);
            font.drawString("Hello.", 40, 40);
            font.drawString("...replied Omphalotus gloomily.", 40, 55);
            break;
            
        case 7: // more stars
//.........这里部分代码省略.........
开发者ID:jessherzog,项目名称:storyEclipse,代码行数:101,代码来源:ofApp.cpp

示例5: setTexture

//--------------------------------------------------------------
void VisualRingBuffer::setTexture(ofVideoPlayer player){
    begin();
    player.draw(0, 0, width, height);
    end();
}
开发者ID:JoshuaBatty,项目名称:ofxPlaymodes,代码行数:6,代码来源:VisualRingBuffer.cpp

示例6: draw

    void draw() {
        ofBackground(0);
        
        ofPushMatrix();
        ofPushStyle();
        
        float scaleFactor = ofGetHeight() / (float) MAX(1, video.getHeight());
        ofScale(scaleFactor, scaleFactor);
        ofTranslate(0, -verticalOffset);
        
        float totalStability = ofClamp(ofMap(smoothedMotionValue, motionMin, motionMax, 0, stability), 0, 1);
        
        int n = contours.size();
        
        for(int i = 0; i < n; i++) {
            cv::Rect cur = contours.getBoundingRect(i);
            float w = cur.width, h = cur.height;
            float sx = cur.x, sy = cur.y;
            
            buffer.begin();
            ofDisableBlendMode();
            
            // clear buffer area
            ofClear(0, 0);
            
            // draw filled shape (could blur here)
            ofPushMatrix();
            ofSetColor(255);
            ofFill();
            ofBeginShape();
            vector<cv::Point>& vertices = contours.getContour(i);
            for(int j = 0; j < vertices.size(); j++) {
                ofVertex(vertices[j].x, vertices[j].y);
            }
            ofEndShape();
            ofPopMatrix();
            
            // draw body image
            ofEnableBlendMode(OF_BLENDMODE_MULTIPLY);
            ofSetColor(255);
            video.getTexture().drawSubsection(sx, sy, w, h, sx, sy);
            buffer.end();
            
            ofEnableBlendMode(OF_BLENDMODE_ALPHA);
            ofPushMatrix();
            
            ofVec2f center = toOf(contours.getCenter(i));
            ofVec2f offset = center - bodyCenter;
            float orientation = atan2f(offset.y, offset.x);
            float spread = totalStability * spreadAmplitude;
            ofVec2f position = bodyCenter + offset + ofVec2f(offset.x, 0) * spread;
            
            float id = orientation; //contours.getLabel(i) % 3;
            
            float baseRotation = rotationRate * ofGetElapsedTimef() + id;
            float rotation = ofLerp(sin(baseRotation), ofSignedNoise(baseRotation), rotationNoise);
            rotation *= rotationAmplitude * totalStability;
            
            float baseScale = scaleRate * ofGetElapsedTimef() + id;
            float scale = 1 + scaleAmplitude * ofLerp(sin(baseScale), ofSignedNoise(baseScale), scaleNoise) * totalStability;
            
            ofPushStyle();
            ofSetColor(tintRed, tintGreen, tintBlue);
            ofTranslate(position);
            for(int j = 0; j < repetitionSteps; j++) {
                ofPushMatrix();
                float rotationAmount = ofMap(j, -1, repetitionSteps, 0, rotation);
                ofRotate(rotationAmount);
//                ofVec3f axis(0, 0, 1);
//                ofRotate(rotationAmount, axis.x, axis.y, axis.z);
                float curScale = ofMap(j, -1, repetitionSteps, 1, scale);
                ofScale(curScale, curScale, curScale);
                buffer.getTextureReference().drawSubsection(-w / 2, -h / 2, 0, w, h, sx, sy);
                ofPopMatrix();
            }
            ofPopStyle();
            
            if(debug) {
                ofDrawBitmapStringHighlight(ofToString(contours.getLabel(i)), 0, 0);
            }
            ofPopMatrix();
        }
            
        ofPopStyle();
        ofPopMatrix();
        
        ofEnableAlphaBlending();
        
        if(debug) {
            ofPushStyle();
            ofSetColor(255);
            ofNoFill();
            ofSetLineWidth(2);
            ofDrawRectangle(0, 0, video.getWidth(), video.getHeight());
            video.draw(0, 0);
            ofPopStyle();
            
            ofPushStyle();
            ofEnableBlendMode(OF_BLENDMODE_ADD);
            
//.........这里部分代码省略.........
开发者ID:GlocalSound,项目名称:Transcranial,代码行数:101,代码来源:main.cpp


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