Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a boolean to cinder::gl::Fbo::readPixels8u and cinder::gl::Fbo::r… #2218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

willemkempers
Copy link

…eadPixels32f to enable or disable the alpha channel in the returned Surface8u or Surface32f.

…eadPixels32f to enable or disable the alpha channel in the returned Surface8u or Surface32f
@willemkempers
Copy link
Author

The primary reason I would call readPixels is because I have to output the data in the FBO to some physical device - generally LED's. As LED's do not have alpha channels, I would have to remove the alpha channel from the Surface before being able to output to my devices. The cinder::SurfaceT constructor already provides a boolean to enable or disable the alpha channel, hence why I think it makes sense to add the option to the cinder::gl::Fbo::readPixels methods as well.

@willemkempers
Copy link
Author

willemkempers commented Jan 25, 2021

This doesn't seem to work on a Raspberry Pi 4 running Raspbian GNU/Linux 10 (buster) unfortunately. Using GL_RGBA works fine but using GL_RGB results in garbage. I've found these threads on the topic: https://www.raspberrypi.org/forums/viewtopic.php?t=109474 and https://www.raspberrypi.org/forums/viewtopic.php?f=68&t=101903. I can't find an official guide or statement which mentions why GL_RGB isn't available on the RPi, let me know if there is one.

I'd personally still really like to see something along these lines, it could be really useful in combination with LibOLA for example. I'd love to see the readPixels method be expanded to be able to return a single ChannelT, rather than a SurfaceT. Would be very useful for outputting to monochrome LEDs.

If I find anything I'll update this thread!

@richardeakin richardeakin added the gl label Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants