diff --git a/breakwater-core/Cargo.toml b/breakwater-core/Cargo.toml index 0d73d3f..665e770 100644 --- a/breakwater-core/Cargo.toml +++ b/breakwater-core/Cargo.toml @@ -13,3 +13,4 @@ tokio.workspace = true [features] alpha = [] +binary-commands = [] diff --git a/breakwater-core/src/lib.rs b/breakwater-core/src/lib.rs index 3e9976a..bcb6e59 100644 --- a/breakwater-core/src/lib.rs +++ b/breakwater-core/src/lib.rs @@ -11,13 +11,18 @@ PX x y rrggbb: Color the pixel (x,y) with the given hexadecimal color rrggbb {} PX 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 PX x y: Get the color value of the pixel (x,y) -SIZE: Get the size of the drawing surface, e.g. `SIZE 1920 1080` +{}SIZE: Get the size of the drawing surface, e.g. `SIZE 1920 1080` OFFSET 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 ", if cfg!(feature = "alpha") { "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)" } else { "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" +}, +if cfg!(feature = "binary-commands") { + "PBxxyyrgba: Binary version of the PX command. x and y are little-endian 16 bit coordinates, r, g, b and are a byte each. There is *no* newline after the command.\n" +} else { + "" } ).as_bytes(); diff --git a/breakwater-parser/Cargo.toml b/breakwater-parser/Cargo.toml index e300282..35ba5d6 100644 --- a/breakwater-parser/Cargo.toml +++ b/breakwater-parser/Cargo.toml @@ -23,3 +23,4 @@ pixelbomber.workspace = true [features] alpha = [] +binary-commands = [] diff --git a/breakwater/Cargo.toml b/breakwater/Cargo.toml index 557369b..810ea92 100644 --- a/breakwater/Cargo.toml +++ b/breakwater/Cargo.toml @@ -37,6 +37,8 @@ vncserver = { workspace = true, optional = true } rstest.workspace = true [features] -default = ["vnc"] +default = ["vnc", "binary-commands"] + vnc = ["dep:vncserver"] -alpha = [] +alpha = ["breakwater-core/alpha", "breakwater-parser/alpha"] +binary-commands = ["breakwater-core/binary-commands", "breakwater-parser/binary-commands"]