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

Sampling color from multiple layered videos

$
0
0

@blue wrote:

Hello,

I’m brand new to OF and am trying to learn by porting a processing sketch. I have multiple videos w/ alpha channels running on top of each other. My goal is to sample color data from multiple points of the overall image while the videos are layered.

Right now, using getColor I can sample color from one of the videos, but instead of sampling from each video individually i’d like to sample whatever shows up on top while the app is running. Could I create some sort of overall class to grab the pixels from instead of the individual videos? Thanks

ofVideoPlayer video, video1, video2;

void ofApp::setup(){
    video.load("black_background.mov");
    video1.load("lightness_Converted.mov");
    video2.load("gray.mov");
}

//--------------------------------------------------------------
void ofApp::update(){
   video.update();
   video1.update();
   video2.update();
    
    ofPixels pix = video1.getPixels();
    ofColor c = pix.getColor(mouseX, mouseY);
    float brightness = c.getBrightness();
    cout << "Brightness: " << brightness << endl;
    
}

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles