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

Video grabber crop to image issue

$
0
0

@Gallo wrote:

Hello,

i have an issue with the ofPixels::cropTo()
When declaring ofImage, croping and drawing in ofApp::draw() function, it works

 ofImage scanLine;
 scanLine.allocate(1, 720, OF_IMAGE_COLOR);
 video.getPixels().cropTo(scanLine, scanPosition, 0, 1, 720);
 fbo.begin();
 scanLine.draw(colNumber, 0, 1, 720);
 fbo.end();

when trying to split the code like so, it doesn't work anymore...
Am I doing something wrong ?

//.h
ofImage scanLine;

// setup()
scanLine.allocate(1, 720, OF_IMAGE_COLOR);

// update()
video.update();
video.getPixels().cropTo(scanLine, scanPosition, 0, 1, 720);

// draw()
    fbo.begin();
    scanLine.draw(colNumber, 0, 1, 720);
    fbo.end();

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Latest Images

Trending Articles



Latest Images