本文整理汇总了C++中ofImage::saveImage方法的典型用法代码示例。如果您正苦于以下问题:C++ ofImage::saveImage方法的具体用法?C++ ofImage::saveImage怎么用?C++ ofImage::saveImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofImage
的用法示例。
在下文中一共展示了ofImage::saveImage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
//--------------------------------------------------------------
void fluid001::keyPressed (int key){
switch(key) {
#ifdef USE_GUI
case ' ':
gui.toggleDraw();
glClear(GL_COLOR_BUFFER_BIT);
break;
#endif
case 'f':
ofToggleFullscreen();
break;
case 'r':
fluidSolver.reset();
break;
case 's':
static char fileNameStr[255];
sprintf(fileNameStr, "output_%0.4i.png", ofGetFrameNum());
static ofImage imgScreen;
imgScreen.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
printf("Saving file: %s\n", fileNameStr);
imgScreen.saveImage(fileNameStr);
break;
}
}
示例2: save_image
void ofApp::save_image(ofImage img) {
char buf[1];
sprintf(buf, "%d", rec_cnt);
string file_name = "/users/yui/desktop/yellow_imgs/teacher/";
file_name += buf;
file_name += ".png";
img.saveImage(file_name);
}
示例3: ofToString
void scanner_faces::saveScanImg2HaarViz(ofImage &imgScan, int nPers) {
string nmImgScan = "images/scan_2_haarViz/";
string nmImgScan1 = ofToString( getenv("HOME") ) + "/fotosHaarViz/";
string chorraco = ofToString(ofGetYear())+ofToString(ofGetMonth(),2,'0')+ofToString(ofGetDay(),2,'0')+
ofToString(ofGetHours(),2,'0')+ofToString(ofGetMinutes(),2,'0');
chorraco += "_cara_"+ofToString(nPers,3,'0')+".png";
nmImgScan += chorraco;
ofLogNotice("grabar:_"+nmImgScan);
imgScan.saveImage(nmImgScan);
nmImgScan1 += chorraco;
imgScan.saveImage(nmImgScan1);
snd_click.play();
}
示例4: makeThumb
void makeThumb(string vidPath, string thumb){
ofVideoPlayer tmp;
tmp.loadMovie(vidPath);
tmp.play();
tmp.setPosition(0.3);
ofImage img;
img.setFromPixels( tmp.getPixelsRef() );
img.resize(120, 120.0f * (img.getHeight() / img.getWidth()) );
img.saveImage(thumb);
}
示例5: saveScanImg
void scanner_faces::saveScanImg(ofImage &imgScan, int nPers, int nImg) {
string nmImgScan = "images/scan/";
nmImgScan += ofToString(ofGetYear())+ofToString(ofGetMonth(),2,'0')+ofToString(ofGetDay(),2,'0')+
ofToString(ofGetHours(),2,'0')+ofToString(ofGetMinutes(),2,'0');
nmImgScan += "_cara_"+ofToString(nPers,3,'0')+"_"+ofToString(nImg,2,'0')+".png";
ofLogNotice("grabar:_"+nmImgScan);
// redimensionar
imgScan.resize(WSCAN, HSCAN);
imgScan.saveImage(nmImgScan);
snd_click.play();
}
示例6: 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();
}
}
}
}
示例7: keyPressed
//--------------------------------------------------------------
void testApp::keyPressed (int key){
switch(key) {
case ' ':
gui.toggleDraw();
glClear(GL_COLOR_BUFFER_BIT);
break;
case 'f':
ofToggleFullscreen();
break;
case 'p':
static char fileNameStr[255];
sprintf(fileNameStr, "output_%0.4i.png", ofGetFrameNum());
static ofImage imgScreen;
imgScreen.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
printf("Saving file: %s\n", fileNameStr);
imgScreen.saveImage(fileNameStr);
break;
case 'q':
if (smurfFloor->getBPM() <= 295) {
// really quicken the beat
// In my case just got the griffin knob linked to this
smurfFloor->setBPM(smurfFloor->getBPM()+5);
}
break;
case 's':
if (smurfFloor->getBPM() > 5 ) {
// really slow down the beat
// In my case just got the griffin knob linked to this
smurfFloor->setBPM(smurfFloor->getBPM()-5);
}
break;
case 'a':
if (smurfFloor->getBPM() <= 299) {
// quicken the beat
// In my case just got the griffin knob linked to this
smurfFloor->setBPM(smurfFloor->getBPM()+1);
}
break;
case 'z':
if (smurfFloor->getBPM() > 1) {
// slow down the beat
// In my case just got the griffin knob linked to this
smurfFloor->setBPM(smurfFloor->getBPM()-1);
}
break;
case 'h': // help
smurfFloor->setVerbose(smurfFloor->isVerbose()?false:true);
break;
#ifdef TARGET_OS_MAC
case 'g': // gesture
smurfFloor->toggleGesture();
break;
#endif
case 'c': // gesture
smurfFloor->toggleConnectionMode();
break;
case 'w': // wave
if (smurfFloor->getWaveSpeed() > 1) {
smurfFloor->setWaveSpeed(smurfFloor->getWaveSpeed()-1);
}
break;
case 'x': // wave
if (smurfFloor->getWaveSpeed() <= 20) {
smurfFloor->setWaveSpeed(smurfFloor->getWaveSpeed()+1);
}
break;
}
}