Size

Struct Size 

Source
pub struct Size {
    pub width: u32,
    pub height: u32,
}
Expand description

Represents libcamera::Size

Fields§

§width: u32§height: u32

Implementations§

Source§

impl Size

Source

pub const fn new(width: u32, height: u32) -> Self

Source

pub fn align_down_to(self, h_alignment: u32, v_alignment: u32) -> Self

Source

pub fn align_up_to(self, h_alignment: u32, v_alignment: u32) -> Self

Source

pub fn bound_to(self, bound: Size) -> Self

Source

pub fn expand_to(self, expand: Size) -> Self

Source

pub fn grow_by(self, margins: Size) -> Self

Source

pub fn shrink_by(self, margins: Size) -> Self

Source

pub fn bounded_to_aspect_ratio(self, ratio: Size) -> Self

Bound this size down to match the aspect ratio of ratio.

Source

pub fn expanded_to_aspect_ratio(self, ratio: Size) -> Self

Expand this size up to match the aspect ratio of ratio.

Source

pub fn centered_to(self, center: Point) -> Rectangle

Center a rectangle of this size at the given point.

Source§

impl Size

Source

pub fn transposed(self) -> Self

Return a size with width and height swapped.

Trait Implementations§

Source§

impl Clone for Size

Source§

fn clone(&self) -> Size

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Size

Source§

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

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

impl Div<f32> for Size

Source§

type Output = Size

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<f32> for Size

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl From<Size> for ControlValue

Source§

fn from(val: Size) -> Self

Converts to this type from the input type.
Source§

impl From<Size> for libcamera_size_t

Source§

fn from(s: Size) -> Self

Converts to this type from the input type.
Source§

impl From<libcamera_size> for Size

Source§

fn from(s: libcamera_size_t) -> Self

Converts to this type from the input type.
Source§

impl Mul<f32> for Size

Source§

type Output = Size

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<f32> for Size

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl TryFrom<ControlValue> for Size

Source§

type Error = ControlValueError

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

fn try_from(value: ControlValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Size

Auto Trait Implementations§

§

impl Freeze for Size

§

impl RefUnwindSafe for Size

§

impl Send for Size

§

impl Sync for Size

§

impl Unpin for Size

§

impl UnwindSafe for Size

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.