#22 Remove helper functions

This commit is contained in:
James Hodgson
2022-10-07 14:51:31 +01:00
parent 7850503146
commit 09c13f4fcc
2 changed files with 2 additions and 16 deletions

View File

@@ -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"]}'

View File

@@ -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