Compare commits
2 commits
43c53555d9
...
cc29d5226b
Author | SHA1 | Date | |
---|---|---|---|
cc29d5226b | |||
7020006e89 |
1 changed files with 8 additions and 1 deletions
|
@ -5,6 +5,7 @@ use std::{
|
|||
io::stdout,
|
||||
net::{Ipv4Addr, SocketAddr, UdpSocket},
|
||||
num::ParseIntError,
|
||||
path::PathBuf,
|
||||
str::FromStr,
|
||||
thread::sleep,
|
||||
time::Duration,
|
||||
|
@ -81,10 +82,11 @@ impl From<Color> for Rgb<u8> {
|
|||
enum Action {
|
||||
Rainbow,
|
||||
Solid { color: Color },
|
||||
Image { path: PathBuf },
|
||||
Clear,
|
||||
}
|
||||
|
||||
fn get_frame(layout: Layout, frame: u32) -> RgbImage {
|
||||
fn bling(layout: Layout, frame: u32) -> RgbImage {
|
||||
#![allow(
|
||||
clippy::cast_precision_loss,
|
||||
clippy::cast_lossless,
|
||||
|
@ -190,6 +192,11 @@ fn main() -> anyhow::Result<()> {
|
|||
let frame_num: u32 = rand::thread_rng().gen();
|
||||
send_frame(&socket, layout, frame_num, &image)?;
|
||||
}
|
||||
Action::Image { path } => {
|
||||
let image = RgbImage::new(layout.width_px(), layout.height_px());
|
||||
let frame_num: u32 = rand::thread_rng().gen();
|
||||
send_frame(&socket, layout, frame_num, &image)?;
|
||||
}
|
||||
Action::Rainbow => {
|
||||
print!("{}", termion::clear::All);
|
||||
|
||||
|
|
Loading…
Reference in a new issue