Struct libcamera::camera::Camera

source ·
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>

source

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.

source

pub fn controls(&self) -> &ControlInfoMap

Returns a list of available camera controls and their limit.

source

pub fn properties(&self) -> &PropertyList

Returns a list of camera properties.

See properties for available items.

source

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.

source

pub fn acquire(&self) -> Result<ActiveCamera<'_>>

Acquires exclusive rights to the camera, which allows changing configuration and capturing.

Trait Implementations§

source§

impl<'d> Drop for Camera<'d>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'d> Freeze for Camera<'d>

§

impl<'d> RefUnwindSafe for Camera<'d>

§

impl<'d> !Send for Camera<'d>

§

impl<'d> !Sync for Camera<'d>

§

impl<'d> Unpin for Camera<'d>

§

impl<'d> UnwindSafe for Camera<'d>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.