Skip to content

Camera

Qt Base Class: QCamera

Signature: QCamera(self, cameraDevice: PySide6.QtMultimedia.QCameraDevice, parent: Optional[PySide6.QtCore.QObject] = None) -> None QCamera(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None QCamera(self, position: PySide6.QtMultimedia.QCameraDevice.Position, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QCamera
PySide6.QtMultimedia
QCamera(self, cameraDevice: PySide6.QtMultimedia.QCameraDevice, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473574001712["multimedia.Camera"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473573952912["QtMultimedia.QCamera"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473574001712
  140713234304496 --> 1473299815024
  1473573952912 --> 1473574001712
  1473288842240 --> 1473573952912
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QCamera

Source code in prettyqt\multimedia\camera.py
class Camera(core.ObjectMixin, multimedia.QCamera):
    def set_exposure_mode(self, mode: ExposureModeStr | multimedia.QCamera.ExposureMode):
        """Set the exposure mode.

        Args:
            mode: exposure mode
        """
        self.setExposureMode(EXPOSURE_MODE.get_enum_value(mode))

    def get_exposure_mode(self) -> ExposureModeStr:
        """Return current exposure mode.

        Returns:
            exposure mode
        """
        return EXPOSURE_MODE.inverse[self.exposureMode()]

    def set_torch_mode(self, mode: TorchModeStr | multimedia.QCamera.TorchMode):
        """Set the torch mode.

        Args:
            mode: torch mode
        """
        self.setTorchMode(TORCH_MODE.get_enum_value(mode))

    def get_torch_mode(self) -> TorchModeStr:
        """Return current torch mode.

        Returns:
            torch mode
        """
        return TORCH_MODE.inverse[self.torchMode()]

    def set_flash_mode(self, mode: FlashModeStr | multimedia.QCamera.FlashMode):
        """Set the flash mode.

        Args:
            mode: flash mode
        """
        self.setFlashMode(FLASH_MODE.get_enum_value(mode))

    def get_flash_mode(self) -> FlashModeStr:
        """Return current flash mode.

        Returns:
            flash mode
        """
        return FLASH_MODE.inverse[self.flashMode()]

    def set_white_balance_mode(
        self, mode: WhiteBalanceModeStr | multimedia.QCamera.WhiteBalanceMode
    ):
        """Set the white balance mode.

        Args:
            mode: white balance mode
        """
        self.setWhiteBalanceMode(WHITE_BALANCE.get_enum_value(mode))

    def get_white_balance_mode(self) -> WhiteBalanceModeStr:
        """Return current white balance mode.

        Returns:
            white balance mode
        """
        return WHITE_BALANCE.inverse[self.whiteBalanceMode()]

    def get_supported_features(self) -> list[FeatureStr]:
        return FEATURE.get_list(self.supportedFeatures())

    def get_error(self) -> ErrorStr:
        """Return current error state.

        Returns:
            error state
        """
        return ERROR.inverse[self.error()]

    def get_camera_format(self) -> multimedia.CameraFormat:
        return multimedia.CameraFormat(self.cameraFormat())

get_error() -> ErrorStr

Return current error state.

Source code in prettyqt\multimedia\camera.py
def get_error(self) -> ErrorStr:
    """Return current error state.

    Returns:
        error state
    """
    return ERROR.inverse[self.error()]

get_exposure_mode() -> ExposureModeStr

Return current exposure mode.

Source code in prettyqt\multimedia\camera.py
def get_exposure_mode(self) -> ExposureModeStr:
    """Return current exposure mode.

    Returns:
        exposure mode
    """
    return EXPOSURE_MODE.inverse[self.exposureMode()]

get_flash_mode() -> FlashModeStr

Return current flash mode.

Source code in prettyqt\multimedia\camera.py
def get_flash_mode(self) -> FlashModeStr:
    """Return current flash mode.

    Returns:
        flash mode
    """
    return FLASH_MODE.inverse[self.flashMode()]

get_torch_mode() -> TorchModeStr

Return current torch mode.

Source code in prettyqt\multimedia\camera.py
def get_torch_mode(self) -> TorchModeStr:
    """Return current torch mode.

    Returns:
        torch mode
    """
    return TORCH_MODE.inverse[self.torchMode()]

get_white_balance_mode() -> WhiteBalanceModeStr

Return current white balance mode.

Source code in prettyqt\multimedia\camera.py
def get_white_balance_mode(self) -> WhiteBalanceModeStr:
    """Return current white balance mode.

    Returns:
        white balance mode
    """
    return WHITE_BALANCE.inverse[self.whiteBalanceMode()]

set_exposure_mode(mode: ExposureModeStr | multimedia.QCamera.ExposureMode)

Set the exposure mode.

Parameters:

Name Type Description Default
mode ExposureModeStr | ExposureMode

exposure mode

required
Source code in prettyqt\multimedia\camera.py
def set_exposure_mode(self, mode: ExposureModeStr | multimedia.QCamera.ExposureMode):
    """Set the exposure mode.

    Args:
        mode: exposure mode
    """
    self.setExposureMode(EXPOSURE_MODE.get_enum_value(mode))

set_flash_mode(mode: FlashModeStr | multimedia.QCamera.FlashMode)

Set the flash mode.

Parameters:

Name Type Description Default
mode FlashModeStr | FlashMode

flash mode

required
Source code in prettyqt\multimedia\camera.py
def set_flash_mode(self, mode: FlashModeStr | multimedia.QCamera.FlashMode):
    """Set the flash mode.

    Args:
        mode: flash mode
    """
    self.setFlashMode(FLASH_MODE.get_enum_value(mode))

set_torch_mode(mode: TorchModeStr | multimedia.QCamera.TorchMode)

Set the torch mode.

Parameters:

Name Type Description Default
mode TorchModeStr | TorchMode

torch mode

required
Source code in prettyqt\multimedia\camera.py
def set_torch_mode(self, mode: TorchModeStr | multimedia.QCamera.TorchMode):
    """Set the torch mode.

    Args:
        mode: torch mode
    """
    self.setTorchMode(TORCH_MODE.get_enum_value(mode))

set_white_balance_mode(mode: WhiteBalanceModeStr | multimedia.QCamera.WhiteBalanceMode)

Set the white balance mode.

Parameters:

Name Type Description Default
mode WhiteBalanceModeStr | WhiteBalanceMode

white balance mode

required
Source code in prettyqt\multimedia\camera.py
def set_white_balance_mode(
    self, mode: WhiteBalanceModeStr | multimedia.QCamera.WhiteBalanceMode
):
    """Set the white balance mode.

    Args:
        mode: white balance mode
    """
    self.setWhiteBalanceMode(WHITE_BALANCE.get_enum_value(mode))

⌗ Property table

Qt Property Type Doc
objectName QString
active bool
cameraDevice QCameraDevice
error QCamera::Error
errorString QString
cameraFormat QCameraFormat
focusMode QCamera::FocusMode
focusPoint QPointF
customFocusPoint QPointF
focusDistance float
minimumZoomFactor float
maximumZoomFactor float
zoomFactor float
exposureTime float
manualExposureTime int
isoSensitivity int
manualIsoSensitivity int
exposureCompensation float
exposureMode QCamera::ExposureMode
flashReady bool
flashMode QCamera::FlashMode
torchMode QCamera::TorchMode
whiteBalanceMode QCamera::WhiteBalanceMode
colorTemperature int
supportedFeatures QFlags