-
Notifications
You must be signed in to change notification settings - Fork 41
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
Building library for 1 bpp Display #22
Comments
Hello, the library only support some bpp for most drawing functions but you can work around this limitation with a custom backend, it does the job but will be likely slow and overkill, i don't know your device and never did anything on monochrome devices but you may look at the Game Boy Advance backend for a simple backend example with an initially non-supported device : https://github.com/grz0zrg/fbg/tree/master/custom_backend/gba It does 24 or 32 bpp internally but convert to the GBA display format on draw so that all library functions can be used without changes. The way to adapt it to a 1 bpp device would be to allocate a 1 bpp buffer then rewrite the draw function, something like this (untested and assuming you can copy the buffer to the device) :
and to test the backend compile this with fbgraphics.c and fbg_test.c :
maybe you can also just use the hardware memory directly if available If you don't want to convert from high bpp to low bpp you may have to rewrite the drawing functions or use the simpler ones that support this. If the question is for a 1 bpp Linux framebuffer then there should be minor changes to the setup function in https://github.com/grz0zrg/fbg/tree/master/custom_backend/fbdev to make it open the framebuffer with this format and a conversion step in |
Hello!
I'm trying to use this library for my project with a monochrome oled. I know that your library only supports 8 bpp framebuffer devices, but maybe you have any tips to me, how can I use your library for my project? Thank you.
Best regards,
Michael
The text was updated successfully, but these errors were encountered: