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

Reading frames from fbo to deque

$
0
0

@da_re wrote:

Hi everyone,

I try to create a slit scan effect, but instead of reading a video file I want to use an fbo. I try to store the frames in a deque, to have access to older frames later. I want to store always 150 frames at a time. The problem is that there is just one frame in the deque. Does somebody know how to store more? There is nothing like “.isFrameNew()” for fbos.

Would be glad about some help.
Best, David

header:

//...
ofFbo fbo1;
void drawfbo1();
deque<ofPixels> frames;
int N;
//...

update:

//...
int N = 150;
fbo1.begin();
    ofClear(255, 255, 255, 0);
    drawfbo1();
fbo1.end();
ofPixels pixels;
fbo1.readToPixels(pixels);
//ofLog(OF_LOG_NOTICE, "pixels " + ofToString(pixels.size()));
frames.push_front(pixels);
//ofLog(OF_LOG_NOTICE, "frames " + ofToString(frames.size()));
if (frames.size() > N){
   frames.pop_back();
}
//...

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles