diff --git a/asusctl/examples/animatrix-grid.rs b/asusctl/examples/animatrix-grid.rs index 1773d088..2e42c1cc 100644 --- a/asusctl/examples/animatrix-grid.rs +++ b/asusctl/examples/animatrix-grid.rs @@ -4,19 +4,37 @@ use rog_dbus::AuraDbusClient; // In usable data: // Top row start at 1, ends at 32 +// 74w x 36h diagonal used by the windows app + fn main() { let (client, _) = AuraDbusClient::new().unwrap(); let mut matrix = AniMeGrid::new(); - { - let tmp = matrix.get_mut(); - for row in tmp.iter_mut() { - row[row.len() - 33] = 0xff; + let tmp = matrix.get_mut(); - row[row.len() - 22] = 0xff; + let mut i = 0; + for (y, row) in tmp.iter_mut().enumerate() { + if y % 2 == 0 && i + 1 != row.len() -1 { + i += 1; + dbg!(i); + } + row[row.len() - i] = 0x22; + if i > 5{ + row[row.len() - i + 5] = 0x22; + } + if i > 10 { + row[row.len() - i + 10] = 0x22; + } - row[row.len() - 11] = 0xff; + if i > 15 { + row[row.len() - i + 15] = 0x22; + } - row[row.len() - 1] = 0xff; + if i > 20 { + row[row.len() - i + 20] = 0x22; + } + + if i > 25 { + row[row.len() - i + 25] = 0x22; } } diff --git a/asusctl/src/anime_cli.rs b/asusctl/src/anime_cli.rs index 92b0dd18..c4fb7600 100644 --- a/asusctl/src/anime_cli.rs +++ b/asusctl/src/anime_cli.rs @@ -79,10 +79,8 @@ pub struct AniMeImage { pub help: bool, #[options(meta = "", help = "full path to the png to display")] pub path: String, - #[options(meta = "", default = "0.0", help = "x scale 0.0-1.0")] - pub x_scale: f32, - #[options(meta = "", default = "0.0", help = "y scale 0.0-1.0")] - pub y_scale: f32, + #[options(meta = "", default = "1.0", help = "scale 1.0 == normal")] + pub scale: f32, #[options(meta = "", default = "0.0", help = "x position (float)")] pub x_pos: f32, #[options(meta = "", default = "0.0", help = "y position (float)")] diff --git a/asusctl/src/main.rs b/asusctl/src/main.rs index 657bfbe4..02230303 100644 --- a/asusctl/src/main.rs +++ b/asusctl/src/main.rs @@ -180,7 +180,7 @@ fn main() -> Result<(), Box> { let matrix = AnimeImage::from_png( Path::new(&image.path), - Vec2::new(image.x_scale, image.y_scale), + Vec2::new(image.scale, image.scale), image.angle, Vec2::new(image.x_pos, image.y_pos), image.bright, diff --git a/rog-anime/src/lib.rs b/rog-anime/src/lib.rs index 0d9a86a0..ce876c23 100644 --- a/rog-anime/src/lib.rs +++ b/rog-anime/src/lib.rs @@ -11,5 +11,8 @@ pub use anime_grid::*; mod anime_image; pub use anime_image::*; +mod anime_diagonal; +pub use anime_diagonal::*; + /// Base errors that are possible pub mod error; \ No newline at end of file