pub struct Rectangle {
pub x: i32,
pub y: i32,
pub width: u32,
pub height: u32,
}Expand description
Represents libcamera::Rectangle
Fields§
§x: i32§y: i32§width: u32§height: u32Implementations§
Source§impl Rectangle
impl Rectangle
pub fn size(&self) -> Size
Sourcepub fn bounded_to(self, bound: Rectangle) -> Rectangle
pub fn bounded_to(self, bound: Rectangle) -> Rectangle
Intersection of this rectangle with another.
Sourcepub fn enclosed_in(self, boundary: Rectangle) -> Rectangle
pub fn enclosed_in(self, boundary: Rectangle) -> Rectangle
Translate the rectangle so it remains enclosed within the given boundary.
Sourcepub fn translated_by(self, delta: Point) -> Rectangle
pub fn translated_by(self, delta: Point) -> Rectangle
Return a translated rectangle.
Trait Implementations§
Source§impl From<Rectangle> for ControlValue
impl From<Rectangle> for ControlValue
Source§impl From<Rectangle> for libcamera_rectangle_t
impl From<Rectangle> for libcamera_rectangle_t
Source§impl From<libcamera_rectangle> for Rectangle
impl From<libcamera_rectangle> for Rectangle
Source§fn from(r: libcamera_rectangle_t) -> Self
fn from(r: libcamera_rectangle_t) -> Self
Converts to this type from the input type.
Source§impl TryFrom<ControlValue> for Rectangle
impl TryFrom<ControlValue> for Rectangle
Source§type Error = ControlValueError
type Error = ControlValueError
The type returned in the event of a conversion error.
impl Copy for Rectangle
Auto Trait Implementations§
impl Freeze for Rectangle
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnwindSafe for Rectangle
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