reformat with max width

This commit is contained in:
Vinzenz Schroeter 2024-05-11 23:28:08 +02:00
parent 0a3f400e92
commit 362426c758
13 changed files with 225 additions and 122 deletions

View file

@ -3,8 +3,10 @@ use std::time::Duration;
use clap::Parser;
use servicepoint2::{BitVec, CompressionCode, Connection, PIXEL_HEIGHT, PIXEL_WIDTH, PixelGrid};
use servicepoint2::Command::BitmapLinearAnd;
use servicepoint2::{
BitVec, CompressionCode, Connection, PixelGrid, PIXEL_HEIGHT, PIXEL_WIDTH,
};
#[derive(Parser, Debug)]
struct Cli {
@ -21,7 +23,8 @@ fn main() {
let connection = Connection::open(cli.destination).unwrap();
let sleep_duration = Duration::from_millis(cli.time / PIXEL_WIDTH as u64);
let mut enabled_pixels = PixelGrid::new(PIXEL_WIDTH as usize, PIXEL_HEIGHT as usize);
let mut enabled_pixels =
PixelGrid::new(PIXEL_WIDTH as usize, PIXEL_HEIGHT as usize);
enabled_pixels.fill(true);
for x_offset in 0..PIXEL_WIDTH as usize {
@ -33,7 +36,9 @@ fn main() {
let pixel_data: Vec<u8> = enabled_pixels.clone().into();
let bit_vec = BitVec::load(&*pixel_data);
connection.send(BitmapLinearAnd(0, bit_vec, CompressionCode::Gz)).unwrap();
connection
.send(BitmapLinearAnd(0, bit_vec, CompressionCode::Gz))
.unwrap();
thread::sleep(sleep_duration);
}
}