mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-18 18:10:14 +01:00
fix examples
This commit is contained in:
parent
b21040c1f3
commit
1fe7760ee2
|
@ -19,8 +19,8 @@ fn main() {
|
|||
for x_offset in 0..usize::MAX {
|
||||
pixels.fill(false);
|
||||
|
||||
for y in 0..PIXEL_HEIGHT as usize {
|
||||
pixels.set((y + x_offset) % PIXEL_WIDTH as usize, y, true);
|
||||
for y in 0..PIXEL_HEIGHT {
|
||||
pixels.set((y + x_offset) % PIXEL_WIDTH, y, true);
|
||||
}
|
||||
connection
|
||||
.send(
|
||||
|
|
|
@ -40,17 +40,17 @@ fn main() {
|
|||
// continuously update random windows to new random brightness
|
||||
loop {
|
||||
let min_size = 1;
|
||||
let x: u16 = rng.gen_range(0..TILE_WIDTH - min_size);
|
||||
let y: u16 = rng.gen_range(0..TILE_HEIGHT - min_size);
|
||||
let x = rng.gen_range(0..TILE_WIDTH - min_size);
|
||||
let y = rng.gen_range(0..TILE_HEIGHT - min_size);
|
||||
|
||||
let w: u16 = rng.gen_range(min_size..=TILE_WIDTH - x);
|
||||
let h: u16 = rng.gen_range(min_size..=TILE_HEIGHT - y);
|
||||
let w = rng.gen_range(min_size..=TILE_WIDTH - x);
|
||||
let h = rng.gen_range(min_size..=TILE_HEIGHT - y);
|
||||
|
||||
let origin = Origin(x, y);
|
||||
let mut luma = ByteGrid::new(w as usize, h as usize);
|
||||
let mut luma = ByteGrid::new(w, h);
|
||||
|
||||
for y in 0..h as usize {
|
||||
for x in 0..w as usize {
|
||||
for y in 0..h {
|
||||
for x in 0..w {
|
||||
luma.set(x, y, rng.gen());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,13 +24,12 @@ fn main() {
|
|||
|
||||
let connection = Connection::open(cli.destination).unwrap();
|
||||
|
||||
let mut enabled_pixels =
|
||||
PixelGrid::new(PIXEL_WIDTH as usize, PIXEL_HEIGHT as usize);
|
||||
let mut enabled_pixels = PixelGrid::new(PIXEL_WIDTH, PIXEL_HEIGHT);
|
||||
enabled_pixels.fill(true);
|
||||
|
||||
for x_offset in 0..PIXEL_WIDTH as usize {
|
||||
for y in 0..PIXEL_HEIGHT as usize {
|
||||
enabled_pixels.set(x_offset % PIXEL_WIDTH as usize, y, false);
|
||||
for x_offset in 0..PIXEL_WIDTH {
|
||||
for y in 0..PIXEL_HEIGHT {
|
||||
enabled_pixels.set(x_offset % PIXEL_WIDTH, y, false);
|
||||
}
|
||||
|
||||
// this works because the pixel grid has max size
|
||||
|
|
Loading…
Reference in a new issue