RGBMatrixEmulator 0.11.4__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- RGBMatrixEmulator/__init__.py +5 -0
- RGBMatrixEmulator/adapters/__init__.py +68 -0
- RGBMatrixEmulator/adapters/base.py +111 -0
- RGBMatrixEmulator/adapters/browser_adapter/README.md +89 -0
- RGBMatrixEmulator/adapters/browser_adapter/__init__.py +0 -0
- RGBMatrixEmulator/adapters/browser_adapter/adapter.py +53 -0
- RGBMatrixEmulator/adapters/browser_adapter/request_handlers/__init__.py +3 -0
- RGBMatrixEmulator/adapters/browser_adapter/request_handlers/image.py +10 -0
- RGBMatrixEmulator/adapters/browser_adapter/request_handlers/image_web_socket.py +30 -0
- RGBMatrixEmulator/adapters/browser_adapter/request_handlers/main.py +9 -0
- RGBMatrixEmulator/adapters/browser_adapter/server.py +73 -0
- RGBMatrixEmulator/adapters/browser_adapter/static/assets/client.js +91 -0
- RGBMatrixEmulator/adapters/browser_adapter/static/assets/icon.ico +0 -0
- RGBMatrixEmulator/adapters/browser_adapter/static/assets/styles.css +25 -0
- RGBMatrixEmulator/adapters/browser_adapter/static/index.html +144 -0
- RGBMatrixEmulator/adapters/pygame_adapter.py +71 -0
- RGBMatrixEmulator/adapters/sixel_adapter.py +72 -0
- RGBMatrixEmulator/adapters/terminal_adapter.py +36 -0
- RGBMatrixEmulator/adapters/tkinter_adapter.py +83 -0
- RGBMatrixEmulator/adapters/turtle_adapter.py +95 -0
- RGBMatrixEmulator/emulators/__init__.py +0 -0
- RGBMatrixEmulator/emulators/canvas.py +39 -0
- RGBMatrixEmulator/emulators/matrix.py +50 -0
- RGBMatrixEmulator/emulators/options.py +188 -0
- RGBMatrixEmulator/graphics/__init__.py +155 -0
- RGBMatrixEmulator/graphics/color.py +36 -0
- RGBMatrixEmulator/graphics/font.py +34 -0
- RGBMatrixEmulator/icon.ico +0 -0
- RGBMatrixEmulator/icon.png +0 -0
- RGBMatrixEmulator/logger.py +29 -0
- RGBMatrixEmulator/version.py +5 -0
- rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/client.js +91 -0
- rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/icon.ico +0 -0
- rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/icon.png +0 -0
- rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/index.html +144 -0
- rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/styles.css +25 -0
- rgbmatrixemulator-0.11.4.data/data/docs/LICENSE +9 -0
- rgbmatrixemulator-0.11.4.data/data/docs/README.md +160 -0
- rgbmatrixemulator-0.11.4.dist-info/METADATA +186 -0
- rgbmatrixemulator-0.11.4.dist-info/RECORD +43 -0
- rgbmatrixemulator-0.11.4.dist-info/WHEEL +5 -0
- rgbmatrixemulator-0.11.4.dist-info/licenses/LICENSE +9 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
body {
|
|
2
|
+
background-color: black;
|
|
3
|
+
color: white;
|
|
4
|
+
font-family: monospace;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
img#liveImg {
|
|
8
|
+
border: 1px solid gray;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
img#liveImg.no-border {
|
|
12
|
+
border: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.emulatorDetailsTableRow {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.tableContainer {
|
|
20
|
+
margin-right: 20px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
td {
|
|
24
|
+
padding-right: 10px;
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Tyler Porter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# `RGBMatrixEmulator`
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/RGBMatrixEmulator/)
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
`RGBMatrixEmulator` is a Python package for emulating RGB LED matrices that are normally driven by the `rpi-rgb-led-matrix` library. Most commonly, these are used with single-board computers such as the Raspberry Pi.
|
|
8
|
+
|
|
9
|
+
`RGBMatrixEmulator` (currently) supports a subset of the function calls present in the Python bindings for `rpi-rgb-led-matrix`. As such, it's accuracy is not 100% guaranteed.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
`RGBMatrixEmulator` is in the [Python Package Index (PyPI)](http://pypi.python.org/pypi/RGBMatrixEmulator/).
|
|
14
|
+
Installing with ``pip`` is recommended for all systems.
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pip install RGBMatrixEmulator
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Projects that are able to be emulated will rely on importing classes from `rpi-rgb-led-matrix`. These will need to be replaced by equivalent `RGBMatrixEmulator` classes.
|
|
23
|
+
|
|
24
|
+
For example, usage on a Rasberry Pi might look like this:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from rgbmatrix import RGBMatrix, RGBMatrixOptions
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The emulated version will need to use `RGBMatrixEmulator` classes:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from RGBMatrixEmulator import RGBMatrix, RGBMatrixOptions
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
After this, most of the existing command line arguments from the `rpi-rgb-led-matrix` library still apply. You should reference the [project README](https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/README.md) for that library when necessary.
|
|
37
|
+
|
|
38
|
+
Startup of the existing script will be unchanged.
|
|
39
|
+
|
|
40
|
+
## Customization
|
|
41
|
+
|
|
42
|
+
The first time you run a script with the emulator enabled, a file called `emulator_config.json` will be created in the script's directory. This enables configurations to be customized on a per-script basis. If you would like to regenerate the default configuration, you can delete the file and a new one will be created the next time the emulator starts.
|
|
43
|
+
|
|
44
|
+
The default configuration is as follows:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"pixel_outline": 0,
|
|
49
|
+
"pixel_size": 16,
|
|
50
|
+
"pixel_style": "square",
|
|
51
|
+
"display_adapter": "browser",
|
|
52
|
+
"suppress_font_warnings": false,
|
|
53
|
+
"suppress_adapter_load_errors": false,
|
|
54
|
+
"browser": {
|
|
55
|
+
"_comment": "For use with the browser adapter only.",
|
|
56
|
+
"port": 8888,
|
|
57
|
+
"target_fps": 24,
|
|
58
|
+
"fps_display": false,
|
|
59
|
+
"quality": 70,
|
|
60
|
+
"image_border": true,
|
|
61
|
+
"debug_text": false,
|
|
62
|
+
"image_format": "JPEG"
|
|
63
|
+
},
|
|
64
|
+
"log_level": "info"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Configuration Options
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
pixel_outline (Integer): Size of the black border around each pixel. Only works on some adapters; others will ignore this configuration.
|
|
72
|
+
pixel_size (Integer): Size of the emulated LED. Helpful for emulating large matrices on small screens. Actual window size is the matrix size scaled by pixel size.
|
|
73
|
+
pixel_style (String): Style of the emulated LED. Supported pixel styles are "square" and "circle". Some display adapters do not support all options and will revert to a supported style.
|
|
74
|
+
display_adapter (String): Display adapter for the emulator. See Display Adapters section for details.
|
|
75
|
+
suppress_font_warnings (Boolean): Suppress BDF font parsing errors, such as for missing characters.
|
|
76
|
+
browser (Dict): Additional configuration options for the "browser" display adapter. Does nothing for other adapters.
|
|
77
|
+
port (Integer): Port for the rendering server to attach to. Example: http://localhost:8888
|
|
78
|
+
target_fps (Integer): Target frames per second. Higher values may lead to lower performance.
|
|
79
|
+
fps_display (Bool): Display the FPS.
|
|
80
|
+
quality (Intger): Value from 0 - 100 indicating the quality percentage for the rendered image. Higher values may lead to lower performance.
|
|
81
|
+
image_border (Bool): Display a slight border around the rendered image.
|
|
82
|
+
debug_text (Bool): Display debug text.
|
|
83
|
+
```
|
|
84
|
+
Altering the `pixel_size` configuration will change how large the LEDs appear on your screen. This is helpful for emulating large matrices or on small screens.
|
|
85
|
+
|
|
86
|
+
You can also change the `pixel_style` option. By default, the emulator represents LEDs as squares. If you prefer the LEDs to have a more rounded appearance (like they would on an actual matrix), you can change to `pixel_style: "circle"`.
|
|
87
|
+
|
|
88
|
+
### Display Adapters
|
|
89
|
+
|
|
90
|
+
By default, `RGBMatrixEmulator` uses `browser` as its display adapter for maximum compatibility with different operating systems as well as thread-safety. However, you can also use other display adapters as well if the default adapter does not suit your needs.
|
|
91
|
+
|
|
92
|
+
Currently supported display adapters are:
|
|
93
|
+
|
|
94
|
+
* `browser` (default)
|
|
95
|
+
* `pygame`
|
|
96
|
+
* `terminal`
|
|
97
|
+
* `tkinter`
|
|
98
|
+
* `turtle`
|
|
99
|
+
* `sixel`
|
|
100
|
+
|
|
101
|
+
You can swap display adapters by changing the `display_adapter` value to one of the above in `emulator_config.json`.
|
|
102
|
+
|
|
103
|
+
**Note:** Not all display adapters support all emulator features. Some adapters may require additional setup steps to install. For example, on OSX, it may be necessary to install `tkinter` via Homebrew (`brew install python-tk`).
|
|
104
|
+
|
|
105
|
+
### Browser Display Adapter
|
|
106
|
+
|
|
107
|
+
Please see the [README for the `browser` display adapter](RGBMatrixEmulator/adapters/browser_adapter/README.md) for further information regarding its configuration and usage.
|
|
108
|
+
|
|
109
|
+
## Screenshots
|
|
110
|
+
|
|
111
|
+

|
|
112
|
+

|
|
113
|
+

|
|
114
|
+

|
|
115
|
+

|
|
116
|
+
|
|
117
|
+
## Samples
|
|
118
|
+
|
|
119
|
+
See [Samples README](samples/README.md) for more information about running example scripts.
|
|
120
|
+
|
|
121
|
+
## Known Issues
|
|
122
|
+
|
|
123
|
+
- Calling draw functions on an instance of `RGBMatrix` is slow (i.e. `matrix.SetPixel`, `matrix.Fill`)
|
|
124
|
+
- Prefer using on a `Canvas` instance instead
|
|
125
|
+
- `rpi-rgb-led-matrix` uses a threaded implementation to handle single pixel draws with the `RGBMatrix` class, unfortunately `RGBMatrixEmulator` redraws the entire screen on each call
|
|
126
|
+
- NOTE: the implementation is accurate other than speed (you _can_ still drop `RGBMatrixEmulator` into a project that makes calls to the matrix object)
|
|
127
|
+
- <details>
|
|
128
|
+
<summary>Expand Example</summary>
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
# SLOW
|
|
132
|
+
matrix = RGBMatrix(options = RGBMatrixOptions)
|
|
133
|
+
|
|
134
|
+
for y in matrix.height:
|
|
135
|
+
for x in matrix.width:
|
|
136
|
+
matrix.SetPixel(x, y, 255, 255, 255) # Redraws entire screen
|
|
137
|
+
|
|
138
|
+
# FAST
|
|
139
|
+
matrix = RGBMatrix(options = RGBMatrixOptions)
|
|
140
|
+
canvas = matrix.CreateFrameCanvas()
|
|
141
|
+
|
|
142
|
+
for y in matrix.height:
|
|
143
|
+
for x in matrix.width:
|
|
144
|
+
canvas.SetPixel(x, y, 255, 255, 255) # No redraw
|
|
145
|
+
|
|
146
|
+
matrix.SwapOnVsync(canvas) # Force screen refresh
|
|
147
|
+
```
|
|
148
|
+
</details>
|
|
149
|
+
- Drawing large strings is slow, partly because of the `linelimit` parameter in the BDF font parser this emulator uses to prevent multiline text from being rendered unintentionally.
|
|
150
|
+
|
|
151
|
+
## Contributing
|
|
152
|
+
If you want to help develop RGBMatrixEmulator, you must also install the dev dependencies, which can be done by running ``pip install -e .[dev]`` from within the directory.
|
|
153
|
+
|
|
154
|
+
Before submitting a PR, please open an issue to help us track development. All development should be based off of the `dev` branch. This branch is kept up-to-date with `main` after releases.
|
|
155
|
+
|
|
156
|
+
## Contact
|
|
157
|
+
|
|
158
|
+
Tyler Porter
|
|
159
|
+
|
|
160
|
+
tyler.b.porter@gmail.com
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: RGBMatrixEmulator
|
|
3
|
+
Version: 0.11.4
|
|
4
|
+
Summary: A PC emulator for Raspberry Pi LED matrices driven by rpi-rgb-led-matrix
|
|
5
|
+
Project-URL: Homepage, https://github.com/ty-porter/RGBMatrixEmulator
|
|
6
|
+
Author-email: Tyler Porter <tyler.b.porter@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: LED,LED matrix,RPI,matrix,raspberry,raspberry pi
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Other Audience
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Other/Nonlisted Topic
|
|
19
|
+
Requires-Dist: bdfparser<=2.2.0
|
|
20
|
+
Requires-Dist: libsixel-python>=0.5.0
|
|
21
|
+
Requires-Dist: numpy>=1.2.0
|
|
22
|
+
Requires-Dist: pillow>=10.0.1
|
|
23
|
+
Requires-Dist: pygame<3,>=2.0.1
|
|
24
|
+
Requires-Dist: tornado>=6.1
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# `RGBMatrixEmulator`
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/RGBMatrixEmulator/)
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
`RGBMatrixEmulator` is a Python package for emulating RGB LED matrices that are normally driven by the `rpi-rgb-led-matrix` library. Most commonly, these are used with single-board computers such as the Raspberry Pi.
|
|
34
|
+
|
|
35
|
+
`RGBMatrixEmulator` (currently) supports a subset of the function calls present in the Python bindings for `rpi-rgb-led-matrix`. As such, it's accuracy is not 100% guaranteed.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
`RGBMatrixEmulator` is in the [Python Package Index (PyPI)](http://pypi.python.org/pypi/RGBMatrixEmulator/).
|
|
40
|
+
Installing with ``pip`` is recommended for all systems.
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
pip install RGBMatrixEmulator
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
Projects that are able to be emulated will rely on importing classes from `rpi-rgb-led-matrix`. These will need to be replaced by equivalent `RGBMatrixEmulator` classes.
|
|
49
|
+
|
|
50
|
+
For example, usage on a Rasberry Pi might look like this:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from rgbmatrix import RGBMatrix, RGBMatrixOptions
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The emulated version will need to use `RGBMatrixEmulator` classes:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from RGBMatrixEmulator import RGBMatrix, RGBMatrixOptions
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
After this, most of the existing command line arguments from the `rpi-rgb-led-matrix` library still apply. You should reference the [project README](https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/README.md) for that library when necessary.
|
|
63
|
+
|
|
64
|
+
Startup of the existing script will be unchanged.
|
|
65
|
+
|
|
66
|
+
## Customization
|
|
67
|
+
|
|
68
|
+
The first time you run a script with the emulator enabled, a file called `emulator_config.json` will be created in the script's directory. This enables configurations to be customized on a per-script basis. If you would like to regenerate the default configuration, you can delete the file and a new one will be created the next time the emulator starts.
|
|
69
|
+
|
|
70
|
+
The default configuration is as follows:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"pixel_outline": 0,
|
|
75
|
+
"pixel_size": 16,
|
|
76
|
+
"pixel_style": "square",
|
|
77
|
+
"display_adapter": "browser",
|
|
78
|
+
"suppress_font_warnings": false,
|
|
79
|
+
"suppress_adapter_load_errors": false,
|
|
80
|
+
"browser": {
|
|
81
|
+
"_comment": "For use with the browser adapter only.",
|
|
82
|
+
"port": 8888,
|
|
83
|
+
"target_fps": 24,
|
|
84
|
+
"fps_display": false,
|
|
85
|
+
"quality": 70,
|
|
86
|
+
"image_border": true,
|
|
87
|
+
"debug_text": false,
|
|
88
|
+
"image_format": "JPEG"
|
|
89
|
+
},
|
|
90
|
+
"log_level": "info"
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Configuration Options
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
pixel_outline (Integer): Size of the black border around each pixel. Only works on some adapters; others will ignore this configuration.
|
|
98
|
+
pixel_size (Integer): Size of the emulated LED. Helpful for emulating large matrices on small screens. Actual window size is the matrix size scaled by pixel size.
|
|
99
|
+
pixel_style (String): Style of the emulated LED. Supported pixel styles are "square" and "circle". Some display adapters do not support all options and will revert to a supported style.
|
|
100
|
+
display_adapter (String): Display adapter for the emulator. See Display Adapters section for details.
|
|
101
|
+
suppress_font_warnings (Boolean): Suppress BDF font parsing errors, such as for missing characters.
|
|
102
|
+
browser (Dict): Additional configuration options for the "browser" display adapter. Does nothing for other adapters.
|
|
103
|
+
port (Integer): Port for the rendering server to attach to. Example: http://localhost:8888
|
|
104
|
+
target_fps (Integer): Target frames per second. Higher values may lead to lower performance.
|
|
105
|
+
fps_display (Bool): Display the FPS.
|
|
106
|
+
quality (Intger): Value from 0 - 100 indicating the quality percentage for the rendered image. Higher values may lead to lower performance.
|
|
107
|
+
image_border (Bool): Display a slight border around the rendered image.
|
|
108
|
+
debug_text (Bool): Display debug text.
|
|
109
|
+
```
|
|
110
|
+
Altering the `pixel_size` configuration will change how large the LEDs appear on your screen. This is helpful for emulating large matrices or on small screens.
|
|
111
|
+
|
|
112
|
+
You can also change the `pixel_style` option. By default, the emulator represents LEDs as squares. If you prefer the LEDs to have a more rounded appearance (like they would on an actual matrix), you can change to `pixel_style: "circle"`.
|
|
113
|
+
|
|
114
|
+
### Display Adapters
|
|
115
|
+
|
|
116
|
+
By default, `RGBMatrixEmulator` uses `browser` as its display adapter for maximum compatibility with different operating systems as well as thread-safety. However, you can also use other display adapters as well if the default adapter does not suit your needs.
|
|
117
|
+
|
|
118
|
+
Currently supported display adapters are:
|
|
119
|
+
|
|
120
|
+
* `browser` (default)
|
|
121
|
+
* `pygame`
|
|
122
|
+
* `terminal`
|
|
123
|
+
* `tkinter`
|
|
124
|
+
* `turtle`
|
|
125
|
+
* `sixel`
|
|
126
|
+
|
|
127
|
+
You can swap display adapters by changing the `display_adapter` value to one of the above in `emulator_config.json`.
|
|
128
|
+
|
|
129
|
+
**Note:** Not all display adapters support all emulator features. Some adapters may require additional setup steps to install. For example, on OSX, it may be necessary to install `tkinter` via Homebrew (`brew install python-tk`).
|
|
130
|
+
|
|
131
|
+
### Browser Display Adapter
|
|
132
|
+
|
|
133
|
+
Please see the [README for the `browser` display adapter](RGBMatrixEmulator/adapters/browser_adapter/README.md) for further information regarding its configuration and usage.
|
|
134
|
+
|
|
135
|
+
## Screenshots
|
|
136
|
+
|
|
137
|
+

|
|
138
|
+

|
|
139
|
+

|
|
140
|
+

|
|
141
|
+

|
|
142
|
+
|
|
143
|
+
## Samples
|
|
144
|
+
|
|
145
|
+
See [Samples README](samples/README.md) for more information about running example scripts.
|
|
146
|
+
|
|
147
|
+
## Known Issues
|
|
148
|
+
|
|
149
|
+
- Calling draw functions on an instance of `RGBMatrix` is slow (i.e. `matrix.SetPixel`, `matrix.Fill`)
|
|
150
|
+
- Prefer using on a `Canvas` instance instead
|
|
151
|
+
- `rpi-rgb-led-matrix` uses a threaded implementation to handle single pixel draws with the `RGBMatrix` class, unfortunately `RGBMatrixEmulator` redraws the entire screen on each call
|
|
152
|
+
- NOTE: the implementation is accurate other than speed (you _can_ still drop `RGBMatrixEmulator` into a project that makes calls to the matrix object)
|
|
153
|
+
- <details>
|
|
154
|
+
<summary>Expand Example</summary>
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
# SLOW
|
|
158
|
+
matrix = RGBMatrix(options = RGBMatrixOptions)
|
|
159
|
+
|
|
160
|
+
for y in matrix.height:
|
|
161
|
+
for x in matrix.width:
|
|
162
|
+
matrix.SetPixel(x, y, 255, 255, 255) # Redraws entire screen
|
|
163
|
+
|
|
164
|
+
# FAST
|
|
165
|
+
matrix = RGBMatrix(options = RGBMatrixOptions)
|
|
166
|
+
canvas = matrix.CreateFrameCanvas()
|
|
167
|
+
|
|
168
|
+
for y in matrix.height:
|
|
169
|
+
for x in matrix.width:
|
|
170
|
+
canvas.SetPixel(x, y, 255, 255, 255) # No redraw
|
|
171
|
+
|
|
172
|
+
matrix.SwapOnVsync(canvas) # Force screen refresh
|
|
173
|
+
```
|
|
174
|
+
</details>
|
|
175
|
+
- Drawing large strings is slow, partly because of the `linelimit` parameter in the BDF font parser this emulator uses to prevent multiline text from being rendered unintentionally.
|
|
176
|
+
|
|
177
|
+
## Contributing
|
|
178
|
+
If you want to help develop RGBMatrixEmulator, you must also install the dev dependencies, which can be done by running ``pip install -e .[dev]`` from within the directory.
|
|
179
|
+
|
|
180
|
+
Before submitting a PR, please open an issue to help us track development. All development should be based off of the `dev` branch. This branch is kept up-to-date with `main` after releases.
|
|
181
|
+
|
|
182
|
+
## Contact
|
|
183
|
+
|
|
184
|
+
Tyler Porter
|
|
185
|
+
|
|
186
|
+
tyler.b.porter@gmail.com
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
RGBMatrixEmulator/__init__.py,sha256=x9nzUgK7uh8jKl9WAPlPx3-776P4T4pIwNNpcItE8fY,219
|
|
2
|
+
RGBMatrixEmulator/icon.ico,sha256=vSr8bnYuv5yD1J8am1yjcBVxpO7jvoys57qYc41B25o,3426
|
|
3
|
+
RGBMatrixEmulator/icon.png,sha256=KSH4LnThJCqgc3Rj9hAnletTm405pOvSLV7vv7-8kNw,8514
|
|
4
|
+
RGBMatrixEmulator/logger.py,sha256=FoTWKcJU0ZM2e2jDpghm_qNpC_dTB-FPPTzzluEht20,781
|
|
5
|
+
RGBMatrixEmulator/version.py,sha256=Mh2GwGmtQ1p4kPLD6NC1d9GmTZ8QyrRI4PqrceDbyxI,115
|
|
6
|
+
RGBMatrixEmulator/adapters/__init__.py,sha256=ilxVhpta8pkt64bEQZF3fa60wzdTpvubmKdlU4FuW6A,1895
|
|
7
|
+
RGBMatrixEmulator/adapters/base.py,sha256=uwg81E4-cJtuLvc89_0P75YpoSywEPM8ruU6dhAAudI,4082
|
|
8
|
+
RGBMatrixEmulator/adapters/pygame_adapter.py,sha256=msvLFyR5FnCzSsJzQj-L1N8k8NuhVsTICeirx2XGKrA,2185
|
|
9
|
+
RGBMatrixEmulator/adapters/sixel_adapter.py,sha256=0lYcOEW3GPqzsIVTmeTF8OxCI9E8egFA_5ueeQyl95s,2841
|
|
10
|
+
RGBMatrixEmulator/adapters/terminal_adapter.py,sha256=IjWQaBq1zasE1bfyau6A_ivabSnsIKU5gqIK7Q3TyDI,1415
|
|
11
|
+
RGBMatrixEmulator/adapters/tkinter_adapter.py,sha256=thseqQzpruyexz06ZOXliH9J7K33ZwhtstMX0ft-PYQ,2805
|
|
12
|
+
RGBMatrixEmulator/adapters/turtle_adapter.py,sha256=rCcm7ynMhAJJzCPIbyXxFxW0ibsSgwve45m_U4_hB-I,3123
|
|
13
|
+
RGBMatrixEmulator/adapters/browser_adapter/README.md,sha256=CVXkoKd7wQK48XcNOarTHVwNZuL7xFUa0J5GXNl23zM,3895
|
|
14
|
+
RGBMatrixEmulator/adapters/browser_adapter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
RGBMatrixEmulator/adapters/browser_adapter/adapter.py,sha256=BK3iuzRx3oFxpjTMUnBXJbCkhyjDqOTgZsuUK5rwPBo,1674
|
|
16
|
+
RGBMatrixEmulator/adapters/browser_adapter/server.py,sha256=aUcD-V6aIOPmXC15K19ovxXrQbJl3byNipLG3CNDQww,2658
|
|
17
|
+
RGBMatrixEmulator/adapters/browser_adapter/request_handlers/__init__.py,sha256=VI7mUoExEoReq2Nz98ilqwcAmKt9ZkobMd5Me41u3lk,292
|
|
18
|
+
RGBMatrixEmulator/adapters/browser_adapter/request_handlers/image.py,sha256=TIFRxin7QXm-10uqvir5j_y1wKvc-xY-Gz2M6Zer2L0,306
|
|
19
|
+
RGBMatrixEmulator/adapters/browser_adapter/request_handlers/image_web_socket.py,sha256=p39im-f6fgNfxu6zrYcXPmE7pt0vb2uEZxXVDaPqKw0,940
|
|
20
|
+
RGBMatrixEmulator/adapters/browser_adapter/request_handlers/main.py,sha256=I4l_SpEBDpZcs4r6xTRQNo6-W6id5uSCmCAtV0wzwxE,245
|
|
21
|
+
RGBMatrixEmulator/adapters/browser_adapter/static/index.html,sha256=DXWJVLYRcrTBKOlsbVL4K7KMOF95gOG-I5g0PGbcZMQ,5188
|
|
22
|
+
RGBMatrixEmulator/adapters/browser_adapter/static/assets/client.js,sha256=wYhKPcoUeA1iRbJdEDNhyIvXLgyjT6eX2gVt56F6Fyg,3114
|
|
23
|
+
RGBMatrixEmulator/adapters/browser_adapter/static/assets/icon.ico,sha256=vSr8bnYuv5yD1J8am1yjcBVxpO7jvoys57qYc41B25o,3426
|
|
24
|
+
RGBMatrixEmulator/adapters/browser_adapter/static/assets/styles.css,sha256=7XSyK3EVgo78HCS5dkbtBvsm7YcAphDBCAioMdETkiA,311
|
|
25
|
+
RGBMatrixEmulator/emulators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
RGBMatrixEmulator/emulators/canvas.py,sha256=Q0SDPiBsYCEA5UPRtXHtvbWcWy0hcLHxS4ninK4gaFE,1517
|
|
27
|
+
RGBMatrixEmulator/emulators/matrix.py,sha256=gcKryT2qVkuwUphQpBhIudeAClfX9oKQ2uV0P0x4Ymw,1449
|
|
28
|
+
RGBMatrixEmulator/emulators/options.py,sha256=IuY_cK3jcTC5ToplXpZQKkkBEhBI9D0Do-hb6gahlYI,7459
|
|
29
|
+
RGBMatrixEmulator/graphics/__init__.py,sha256=8q9zu9O65PQxkKKoUkdy6WyNSmaJVGGMBItEOC4Of3c,4553
|
|
30
|
+
RGBMatrixEmulator/graphics/color.py,sha256=lvwTIcG_QIbu2U6bSALuIotMK9-z5-F6Ap4YWi7MrxA,736
|
|
31
|
+
RGBMatrixEmulator/graphics/font.py,sha256=9rKYacw5epB-n5ZoPfaxK2HC0qZScAdyhV9F--A7dg0,1085
|
|
32
|
+
rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/client.js,sha256=wYhKPcoUeA1iRbJdEDNhyIvXLgyjT6eX2gVt56F6Fyg,3114
|
|
33
|
+
rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/icon.ico,sha256=vSr8bnYuv5yD1J8am1yjcBVxpO7jvoys57qYc41B25o,3426
|
|
34
|
+
rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/styles.css,sha256=7XSyK3EVgo78HCS5dkbtBvsm7YcAphDBCAioMdETkiA,311
|
|
35
|
+
rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/icon.ico,sha256=vSr8bnYuv5yD1J8am1yjcBVxpO7jvoys57qYc41B25o,3426
|
|
36
|
+
rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/icon.png,sha256=KSH4LnThJCqgc3Rj9hAnletTm405pOvSLV7vv7-8kNw,8514
|
|
37
|
+
rgbmatrixemulator-0.11.4.data/data/RGBMatrixEmulator/index.html,sha256=DXWJVLYRcrTBKOlsbVL4K7KMOF95gOG-I5g0PGbcZMQ,5188
|
|
38
|
+
rgbmatrixemulator-0.11.4.data/data/docs/LICENSE,sha256=nfdrZEY6j9RJ8RJJ7ileA-lfKzEc8WknKnLLGtoehsc,1076
|
|
39
|
+
rgbmatrixemulator-0.11.4.data/data/docs/README.md,sha256=uKsCoDpBX5bOWc8C4G0b4bgc3JQnw-jjwY8pg2ckCeA,7428
|
|
40
|
+
rgbmatrixemulator-0.11.4.dist-info/METADATA,sha256=ynZ-xFTMqy9J-iMSY7wLAg6MFs7uQDBjBF1Z7Rg4agw,8269
|
|
41
|
+
rgbmatrixemulator-0.11.4.dist-info/WHEEL,sha256=ccEkY-EGGllEs7ySpwBlD8G4u70wR77CNej8Q6tzIqA,105
|
|
42
|
+
rgbmatrixemulator-0.11.4.dist-info/licenses/LICENSE,sha256=nfdrZEY6j9RJ8RJJ7ileA-lfKzEc8WknKnLLGtoehsc,1076
|
|
43
|
+
rgbmatrixemulator-0.11.4.dist-info/RECORD,,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Tyler Porter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|