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


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

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


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

示例1: keyPressed

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
  ofLogVerbose() << "ON : key " << key;

  // [space]: toggle pause and resume
  if(key == 32){
    if(video.isPlaying()){
      bool paused = video.isPaused();

      const char* status = (!paused)? "[pause]": "[resume]";
      ofLogNotice() << "Video: " << status;

      video.setPaused(!paused);
    }else{
      ofLogNotice() << "Video: [play]";
      video.play();
    }
  // [e] or [s]: save frame
  }else if(key == 101 || key == 115){
    string path = currentDateWithCount() + ".png";
    ofPixels* pix = new ofPixels();

    video.setPaused(true);
    pix->setFromPixels(video.getPixels(), vw, vh, OF_IMAGE_COLOR);
    ofSaveImage(*pix, path, OF_IMAGE_QUALITY_MEDIUM);

    ofLogWarning() << "\nSaved frame to \"" << path << "\"" << endl;

  // left key: forward
  }else if(key == 356){
    vVector = 1.0;
    applyVideoMatrix();
  // right key: backward
  }else if(key == 358){
    vVector = -1.0;
    applyVideoMatrix();

  // [0]: very slow speed
  }else if(key == 48){
    vSpeed = 0.25;
    applyVideoMatrix();
  // [1]: normal speed
  }else if(key == 49){
    vSpeed = 1.0;
    applyVideoMatrix();
  // [2]: fast speed
  }else if(key == 50){
    vSpeed = 2.0;
    applyVideoMatrix();
  // [9]: slow speed
}else if(key == 57){
    vSpeed = 0.5;
    applyVideoMatrix();
  }
}
开发者ID:atmarksharp,项目名称:VideoFrameExporter,代码行数:55,代码来源:ofApp.cpp

示例2: update

void ofxOpticalFlowLK :: update ( ofVideoPlayer& source )
{
	update( source.getPixels(), source.width, source.height, OF_IMAGE_COLOR );	// assume colour image type.
}
开发者ID:MaxWorgan,项目名称:ofxOpticalFlowLK,代码行数:4,代码来源:ofxOpticalFlowLK.cpp

示例3: update

void TTimbre::update(ofVideoPlayer input){
	originalImage.setFromPixels(input.getPixels(), input.getWidth(),  input.getHeight(), OF_IMAGE_COLOR);
	internalUpdate();
}
开发者ID:paulobarcelos,项目名称:Timbre,代码行数:4,代码来源:TTimbre.cpp

示例4: pixelate

void ofxImageTS::pixelate(ofVideoPlayer video, int pixelRatio) {
    ofPixels R,G,B, copy;
    copy.allocate(video.getWidth(), video.getHeight(), OF_PIXELS_RGB);
    copy = video.getPixels();
    pixelate(copy,pixelRatio);
}
开发者ID:essteban,项目名称:ofxImageTS,代码行数:6,代码来源:ofxImageTS.cpp

示例5: update

void ofxOpticalFlowFarneback::update(ofVideoPlayer& source) {
    update(source.getPixels().getData(), source.getWidth(), source.getHeight(), OF_IMAGE_COLOR); // assume colour image type.
}
开发者ID:ofZach,项目名称:funkyForms,代码行数:3,代码来源:ofxOpticalFlowFarneback.cpp


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