#22 Fix rounding not happening
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from utils.utils import round_resolution
|
||||
|
||||
class PiCam:
|
||||
def __init__(self, config: dict):
|
||||
self.capture_resolution = config["capture_resolution"]
|
||||
@@ -8,14 +10,16 @@ class PiCam:
|
||||
|
||||
:param resolution: New resolution for camera captures
|
||||
"""
|
||||
self.capture_resolution = resolution
|
||||
rounded_resolution = round_resolution(resolution, (32, 16))
|
||||
self.capture_resolution = rounded_resolution
|
||||
|
||||
def set_preview_resolution(self, resolution: "tuple[int, int]") -> None:
|
||||
"""Set resolution for camera preview (viewfinder)
|
||||
|
||||
:param resolution: New resolution for camera preview
|
||||
"""
|
||||
self.preview_resolution = resolution
|
||||
rounded_resolution = round_resolution(resolution, (32, 16))
|
||||
self.preview_resolution = rounded_resolution
|
||||
|
||||
def capture(self) -> bytearray:
|
||||
"""Capture an image
|
||||
|
||||
Reference in New Issue
Block a user