mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Diagonal data structure
This commit is contained in:
@@ -4,19 +4,37 @@ use rog_dbus::AuraDbusClient;
|
|||||||
// In usable data:
|
// In usable data:
|
||||||
// Top row start at 1, ends at 32
|
// Top row start at 1, ends at 32
|
||||||
|
|
||||||
|
// 74w x 36h diagonal used by the windows app
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let (client, _) = AuraDbusClient::new().unwrap();
|
let (client, _) = AuraDbusClient::new().unwrap();
|
||||||
let mut matrix = AniMeGrid::new();
|
let mut matrix = AniMeGrid::new();
|
||||||
{
|
let tmp = matrix.get_mut();
|
||||||
let tmp = matrix.get_mut();
|
|
||||||
for row in tmp.iter_mut() {
|
|
||||||
row[row.len() - 33] = 0xff;
|
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,10 +79,8 @@ pub struct AniMeImage {
|
|||||||
pub help: bool,
|
pub help: bool,
|
||||||
#[options(meta = "", help = "full path to the png to display")]
|
#[options(meta = "", help = "full path to the png to display")]
|
||||||
pub path: String,
|
pub path: String,
|
||||||
#[options(meta = "", default = "0.0", help = "x scale 0.0-1.0")]
|
#[options(meta = "", default = "1.0", help = "scale 1.0 == normal")]
|
||||||
pub x_scale: f32,
|
pub scale: f32,
|
||||||
#[options(meta = "", default = "0.0", help = "y scale 0.0-1.0")]
|
|
||||||
pub y_scale: f32,
|
|
||||||
#[options(meta = "", default = "0.0", help = "x position (float)")]
|
#[options(meta = "", default = "0.0", help = "x position (float)")]
|
||||||
pub x_pos: f32,
|
pub x_pos: f32,
|
||||||
#[options(meta = "", default = "0.0", help = "y position (float)")]
|
#[options(meta = "", default = "0.0", help = "y position (float)")]
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
let matrix = AnimeImage::from_png(
|
let matrix = AnimeImage::from_png(
|
||||||
Path::new(&image.path),
|
Path::new(&image.path),
|
||||||
Vec2::new(image.x_scale, image.y_scale),
|
Vec2::new(image.scale, image.scale),
|
||||||
image.angle,
|
image.angle,
|
||||||
Vec2::new(image.x_pos, image.y_pos),
|
Vec2::new(image.x_pos, image.y_pos),
|
||||||
image.bright,
|
image.bright,
|
||||||
|
|||||||
@@ -11,5 +11,8 @@ pub use anime_grid::*;
|
|||||||
mod anime_image;
|
mod anime_image;
|
||||||
pub use anime_image::*;
|
pub use anime_image::*;
|
||||||
|
|
||||||
|
mod anime_diagonal;
|
||||||
|
pub use anime_diagonal::*;
|
||||||
|
|
||||||
/// Base errors that are possible
|
/// Base errors that are possible
|
||||||
pub mod error;
|
pub mod error;
|
||||||
Reference in New Issue
Block a user