1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
use clap::Parser;
#[derive(Debug, Parser)]
pub struct Args {
/// The host to pwn "host:port"
pub host: String,
/// Image paths
pub image: Vec<String>,
/// Draw width [default: screen width]
#[arg(short, long, value_name = "PIXELS")]
pub width: Option<u32>,
/// Draw height [default: screen height]
#[arg(short = 'q', long, value_name = "PIXELS")]
pub height: Option<u32>,
/// Draw X offset
#[arg(short, long, value_name = "PIXELS", default_value = "0")]
pub x: u32,
/// Draw Y offset
#[arg(short, long, value_name = "PIXELS", default_value = "0")]
pub y: u32,
/// Number of concurrent threads [default: CPUs]
#[arg(short, long, value_name = "THREADS")]
pub count: Option<u32>,
/// Frames per second with multiple images
#[arg(short = 'r', long, value_name = "FPS", default_value = "1")]
pub fps: f32,
/// Disable automatic detection of supported features
#[arg(short, long)]
pub feature_detection: bool,
/// Enable usage of offset command
#[arg(short, long)]
pub offset: bool,
/// Enable usage of `PX X Y gg` command
#[arg(short, long)]
pub gray: bool,
/// Enable usage of alpha command for pixels with alpha > 0 and < 255
#[arg(short, long)]
pub alpha: bool,
/// Bind address to use for communication
#[arg(long)]
pub bind_addr: Option<String>,
/// Disable shuffling of draw commands (recommended for video streams)
#[arg(short, long)]
pub shuffle: bool,
/// Number of workers for turning stream images into pixel commands
#[arg(long, default_value = "5")]
pub workers: u32,
/// Resize images rather than cropping them
#[arg(long)]
pub resize: bool,
/// input is a video (only works with one input file, and requires ffmpeg in $PATH)
#[arg(short, long)]
pub video: bool,
/// Use the PBxxyyrgba format with le encoding
#[arg(long)]
pub le_rgba: bool,
/// Run continuously (ignore EOF if using stdin)
#[arg(long)]
pub continuous: bool,
/// Test green screen for camera. This will print the first pixel of the camera
#[arg(long)]
pub test_green_screen: bool,
/// Green screen color, obtain by running `pixelbomber --test-green-screen /dev/video0`
#[arg(long)]
pub green_screen: Option<String>,
/// This pixelbomber is only a manager instead of a pixel fluter, listens at the specified port
#[arg(long)]
pub serve_manager: Option<u16>,
/// Listen to the manager at HOST for commands
#[arg(long)]
pub listen_manager: bool,
}
pub fn parse() -> Args {
Args::parse()
}