mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Trial of skipping ever n pixel in width
This commit is contained in:
@@ -4,7 +4,8 @@ use tinybmp::{Bmp, Pixel};
|
|||||||
fn main() {
|
fn main() {
|
||||||
let mut writer = AniMeDbusWriter::new().unwrap();
|
let mut writer = AniMeDbusWriter::new().unwrap();
|
||||||
|
|
||||||
let bmp = Bmp::from_slice(include_bytes!("test.bmp")).expect("Failed to parse BMP image");
|
let bmp =
|
||||||
|
Bmp::from_slice(include_bytes!("non-skewed_r.bmp")).expect("Failed to parse BMP image");
|
||||||
let pixels: Vec<Pixel> = bmp.into_iter().collect();
|
let pixels: Vec<Pixel> = bmp.into_iter().collect();
|
||||||
//assert_eq!(pixels.len(), 56 * 56);
|
//assert_eq!(pixels.len(), 56 * 56);
|
||||||
|
|
||||||
@@ -13,8 +14,10 @@ fn main() {
|
|||||||
|
|
||||||
// Aligned left
|
// Aligned left
|
||||||
for px in pixels {
|
for px in pixels {
|
||||||
if (px.x as usize) < WIDTH {
|
if (px.x as usize / 2) < WIDTH && (px.y as usize) < HEIGHT {
|
||||||
matrix.get_mut()[px.y as usize][px.x as usize] = px.color as u8;
|
if px.x % 2 == 0 {
|
||||||
|
matrix.get_mut()[px.y as usize][px.x as usize / 2] = px.color as u8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
aura/examples/non-skewed.bmp
Normal file
BIN
aura/examples/non-skewed.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
aura/examples/non-skewed_r.bmp
Normal file
BIN
aura/examples/non-skewed_r.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
aura/examples/test2.bmp
Normal file
BIN
aura/examples/test2.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
@@ -69,7 +69,7 @@ impl AniMeMatrix {
|
|||||||
let index = row.len() - prog_row_len;
|
let index = row.len() - prog_row_len;
|
||||||
|
|
||||||
if count % 2 == 0 {
|
if count % 2 == 0 {
|
||||||
print!(" ");
|
print!(" ");
|
||||||
}
|
}
|
||||||
for (i, x) in row.iter().enumerate() {
|
for (i, x) in row.iter().enumerate() {
|
||||||
if i >= index {
|
if i >= index {
|
||||||
|
|||||||
Reference in New Issue
Block a user