i’m trying to draw somes simples rectangles inside an ofxCvGrayscaleImage ,
the image is already loaded with a jpeg , but i want to add a white rectangle over it inside the ofxCvGrayscaleImage
I’ve tried the doc , but can’t understand the workflow before being able to do it
// load image
ofImage img;
img.load("kenSentMe.gif");
// create an fbo that matches the image size
ofFbo fbo;
fbo.allocate(img.getWidth(), img.getHeight(), GL_RGB);
fbo.begin();
ofClear(255, 255, 255, 0);
// draw the image on the fbo
img.draw(0, 0);
// decorate your image with stuff
ofSetColor(255, 0, 0);
ofDrawRectangle(10, 10, 40, 40);
fbo.end();
// transfer the fbo back to the image
fbo.readToPixels(img.getPixels());
img.update();