Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofxOMXCamera: Make a copy of .getTextureReference()

$
0
0

@nathan wrote:

Im using the ofxOMXCamera addon and running the “example-texture-mode” example on a RPI.
I want to make a copy of the texture and store it and im running into problems.

The code is quite simple, ive tested it using videoGrabber on a desktop and it works but the OMXCamera addons clearly works differently. here is the gist of it:

void ofApp::draw()
{
        if (videoGrabber.isTextureEnabled())
        {
                videoGrabber.getTextureReference().copyTo(bufferCopy);
                videoTexture.loadData(bufferCopy, GL_RGBA, GL_UNSIGNED_BYTE);
                videoTexture.draw(45, 75, 640, 430);
        }
}

I have defined and allocated buffers , but the error I get is the following:
“error: ‘class ofTexture’ has no member named ‘copyTo’ videoGrabber.getTextureReference().copyTo(bufferCopy);”

and

" error: no matching function for call to ‘ofTexture::loadData(ofBufferObject&, int, int)’
videoTexture.loadData(bufferCopy, GL_RGBA, GL_UNSIGNED_BYTE); "

Could someone point in the right direction here. I want to make a copy of the texture (texture to texture) using the OMXCamera addon running on a RPI

Thank you

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles