mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-13 16:23:30 -07:00
Framebuffer update (#60)
* first pass at changing the UI color based on state * adding flag to qmdl metadata for when hueristic is triggered * update style for web page to match UI and have color alert on heuristic trigger * add test analyzer * rename example_analyzer to test_analyzer * refactor ui update to not depend on server * refactor to pass around color instead of display state for framebuffer channel * add debug feature flag for test analyzer * remove warning status from qmdl manifest * dont keep has warning around
This commit is contained in:
@@ -11,6 +11,7 @@ struct Dimensions {
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Color565 {
|
||||
Red = 0b1111100000000000,
|
||||
Green = 0b0000011111100000,
|
||||
@@ -22,6 +23,12 @@ pub enum Color565 {
|
||||
Pink = 0b1111010010011111,
|
||||
}
|
||||
|
||||
pub enum DisplayState {
|
||||
Recording,
|
||||
Paused,
|
||||
WarningDetected,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Framebuffer<'a> {
|
||||
dimensions: Dimensions,
|
||||
@@ -36,6 +43,14 @@ 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