diff --git a/CHANGELOG.md b/CHANGELOG.md index a32fbb4..26ac10b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 0.9.1 + +- fix: consider alpha channel in the data stored in `raw_data` field of `HeadlessWidget` + ## Version 0.9.0 - refactor: remove all features specific to Raspberry Pi, now it is a general headless diff --git a/headless_kivy/__init__.py b/headless_kivy/__init__.py index ebaa18c..89d46b6 100644 --- a/headless_kivy/__init__.py +++ b/headless_kivy/__init__.py @@ -246,7 +246,7 @@ def render_on_display(self: HeadlessWidget, *_: object) -> None: HeadlessWidget.raw_data[self.x : self.x + self.width][ self.y : self.y + self.height - ] = data + ] = data.reshape(self.width, self.height, -1) thread = Thread( target=config.callback(), diff --git a/headless_kivy/config.py b/headless_kivy/config.py index 26aa3f7..f04baf5 100644 --- a/headless_kivy/config.py +++ b/headless_kivy/config.py @@ -109,7 +109,7 @@ def setup_headless_kivy(config: SetupHeadlessConfig) -> None: from headless_kivy import HeadlessWidget HeadlessWidget.raw_data = np.zeros( - (int(dp(width())), int(dp(height())), 3), + (int(dp(width())), int(dp(height())), 4), dtype=np.uint8, ) diff --git a/pyproject.toml b/pyproject.toml index 8c53354..a9c22c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "headless-kivy" -version = "0.9.0" +version = "0.9.1" description = "Headless renderer for Kivy framework" authors = ["Sassan Haradji "] license = "Apache-2.0"