Drawing on an Image (calling FBO from a thread, possible?)

Hi, i want to draw blobs on a black image. (image can be cvImage or ofImage)
i know one method is to use FBO, is there any other way?


Could you be a little more specific? If you just want to draw over top of an image, then just do layered drawing, i.e. draw the image, then draw the blobs. Otherwise, you can use an FBO to draw everything into, or even just an ofTexture instance:

void app::draw() {  
   // do some drawing  
   tex.loadScreenData(0, 0, ofGetWidth(), ofGetHeight());  

I’m not sure if that answers your question though,

Thanks for the reply.
what i intend to do is draw blobs at particular x,y coordinates which will be obtained using a server.
these blobs need to be put/drawn on an image on which further image processing will be performed (like contour detection, tracking etc)

i know how to do this using ofxFBOTexture (have to stick to OF 0062, thus no ofFBO), but surprisingly the FBO does not draw anything when i use it in my project. and i tried it in another example and FBO works flawlessly.
That is is why i am trying to find methods to do the same.
Any help would be appreciated.

Could you post up the code that you’re using? The FBO should work pretty seamlessly, so there might be something mis-configured in how you’re setting up the FBO or the drawing.

void ofxIPImage::getNewFrame(unsigned char* newFrame)  
	ofImage test;  
	test.setFromPixels((unsigned char*)fbo.getPixels(),320,240,OF_IMAGE_COLOR_ALPHA);  
	memcpy((void*)newFrame,test.getPixels(),320 * 240 * depth * sizeof(unsigned char));  

i call this function to get the new frame.
using the ofImage is just a test, i have tried to pass the pixels to newFrame using the fbo.getPixels() method also.
Also when if i save the ofImage i get an empty file. which means nothings is being drawn into it.

i added glCheckFramebufferStatus to find out where the FBO was breaking.
It turns out till the time fbo.allocate is called, everything works fine. but when the getNewFrame() is called check status returns zero, i.e when i start fbo.begin()

Is this because i am calling getNewFrame() from inside a thread?