This commit is contained in:
wittmannzl103469 committed 2026-11-05 15:08:42 +01:00
1 parent de41a02749
commit 9af09cebd3
764 files changed
+54218 -78859

No files matched your search

@@ -1,16 +1,12 @@
from abc import ABC, abstractmethod
from typing import Literal
from typing import List, Optional, Sequence, Tuple, Union
from pygame.surface import Surface
from pygame.typing import IntPoint
def get_backends() -> list[str]: ...
def init(backend: str | None = None) -> None: ...
def get_backends() -> List[str]: ...
def init(backend: Optional[str] = None) -> None: ...
def quit() -> None: ...
def list_cameras() -> list[str] | list[int]: ...
def colorspace(
surface: Surface, color: Literal["YUV", "HSV"], dest_surface: Surface = ..., /
) -> Surface: ...
def list_cameras() -> List[str]: ...
class AbstractCamera(ABC):
@abstractmethod
@@ -20,11 +16,11 @@ class AbstractCamera(ABC):
@abstractmethod
def stop(self) -> None: ...
@abstractmethod
def get_size(self) -> tuple[int, int]: ...
def get_size(self) -> Tuple[int, int]: ...
@abstractmethod
def query_image(self) -> bool: ...
@abstractmethod
def get_image(self, dest_surf: Surface | None = None) -> Surface: ...
def get_image(self, dest_surf: Optional[Surface] = None) -> Surface: ...
@abstractmethod
def get_raw(self) -> bytes: ...
# set_controls and get_controls are not a part of the AbstractCamera ABC,
@@ -34,20 +30,20 @@ class AbstractCamera(ABC):
class Camera(AbstractCamera):
def __init__(
self,
device: str | int,
size: IntPoint = (640, 480),
device: Union[str, int] = 0,
size: Union[Tuple[int, int], Sequence[int]] = (640, 480),
format: str = "RGB",
) -> None: ...
def start(self) -> None: ...
def stop(self) -> None: ...
def get_controls(self) -> tuple[bool, bool, int]: ...
def get_controls(self) -> Tuple[bool, bool, int]: ...
def set_controls(
self,
hflip: bool = ...,
vflip: bool = ...,
brightness: int = ...,
) -> tuple[bool, bool, int]: ...
def get_size(self) -> tuple[int, int]: ...
) -> Tuple[bool, bool, int]: ...
def get_size(self) -> Tuple[int, int]: ...
def query_image(self) -> bool: ...
def get_image(self, surface: Surface | None = None) -> Surface: ...
def get_image(self, surface: Optional[Surface] = None) -> Surface: ...
def get_raw(self) -> bytes: ...