Fix UI and add more logging (#61)

* add some more logging

* WIP attempt to fix async on update_ui

* fix async for update_ui
This commit is contained in:
Cooper Quintin
2024-10-03 13:32:59 -07:00
committed by GitHub
parent ca4f49b15f
commit c59fb7c013
2 changed files with 24 additions and 17 deletions
+10 -8
View File
@@ -29,6 +29,16 @@ pub enum DisplayState {
WarningDetected,
}
impl From<DisplayState> for Color565 {
fn from(state: DisplayState) -> Self {
match state {
DisplayState::Paused => Color565::White,
DisplayState::Recording => Color565::Green,
DisplayState::WarningDetected => Color565::Red,
}
}
}
#[derive(Copy, Clone)]
pub struct Framebuffer<'a> {
dimensions: Dimensions,
@@ -43,14 +53,6 @@ impl Framebuffer<'_>{
}
}
pub fn get_color_from_state(state: DisplayState) -> Color565 {
match state {
DisplayState::Paused => Color565::White,
DisplayState::Recording => Color565::Green,
DisplayState::WarningDetected => Color565::Red,
}
}
fn write(&mut self, img: DynamicImage) {
let mut width = img.width();
let mut height = img.height();