diff --git a/CHANGELOG.md b/CHANGELOG.md index 307c8d8..24eb755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Version 0.7.3 - feat: configurable rotation and flip parameters +- feat: let the user render a splash screen before the first frame is ready to be + rendered, if not provided, it renders a black screen ## Version 0.7.2 diff --git a/headless_kivy_pi/config.py b/headless_kivy_pi/config.py index 1f2feac..bf3eba9 100644 --- a/headless_kivy_pi/config.py +++ b/headless_kivy_pi/config.py @@ -92,13 +92,19 @@ def report_uninitialized() -> NoReturn: raise RuntimeError(msg) -def setup_headless_kivy(config: SetupHeadlessConfig) -> None: +def setup_headless_kivy( + config: SetupHeadlessConfig, + splash_screen: bytes | None = None, +) -> None: """Configure the headless mode for the Kivy application. Arguments: --------- config: `SetupHeadlessConfig` + splash_screen: `bytes` + it should have a length of `width` x `height` x 2 + """ global _config, _display # noqa: PLW0603 _config = config @@ -160,6 +166,13 @@ def setup_headless_kivy(config: SetupHeadlessConfig) -> None: rst=reset_pin, baudrate=baudrate, ) + _display._block( # noqa: SLF001 + 0, + 0, + width() - 1, + height() - 1, + bytes(width() * height() * 2) if splash_screen is None else splash_screen, + ) if clear_at_exit: atexit.register( lambda: _display