mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-13 16:23:30 -07:00
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:
+10
-8
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user