本文整理汇总了C++中ofImage::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ ofImage::draw方法的具体用法?C++ ofImage::draw怎么用?C++ ofImage::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofImage
的用法示例。
在下文中一共展示了ofImage::draw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(255);
img.draw(0,0);
img2.draw(0,200);
img3.draw(0,400);
ofSetColor(255,0,0);
ofDrawBitmapString(ofToString(ofGetFrameRate()),10,10);
}
示例2: draw
void BPMTapper::draw(int x, int y, int r, ofImage &image) {
int d = r * 2;
glColor3f(1, 0, 0);
ofEnableAlphaBlending();
image.draw(x, y, d * sin1, d * sin1); x += d;
image.draw(x, y, d * sin2, d * sin2); x += d;
image.draw(x, y, d * sin4, d * sin4); x += d;
image.draw(x, y, d * sin8, d * sin8); x += d;
image.draw(x, y, d * sin16, d * sin16); x += d;
}
示例3: draw
//--------------------------------------------------------------
void ofApp::draw(){
ofSetColor(255,255,255,255);
imageCrystal.draw(0,0); // draw image at (0,0)
ofSetColor(128,128,128,128);
imageCrystal.draw(50,50, imageCrystal.width/3, imageCrystal.height/3); // draw image at (50,50) at 1.5 scale
ofSetColor(255,255 , 0,128);
imageCrystal.draw(80,100, imageCrystal.width/2, imageCrystal.height/1.5); // draw image at (50,50) at 1/2 scale
ofSetColor(0,255 ,255,128);
imageCrystal.draw(point); // draw image at (50,50) at 1/2 scale
}
示例4: draw
void ofApp::draw()
{
// draw image
ofSetColor(255);
img1.draw(0, 0);
synth.draw(w, 0);
// draw text
stringstream ss;
ss << "drag and drop a image file to this window \n";
ss << "file name: " + cur_file+ " \n";
ss << "avarage: " + ofToString(avarage_pixel_value);
ofSetColor(0);
ofDrawBitmapString(ss.str(), ofPoint(20, 20));
}
示例5: draw
void draw(){
// sampleImg.draw(0, 0, 450, 450);
cannyImg.draw(0, 0, 450, 450);
cannyInvertImg.draw(450, 0, 450, 450);
}
示例6: 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();
}
示例7: update
void update()
{
fbo.begin();
ofClear(0, 0, 0, 0);
testImage.draw(0, 0);
fbo.end();
}
示例8: draw
//--------------------------------------------------------------
void ofApp::draw(){
//Set up gray background
ofBackground( 128, 128, 128 );
//Draw image with top left corner x=100, y=50 pixels
image.draw( 100, 50 );
}
示例9: draw
//--------------------------------------------------------------
void testApp::draw(){
img.draw(imgPos.x, imgPos.y, w,h);
img.setAnchorPercent(0.5, 0.5);
}
示例10: show_merge
void ofApp::show_merge(int play_cnt) {
memcpy(tmp, recorded + image_size * play_cnt, image_size);
memcpy(merged, show, image_size);
bgs(tmp);
image_merge(merged, tmp, 0);
img.setFromPixels(merged, width, height, OF_IMAGE_COLOR);
img.draw(width, height);
}
示例11: drawTitle
void RunningDraw::drawTitle(ofImage title){
Settings* settings = Settings::getInstance();
float title_x= settings->getWidth() / 2 - title.getWidth() * SCALE/2;
float title_y = settings->getTitleY();
title.draw(title_x, title_y, title.getWidth() * SCALE, title.getHeight() * SCALE);
}
示例12: draw
void draw() {
ofBackgroundGradient(64, 0);
if(reflect || sreflect)
env.draw(0,0,env.getWidth()/8,env.getHeight()/8);
if(sreflect)
env1.draw(env.getWidth()/8,0,env1.getWidth()/8,env1.getHeight()/8);
ofEnableDepthTest();
cam.begin();
shader.begin();
if(sreflect){
// shader.setUniform3f("CameraPos",cam.getGlobalPosition().x, cam.getGlobalPosition().y, cam.getGlobalPosition().z);
// shader.setUniformMatrix4f("ModelWorld4x4",cam.getGlobalTransformMatrix());
shader.setUniform3f("CameraPos",cam.getPosition().x, cam.getPosition().y, cam.getPosition().z);
shader.setUniformMatrix4f("ModelWorld4x4",cam.getModelViewMatrix());//getLocalTransformMatrix());
shader.setUniformTexture("frontMap", env,1);
shader.setUniformTexture("backMap", env1,2);
}
if(reflect){
shader.setUniformTexture("colorMap",env1,1);
shader.setUniformTexture("envMap", env,2);
}else if(sreflect==false){
shader.setUniformTexture("texture", img, 1);
shader.setUniform1f("time", ofGetElapsedTimef());
}
if(cube)
ofDrawBox(200);
else {
ofTranslate(0,-150,0);
ofRotateX(-90);
ofRotateY(-90);
ofRotateZ(45);
model.drawFaces();
}
shader.end();
cam.end();
ofDisableDepthTest();
ofDrawBitmapString(ofToString((int) ofGetFrameRate()), 10, 20);
}
示例13: draw
void draw(){
string msg = "";
vector<string> p = deep.getPrediction();
for(int i = 0; i < p.size(); i++){
msg += ofToString(i)+") "+p[i]+"\n";
}
img.draw(0,0);
ofDrawBitmapStringHighlight(msg,10,10);
}
示例14: draw
void testApp::draw() {
ofBackground(0);
cameraImage.draw(0, 0);
ofSetColor(255);
ofDrawBitmapString(ofToString((int) timer.getFrameRate()), wrapper.cameraWidth, wrapper.cameraHeight+20);
}
示例15: divider
void ofxImageTS::divider(ofImage image,float divW, float divH, float width, float height){
ofFbo buffer;
buffer.begin();
for(int i = 0; i < divW; i++) {
for(int j = 0; j < divH; j++) {
image.draw((width/divW) * i,(height/divH) * j,width/divW,height/divH);
}
}
buffer.end();
}