mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-18 10:00:14 +01:00
minor tweaks to examples
This commit is contained in:
parent
20ea1354be
commit
52080c0ad0
|
@ -2,8 +2,8 @@
|
|||
|
||||
use clap::Parser;
|
||||
|
||||
use servicepoint::Command::BitmapLinearWin;
|
||||
use servicepoint::*;
|
||||
use servicepoint::Command::BitmapLinearWin;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
struct Cli {
|
||||
|
@ -19,13 +19,12 @@ fn main() {
|
|||
let mut pixels = PixelGrid::max_sized();
|
||||
pixels.fill(true);
|
||||
|
||||
connection
|
||||
.send(BitmapLinearWin(
|
||||
let command = BitmapLinearWin(
|
||||
Origin::new(0, 0),
|
||||
pixels,
|
||||
CompressionCode::Uncompressed,
|
||||
))
|
||||
.expect("send failed");
|
||||
);
|
||||
connection.send(command).expect("send failed");
|
||||
|
||||
let max_brightness = usize::from(u8::from(Brightness::MAX));
|
||||
let mut brightnesses = BrightnessGrid::new(TILE_WIDTH, TILE_HEIGHT);
|
||||
|
|
|
@ -23,13 +23,12 @@ fn main() {
|
|||
let mut field = make_random_field(cli.probability);
|
||||
|
||||
loop {
|
||||
connection
|
||||
.send(Command::BitmapLinearWin(
|
||||
let command = Command::BitmapLinearWin(
|
||||
Origin::new(0, 0),
|
||||
field.clone(),
|
||||
CompressionCode::Lzma,
|
||||
))
|
||||
.expect("could not send");
|
||||
);
|
||||
connection.send(command).expect("could not send");
|
||||
thread::sleep(FRAME_PACING);
|
||||
field = iteration(field);
|
||||
}
|
||||
|
|
|
@ -23,13 +23,13 @@ fn main() {
|
|||
for y in 0..PIXEL_HEIGHT {
|
||||
pixels.set((y + x_offset) % PIXEL_WIDTH, y, true);
|
||||
}
|
||||
connection
|
||||
.send(Command::BitmapLinearWin(
|
||||
|
||||
let command = Command::BitmapLinearWin(
|
||||
Origin::new(0, 0),
|
||||
pixels.clone(),
|
||||
CompressionCode::Lzma,
|
||||
))
|
||||
.unwrap();
|
||||
);
|
||||
connection.send(command).expect("send failed");
|
||||
thread::sleep(FRAME_PACING);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue