-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
307 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "images" | ||
version = "0.1.0" | ||
authors = ["Michał Bałabanow <[email protected]>"] | ||
license = "GPL-3.0-only" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
clap = { version = "4.4", features = ["derive"] } | ||
image = "0.25" | ||
log = "0.4" | ||
omni-led-api = { path = "../../omni-led-api" } | ||
shlex = "1.3" | ||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Images | ||
|
||
Images application reads images from disk and converts them to a black and white image before | ||
sending it to OmniLED server. | ||
|
||
## Running | ||
|
||
``` | ||
images --address <ADDRESS> [--image '<NAME> <PATH> [--format <FORMAT>] [--threshold <THRESHOLD>]']... | ||
``` | ||
|
||
Images expects two arguments | ||
|
||
- Required: | ||
- `a`/`address` - server address | ||
- Optional: | ||
- `-i`/`--image` - loaded image options. | ||
This option can be specified multiple times and it a **single string** as it's argument with | ||
image load options: | ||
- `<NAME>` - This name will be used as variable name in user scripts. | ||
_This is a positional argument and shall always be specified as a first argument._ | ||
- `<PATH>` - Path to an image file on disk. | ||
_This is a positional argument and shall always be specified as a second argument._ | ||
- `-f`/`--format` - Image extension used as a hint for loading images when path doesn't | ||
contain an extension. | ||
- `-t`/`--threshold` - Threshold that will be used when converting the image to black and | ||
white. Values with brightness lower than threshold will be black, and above or equal to | ||
threshold will be white. | ||
Range: [0, 255]. | ||
Default: 128 | ||
|
||
### Example | ||
|
||
In this example `images` will load 2 images from disk. | ||
|
||
```lua | ||
load_app { | ||
path = get_default_path('images'), | ||
args = { | ||
'--address', SERVER.Address, | ||
'--image', 'MyImage /path/to/my_image --format jpg --threshold 77', | ||
'--image', 'MyOtherImage "C:\\path\\to\\other image.png" --threshold 159', | ||
} | ||
} | ||
``` | ||
|
||
## Images Events | ||
|
||
Images applications sends a single event with all loaded images with names specified as program | ||
arguments. | ||
|
||
`IMAGES`: table | ||
|
||
- `<NAME_1>`: `OLEDImage`, | ||
... | ||
- `<NAME_N>`: `OLEDImage`, |
Oops, something went wrong.