CameraConfiguration

Struct CameraConfiguration 

Source
pub struct CameraConfiguration { /* private fields */ }
Expand description

Camera configuration.

Contains StreamConfigurationRef for each stream used by the camera.

Implementations§

Source§

impl CameraConfiguration

Source

pub fn get(&self, index: usize) -> Option<Immutable<StreamConfigurationRef<'_>>>

Returns immutable StreamConfigurationRef for the camera stream.

§Parameters
  • index - Camera stream index.
Source

pub fn get_mut(&mut self, index: usize) -> Option<StreamConfigurationRef<'_>>

Returns mutable StreamConfigurationRef for the camera stream.

§Parameters
  • index - Camera stream index.
Source

pub fn add_configuration(&mut self) -> Option<StreamConfigurationRef<'_>>

Append a new stream configuration for a given role.

Source

pub fn add_configuration_like( &mut self, template: &StreamConfigurationRef<'_>, ) -> Option<StreamConfigurationRef<'_>>

Append a new stream configuration by cloning an existing configuration.

This mirrors libcamera’s addConfiguration(const StreamConfiguration&) and produces a valid entry instead of an empty placeholder, allowing multi-stream configurations to validate successfully.

Source

pub fn add_configurations_like<'a>( &mut self, templates: &[&StreamConfigurationRef<'a>], ) -> Vec<StreamConfigurationRef<'_>>

Append multiple stream configurations by cloning existing templates.

Returns the newly appended configurations (in order) for further adjustment.

Source

pub fn set_sensor_configuration(&mut self, mode: SensorConfiguration)

Source

pub fn len(&self) -> usize

Returns number of streams within camera configuration.

Source

pub fn is_empty(&self) -> bool

Returns true if camera configuration has no streams.

Source

pub fn validate(&mut self) -> CameraConfigurationStatus

Validates camera configuration.

Source

pub fn orientation(&self) -> Orientation

Returns the desired orientation of the captured image.

Source

pub fn set_orientation(&mut self, orientation: Orientation)

Sets the desired orientation of the captured image.

Source

pub fn sensor_configuration(&self) -> Option<SensorConfiguration>

Returns the sensor configuration if one is set by the application or pipeline.

Source

pub fn validate_and_log(&mut self) -> CameraConfigurationStatus

Re-validate and print stride/frame_size adjustments for each stream (helper for debugging).

Source

pub fn to_string_repr(&self) -> String

Return the libcamera textual representation of this configuration.

Trait Implementations§

Source§

impl Debug for CameraConfiguration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CameraConfiguration

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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.