From 09c13f4fccf5b8350a60cbbf1632dc8b409b8127 Mon Sep 17 00:00:00 2001 From: James Hodgson Date: Fri, 7 Oct 2022 14:51:31 +0100 Subject: [PATCH] #22 Remove helper functions --- src/main.py | 4 ++-- src/picam/picam.py | 14 -------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/main.py b/src/main.py index 5d37198..efd2bb6 100644 --- a/src/main.py +++ b/src/main.py @@ -31,7 +31,7 @@ def main() -> None: while loop: preview_bytes = camera.capture_preview() - ui.updatePreview(preview_bytes, camera.get_preview_resolution()) + ui.updatePreview(preview_bytes, camera.preview_resolution) ui.update() ui_events = ui.getEvents() @@ -42,7 +42,7 @@ def main() -> None: now = datetime.now() capture_bytes = camera.capture() - pil_image = Image.frombuffer(mode='RGB', size=camera.get_capture_resolution(), data=capture_bytes) + pil_image = Image.frombuffer(mode='RGB', size=camera.capture_resolution, data=capture_bytes) formatted_filename = now.strftime(config['output_filename_format']) filename = f'{formatted_filename}{config["output_extension"]}' diff --git a/src/picam/picam.py b/src/picam/picam.py index a904e9e..f2eadb6 100644 --- a/src/picam/picam.py +++ b/src/picam/picam.py @@ -17,20 +17,6 @@ class PiCam: """ self.preview_resolution = resolution - def get_preview_resolution(self) -> "tuple[int, int]": - """Get the current preview resolution - - :returns: Tuple containing current preview resolution (x, y) - """ - raise NotImplementedError - - def get_capture_resolution(self) -> "tuple[int, int]": - """Get the current capture resolution - - :returns: Tuple containing current capture resolution (x, y) - """ - raise NotImplementedError - def capture(self) -> bytes: """Capture an image