ofFbo get color

#1

hi, everyone;

i am sending data by dmx from a video as below:

std::vector<uint8_t> artnetData;

r_sky1 = static_cast<unsigned char>(ofMap(player.getPixels().getColor(offXart, offYart).r, 0, 255, mapIn, mapOut);
artnetData.push_back(r_sky1);

ofxArtnetMessage m;
m.setData(artnetData);    
artnet.sendArtnet(m);

but, as I am passing this video inside a cascade of fbos and shaders, would be perfect to getColor from the final Fbo. as I saw, there isnt anything like fbo.getColor(x,y);, but is there any other way i am missing to do it?

thank you!

#2

Hi,
I would copy the pixels to an ofPixels object, like this:

ofPixels p;
fbo.getTexture().readToPixels(p);

And then you can use the getColor(x,y) function :slight_smile:

1 Like
#3

thank you!! working finee