pub struct Size {
pub width: u32,
pub height: u32,
}Expand description
Represents libcamera::Size
Fields§
§width: u32§height: u32Implementations§
Source§impl Size
impl Size
pub const fn new(width: u32, height: u32) -> Self
pub fn align_down_to(self, h_alignment: u32, v_alignment: u32) -> Self
pub fn align_up_to(self, h_alignment: u32, v_alignment: u32) -> Self
pub fn bound_to(self, bound: Size) -> Self
pub fn expand_to(self, expand: Size) -> Self
pub fn grow_by(self, margins: Size) -> Self
pub fn shrink_by(self, margins: Size) -> Self
Sourcepub fn bounded_to_aspect_ratio(self, ratio: Size) -> Self
pub fn bounded_to_aspect_ratio(self, ratio: Size) -> Self
Bound this size down to match the aspect ratio of ratio.
Sourcepub fn expanded_to_aspect_ratio(self, ratio: Size) -> Self
pub fn expanded_to_aspect_ratio(self, ratio: Size) -> Self
Expand this size up to match the aspect ratio of ratio.
Sourcepub fn centered_to(self, center: Point) -> Rectangle
pub fn centered_to(self, center: Point) -> Rectangle
Center a rectangle of this size at the given point.
Source§impl Size
impl Size
Sourcepub fn transposed(self) -> Self
pub fn transposed(self) -> Self
Return a size with width and height swapped.
Trait Implementations§
Source§impl DivAssign<f32> for Size
impl DivAssign<f32> for Size
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreSource§impl From<Size> for ControlValue
impl From<Size> for ControlValue
Source§impl From<Size> for libcamera_size_t
impl From<Size> for libcamera_size_t
Source§impl From<libcamera_size> for Size
impl From<libcamera_size> for Size
Source§fn from(s: libcamera_size_t) -> Self
fn from(s: libcamera_size_t) -> Self
Converts to this type from the input type.
Source§impl MulAssign<f32> for Size
impl MulAssign<f32> for Size
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl TryFrom<ControlValue> for Size
impl TryFrom<ControlValue> for Size
Source§type Error = ControlValueError
type Error = ControlValueError
The type returned in the event of a conversion error.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more