From 16c4ee609e470792d0bf2e14e56c9eaf85548713 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Fri, 15 Jul 2022 12:52:08 +1200 Subject: [PATCH] Add GA402 anime-matrix packet unit test --- asusctl/examples/anime-diag-png.rs | 10 +- asusctl/examples/anime-diag.rs | 4 +- rog-anime/src/data.rs | 2 +- rog-anime/src/diagonal.rs | 290 ++++++++++++++++++- rog-anime/src/image.rs | 257 ++++++++++++++-- rog-anime/test/ga402-diagonal-fullbright.png | Bin 0 -> 7755 bytes rog-anime/test/ga402-diagonal.png | Bin 670 -> 7678 bytes 7 files changed, 526 insertions(+), 37 deletions(-) create mode 100644 rog-anime/test/ga402-diagonal-fullbright.png diff --git a/asusctl/examples/anime-diag-png.rs b/asusctl/examples/anime-diag-png.rs index cdc0962e..25c617a7 100644 --- a/asusctl/examples/anime-diag-png.rs +++ b/asusctl/examples/anime-diag-png.rs @@ -1,6 +1,6 @@ use std::{env, error::Error, path::Path, process::exit}; -use rog_anime::{usb::get_anime_type, AnimeDiagonal}; +use rog_anime::{usb::get_anime_type, AnimeDiagonal, AnimeType}; use rog_dbus::RogDbusClientBlocking; fn main() -> Result<(), Box> { @@ -13,8 +13,12 @@ fn main() -> Result<(), Box> { exit(-1); } - let matrix = - AnimeDiagonal::from_png(Path::new(&args[1]), None, args[2].parse::().unwrap())?; + let matrix = AnimeDiagonal::from_png( + Path::new(&args[1]), + None, + args[2].parse::().unwrap(), + AnimeType::GA401, + )?; let anime_type = get_anime_type()?; diff --git a/asusctl/examples/anime-diag.rs b/asusctl/examples/anime-diag.rs index c3817447..9874b1bc 100644 --- a/asusctl/examples/anime-diag.rs +++ b/asusctl/examples/anime-diag.rs @@ -1,6 +1,6 @@ use std::{thread::sleep, time::Duration}; -use rog_anime::{usb::get_anime_type, AnimeDiagonal}; +use rog_anime::{usb::get_anime_type, AnimeDiagonal, AnimeType}; use rog_dbus::RogDbusClientBlocking; // In usable data: @@ -12,7 +12,7 @@ fn main() { let (client, _) = RogDbusClientBlocking::new().unwrap(); for step in (2..50).rev() { - let mut matrix = AnimeDiagonal::new(None); + let mut matrix = AnimeDiagonal::new(AnimeType::GA401, None); for c in (0..60).into_iter().step_by(step) { for i in matrix.get_mut().iter_mut() { i[c] = 50; diff --git a/rog-anime/src/data.rs b/rog-anime/src/data.rs index 9fd26212..acda75b9 100644 --- a/rog-anime/src/data.rs +++ b/rog-anime/src/data.rs @@ -33,7 +33,7 @@ pub struct AnimePowerStates { } #[cfg_attr(feature = "dbus", derive(Type))] -#[derive(Debug, Copy, Clone, Deserialize, Serialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)] pub enum AnimeType { GA401, GA402, diff --git a/rog-anime/src/diagonal.rs b/rog-anime/src/diagonal.rs index fd457b9d..e89aeb40 100644 --- a/rog-anime/src/diagonal.rs +++ b/rog-anime/src/diagonal.rs @@ -25,7 +25,8 @@ impl AnimeDiagonal { fn get_row(&self, x: usize, y: usize, len: usize) -> Vec { let mut buf = Vec::with_capacity(len); for i in 0..len { - let val = self.1[self.0.height() - y - i - 1][x + i]; + let y = self.0.height() - y - i - 1; + let val = self.1[y][x + i]; buf.push(val); } buf @@ -92,7 +93,9 @@ impl AnimeDiagonal { + (::from(px.two()) / 3) as f32 + (::from(px.three()) / 3) as f32 }; - matrix.1[y][x] = (v * bright) as u8; + if y < matrix.1.len() && x < matrix.1[y].len() { + matrix.1[y][x] = (v * bright) as u8; + } } } } @@ -140,7 +143,7 @@ impl AnimeDiagonal { buf[102..=134].copy_from_slice(&self.get_row(1, 1, 33)); buf[137..=169].copy_from_slice(&self.get_row(2, 1, 33)); buf[170..=202].copy_from_slice(&self.get_row(2, 0, 33)); - buf[204..=236].copy_from_slice(&self.get_row(3, 0, 33)); + buf[204..=236].copy_from_slice(&self.get_row(3, 0, 33)); // This and above cause overflow? buf[237..=268].copy_from_slice(&self.get_row(4, 0, 32)); buf[270..=301].copy_from_slice(&self.get_row(5, 0, 32)); buf[302..=332].copy_from_slice(&self.get_row(6, 0, 31)); @@ -377,4 +380,285 @@ mod tests { assert_eq!(pkt[0], pkt0_check); assert_eq!(pkt[1], pkt1_check); } + + #[test] + fn ga402_diagonal_packet_check() { + let pkt0_check = [ + 0x5e, 0xc0, 0x2, 0x1, 0x0, 0x73, 0x2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0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x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + ]; + + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("test/ga402-diagonal.png"); + + let matrix = AnimeDiagonal::from_png(&path, None, 255.0, AnimeType::GA402).unwrap(); + let data = matrix.into_data_buffer(crate::AnimeType::GA402); + let pkt = AnimePacketType::from(data); + + assert_eq!(pkt[0], pkt0_check); + assert_eq!(pkt[1], pkt1_check); + assert_eq!(pkt[2], pkt2_check); + } + + #[test] + #[ignore = "Needs the packets verified with capture"] + fn ga402_diagonal_fullbright_packet_check() { + let pkt0_check = [ + 0x5e, 0xc0, 0x2, 0x1, 0x0, 0x73, 0x2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x68, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x67, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0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ff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + ]; + let pkt1_check = [ + 0x5e, 0xc0, 0x2, 0x74, 0x2, 0x73, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + ]; + let pkt2_check = [ + 0x5e, 0xc0, 0x2, 0xe7, 0x4, 0x73, 0x2, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0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0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + ]; + + let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + path.push("test/ga402-diagonal-fullbright.png"); + + let matrix = AnimeDiagonal::from_png(&path, None, 255.0, AnimeType::GA402).unwrap(); + let data = matrix.into_data_buffer(crate::AnimeType::GA402); + let pkt = AnimePacketType::from(data); + + assert_eq!(pkt[0], pkt0_check); + assert_eq!(pkt[1], pkt1_check); + assert_eq!(pkt[2], pkt2_check); + } } diff --git a/rog-anime/src/image.rs b/rog-anime/src/image.rs index 10fd2983..3aa8fa31 100644 --- a/rog-anime/src/image.rs +++ b/rog-anime/src/image.rs @@ -104,10 +104,11 @@ impl AnimeImage { /// ` + 0.5`, where the LED count is first/longest row. /// /// For GA401 this is `26.8 / (33 + 0.5) = 0.8` + /// For GA402 this is `27.3 / (35 + 0.5) = 0.77` fn scale_x(anime_type: AnimeType) -> f32 { match anime_type { AnimeType::GA401 => 0.8, - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => 0.77, } } @@ -117,10 +118,11 @@ impl AnimeImage { /// ` + 1.0`, where the LED count is first/longest row. /// /// For GA401 this is `16.5 / (54.0 + 1.0) = 0.3` + /// For GA402 this is `17.0 / (61.0 + 1.0) = 0.274` fn scale_y(anime_type: AnimeType) -> f32 { match anime_type { AnimeType::GA401 => 0.3, - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => 0.274, } } @@ -140,7 +142,12 @@ impl AnimeImage { } // The GA402 has different number of rows with consistent length and // row lengths and may need new offset formula - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => { + if y <= 11 { + return 0; + } + (y + 1) / 2 - 5 + } } } @@ -156,24 +163,29 @@ impl AnimeImage { } 36 - (y + 1) / 2 } - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => { + if y <= 11 { + return 34; + } + 39 - y / 2 + } } } - /// Physical display width + /// Physical display width by count of LED fn phys_width(anime_type: AnimeType) -> f32 { match anime_type { // 33.0 = Longest row LED count (physical) plus half-pixel offset AnimeType::GA401 => (33.0 + 0.5) * Self::scale_x(anime_type), - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => (35.0 + 0.5) * Self::scale_x(anime_type), } } - /// Height in LED count of longest column (physical) + /// Height in LED count of longest column (physical count) fn height(anime_type: AnimeType) -> u32 { match anime_type { AnimeType::GA401 => 55, - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => 61, } } @@ -183,7 +195,7 @@ impl AnimeImage { // 54.0 = End column LED count (physical) plus one dead pixel AnimeType::GA401 => (54.0 + 1.0) * Self::scale_y(anime_type), // GA402 may not have dead pixels and require only the physical LED count - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => (61.0 + 1.0) * Self::scale_y(anime_type), } } @@ -195,7 +207,12 @@ impl AnimeImage { 1 | 3 => 35, // Some rows are padded _ => 36 - y / 2, }, - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), + AnimeType::GA402 => match y { + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 => 34, // CONFIRMED CORRECT + // 0|1 | 2 | 4 | 6 | 8 | 10 => 34, // These are the top rows of consistent length + //1|3|5|7|9|11 => 35, // Padding.. may be needed for odd rows, but unsure + _ => 39 - y / 2, // This may not be correct (37 is a guess based on photo) + }, } } @@ -207,22 +224,19 @@ impl AnimeImage { /// and will contain their resulting brightness. #[inline] pub fn generate_image_positioning(anime_type: AnimeType) -> Vec> { - match anime_type { - AnimeType::GA401 => (0..AnimeImage::height(anime_type)) - .flat_map(|y| { - // For each row (Y) get actual length - (0..AnimeImage::pitch(anime_type, y)).map(move |l| { - if l < AnimeImage::width(anime_type, y) { - let x = AnimeImage::first_x(anime_type, y) + l; - Some(Led::new(x as f32 - 0.5 * (y % 2) as f32, y as f32)) - } else { - None // dead/non-existant pixels to the left - } - }) + (0..AnimeImage::height(anime_type)) + .flat_map(|y| { + // For each row (Y) get actual length + (0..AnimeImage::pitch(anime_type, y)).map(move |l| { + if l < AnimeImage::width(anime_type, y) { + let x = AnimeImage::first_x(anime_type, y) + l; + Some(Led::new(x as f32 - 0.5 * (y % 2) as f32, y as f32)) + } else { + None // dead/non-existant pixels to the left + } }) - .collect(), - AnimeType::GA402 => todo!("GA402R series AnimeImage positions not completed"), - } + }) + .collect() } /// Called after setting new angle, position, or scale to refresh the image @@ -269,6 +283,48 @@ impl AnimeImage { sum /= count as f32; led.set_bright((sum * self.bright * alpha) as u8); } + + // TODO: remove when sorted out + // if self.anime_type == AnimeType::GA402 { + self.edge_outline(); + // } + } + + fn edge_outline(&mut self) { + // Janky shit here just to try help align images + let mut last_x = 0.0; + let mut last_y = 0.0; + let mut last_was_led = false; + let mut ends = Vec::new(); + for (idx, led) in self.led_pos.iter_mut().enumerate() { + if let Some(led) = led { + // Capture the starting LED + if led.x() - last_x != 1.0 { + led.set_bright(255); + last_x = led.x(); + } else { + // top and bottom + if led.y() == 0.0 || led.y() >= AnimeImage::height(self.anime_type) as f32 - 1.0 + { + led.set_bright(255); + } + last_x += 1.0; + } + if led.y() - last_y == 1.0 { + ends.push(idx); + last_y = led.y(); + } + last_was_led = true; + } else if last_was_led { + //ends.push(idx); + last_was_led = false; + } + } + for end in ends { + if let Some(led) = self.led_pos[end - 1].as_mut() { + led.set_bright(255); + } + } } /// Put the render window in place on the image @@ -416,16 +472,18 @@ impl From<&AnimeImage> for AnimeDataBuffer { .map(|l| if let Some(l) = l { l.bright() } else { 0 }) .collect(); let mut v = Vec::with_capacity(leds.anime_type.data_length()); - v.push(0); + if leds.anime_type == AnimeType::GA401 { + v.push(0); + } v.append(&mut l); - v.append(&mut vec![0u8; 9]); + v.append(&mut vec![0u8; leds.anime_type.data_length() - v.len()]); AnimeDataBuffer::from_vec(leds.anime_type, v) } } #[cfg(test)] mod tests { - use crate::image::*; + use crate::{image::*, AnimePacketType}; #[test] fn led_positions() { @@ -515,4 +573,147 @@ mod tests { assert_eq!(AnimeImage::pitch(a, 13), 30); assert_eq!(AnimeImage::pitch(a, 14), 29); } + + #[test] + #[ignore = "Needs the packets verified with capture"] + fn ga402_image_edge_packet_check() { + let pkt0_check = [ + 0x5e, 0xc0, 0x2, 0x1, 0x0, 0x73, 0x2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0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 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + ]; + + let mut matrix = AnimeImage::new( + Vec2::new(1.0, 1.0), + 0.0, + Vec2::default(), + 0.0, + vec![Pixel::default(); 1000], + 100, + AnimeType::GA402, + ); + matrix.edge_outline(); + let data = AnimeDataBuffer::from(&matrix); + let pkt = AnimePacketType::from(data); + + assert_eq!(pkt[0], pkt0_check); + assert_eq!(pkt[1], pkt1_check); + assert_eq!(pkt[2], pkt2_check); + } } diff --git a/rog-anime/test/ga402-diagonal-fullbright.png b/rog-anime/test/ga402-diagonal-fullbright.png new file mode 100644 index 0000000000000000000000000000000000000000..2a3c0af852f359609f9bfea8b8b2cb96e1c72aaf GIT binary patch literal 7755 zcmeHMc{r4N`yc5X$x>2^N@GZt#_YySCd=3}vK0z7D}$NQ%-FXS3N6HBjgX2WQ7Lj1 z*@`To5IQO%k!;!WKGf;d^?R@Dcb)5f&->SzYo3|sxxe@Q`QG>EzVGMzd}kspEsP~r z%dG~1KoX`V2G+p08F1`a1$=-`H;1Z%Kw=O5ZSDEiWFN36m&0Is(7}8^Pdb?H%VdB+ zzMXkVEblG5IAM#t4Gt^Hbz`0=h<-{P20v*$-fl8|;QXP37U*{VwG)-fR^j>?Tc0k@ zPfILT?TzguZur2uB{P$gbw(REIQGG1_o!<7z`{(<_@u+^n1Ai;ESQ($xswwzH6^zg zOb9an=$)8aSFSuXH~DaO?6}pT@#($NWo+9(!zAed653f>Fh8Z|Pl6vh=$iGuytv?L z*VyDjG5q7^`Mh_i=^CZ<#eA~~^Sk!k-P;AV0je`Bp{fv`N}Tjt!UpnT%F%SYo;`y% z1Z!h%^i7PR?3*XE+hHOLM<3U8?6}pVCz{@zJA=6txSBhs73@b)nvoOim{{!J8*<_8 zwi`atb1cL3%+d1c1Lcir9aYy)TNXdR+*ABH6~R6tR_?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