breakwater_core/
lib.rs

1use const_format::formatcp;
2
3pub mod framebuffer;
4pub mod test_helpers;
5
6pub const HELP_TEXT: &[u8] = formatcp!("\
7Pixelflut server powered by breakwater https://github.com/sbernauer/breakwater
8Available commands:
9HELP: Show this help
10PX x y rrggbb: Color the pixel (x,y) with the given hexadecimal color rrggbb
11{}
12PX x y gg: Color the pixel (x,y) with the hexadecimal color gggggg. Basically this is the same as the other commands, but is a more efficient way of filling white, black or gray areas
13PX x y: Get the color value of the pixel (x,y)
14{}SIZE: Get the size of the drawing surface, e.g. `SIZE 1920 1080`
15OFFSET x y: Apply offset (x,y) to all further pixel draws on this connection. This can e.g. be used to pre-calculate an image/animation and simply use the OFFSET command to move it around the screen without the need to re-calculate it
16",
17if cfg!(feature = "alpha") {
18    "PX x y rrggbbaa: Color the pixel (x,y) with the given hexadecimal color rrggbb and a transparency of aa, where ff means draw normally on top of the existing pixel and 00 means fully transparent (no change at all)"
19} else {
20    "PX x y rrggbbaa: Color the pixel (x,y) with the given hexadecimal color rrggbb. The alpha part is discarded for performance reasons, as breakwater was compiled without the alpha feature"
21},
22if cfg!(feature = "binary-commands") {
23    "PBxxyyrgba: Binary version of the PX command. x and y are little-endian 16 bit coordinates, r, g, b and a are a byte each. There is *no* newline after the command.\n"
24} else {
25    ""
26}
27).as_bytes();
28
29pub const ALT_HELP_TEXT: &[u8] = b"Stop spamming HELP!\n";
30pub const CONNECTION_DENIED_TEXT: &[u8] = b"Connection denied as connection limit is reached";