-
Notifications
You must be signed in to change notification settings - Fork 4
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
ui: display: display a background image on all screens #35
base: main
Are you sure you want to change the base?
Conversation
While the display itself is 16bpp the emulated framebuffer device is not. Make sure the demo_mode and png-ification code match this expectation. Signed-off-by: Leonard Göhrs <[email protected]>
This makes the screen a bit less boring while still requiring minimal implementation effort. The background image is included in the tacd binary as uncompressed bitmap. This has a couple of benefits and drawbacks: + Loading the background can never fail + The background is available instantly + We do not have to keep the decompressed background in RAM, as it is backed by the binary file. - The tacd binary size increases by 240 * 240 * 3 = 172800 bytes - The build.rs becomes more complex Signed-off-by: Leonard Göhrs <[email protected]>
I'd favor a solution where we don't embed the image inside the binary. This takes >100KiB of space, while we don't gain any system memory since the decoded picture needs to be available for framebuffer display anyway. I'd rather ship an asset and decode the picture during startup. |
let xres = fb.var_screen_info.xres; | ||
let yres = fb.var_screen_info.yres; | ||
let res = (xres as usize) * (yres as usize); | ||
assert!(fb.var_screen_info.bits_per_pixel == 32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a potential panic please return an appropriate error in this case.
@@ -144,7 +153,7 @@ impl DrawTarget for DisplayExclusive { | |||
where | |||
I: IntoIterator<Item = Pixel<Self::Color>>, | |||
{ | |||
let bpp = self.0.var_screen_info.bits_per_pixel / 8; | |||
assert!(self.0.var_screen_info.bits_per_pixel == 32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a potential panic please return an appropriate error in this case.
I've coverted the PR back to a draft because (in addition to the technical discussion above) not everyone liked the way the backgrounds look on screen, as they can make text harder to read. |
The LXA TAC display looks quite boring due to the
tacd
only displaying black and white text.As a first step to fixing that we can display a background image behind all screens.
The background image is included in the
tacd
binary as uncompressed bitmap. This has a couple of benefits but also some drawbacks:build.rs
becomes more complexTODO: