-
Notifications
You must be signed in to change notification settings - Fork 137
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
Update to work with latest e-g and tinybmp #196
base: main
Are you sure you want to change the base?
Conversation
5a3a120
to
69b6399
Compare
I've had some success on the 3.7in (which doesn't have the best support) without any modifications but yes the color is inverted so I worked around that by just inverting the BMP. Just wondering if this change makes working with these slightly easier (no color_converted() in the draw call?) use embedded_graphics::pixelcolor::BinaryColor;
use embedded_graphics::{prelude::*, image::Image};
// ...
let mut display = Display3in7::default();
const SPLASH: &[u8] = include_bytes!("../splashnewbw.bmp");
let splash_bmp = tinybmp::Bmp::<BinaryColor>::from_slice(SPLASH).unwrap();
Image::new(&splash_bmp, Point::zero()).draw(&mut display.color_converted()).unwrap_or_else(|_| error!("failed to render splash screen")); |
Managed to draw some text with your PR for a epd7in5_v2::Display7in5, this currently doesn't work in master or version |
I see this PR is a draft? Is there something missing for completion? |
69b6399
to
4901c1a
Compare
Yeah, there were some arguable changes related to color inversion, so I was waiting to get any feedback. I've dropped them for now, and users are encouraged to use I'll mark this as ready for review now. |
Would you mind going a bit more into detail on what could go wrong? |
However, in the current implementation, it's the opposite: Lines 297 to 304 in 1244f03
I guess it's because in most cases when rendering text, people expect to see white on black for LED panels and black on white for EPD. Displaying images becomes tricky now since you need to invert colours to display them properly. Inverting all the colours to be "On=White, Off=Black" is a breaking change and it must be discussed thoroughly. |
tinybmp and other crates require Color to implement all Rgb transformations
4901c1a
to
4d891fa
Compare
I had some issues with rendering simple black & white images with tinybmp crate, and had to apply these patches to make it work. Let me know if it makes sense.