pub struct Camera<'d> { /* private fields */ }
Expand description
A read-only instance of a camera.
Can be used to obtain camera parameters or supported stream configurations. In order to be used for capturing, it must be turned into an ActiveCamera by Camera::acquire().
Implementations§
source§impl<'d> Camera<'d>
impl<'d> Camera<'d>
sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
ID of the camera.
This usually contains hardware path within the system and is not human-friendly. Use properties::Model from Camera::properties() to obtain a human readable identification instead.
sourcepub fn controls(&self) -> &ControlInfoMap
pub fn controls(&self) -> &ControlInfoMap
Returns a list of available camera controls and their limit.
sourcepub fn properties(&self) -> &PropertyList
pub fn properties(&self) -> &PropertyList
Returns a list of camera properties.
See properties for available items.
sourcepub fn generate_configuration(
&self,
roles: &[StreamRole],
) -> Option<CameraConfiguration>
pub fn generate_configuration( &self, roles: &[StreamRole], ) -> Option<CameraConfiguration>
Generates default camera configuration for the given StreamRoles.
The resulting CameraConfiguration contains stream configurations for each of the requested roles.
Generated configuration can be adjusted as needed and then passed onto ActiveCamera::configure() to apply.
sourcepub fn acquire(&self) -> Result<ActiveCamera<'_>>
pub fn acquire(&self) -> Result<ActiveCamera<'_>>
Acquires exclusive rights to the camera, which allows changing configuration and capturing.