#22 Begin python rework
This commit is contained in:
46
src/picam/picam.py
Normal file
46
src/picam/picam.py
Normal file
@@ -0,0 +1,46 @@
|
||||
class PiCam:
|
||||
def __init__(self, config: dict):
|
||||
self.capture_resolution = config["capture_resolution"]
|
||||
self.preview_resolution = config["preview_resolution"]
|
||||
|
||||
def set_capture_resolution(self, resolution: "tuple[int, int]") -> None:
|
||||
"""Set capture resolution for camera
|
||||
|
||||
:param resolution: New resolution for camera captures
|
||||
"""
|
||||
self.capture_resolution = 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
|
||||
|
||||
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
|
||||
|
||||
:returns: Image data as a byte buffer
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def capture_preview(self) -> bytes:
|
||||
"""Capture a preview image for the viewfinder
|
||||
|
||||
:returns: Image data as a byte buffer
|
||||
"""
|
||||
raise NotImplementedError
|
||||
Reference in New Issue
Block a user