pub struct RectU32 {
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
}Expand description
Data type for rect u32.
Fields§
§x: u32The x value.
y: u32The y value.
width: u32Width in pixels.
height: u32Height in pixels.
Implementations§
Source§impl RectU32
impl RectU32
Sourcepub fn intersects(self, other: Self) -> Result<bool>
pub fn intersects(self, other: Self) -> Result<bool>
Returns intersects.
Sourcepub fn intersection(self, other: Self) -> Result<Option<Self>>
pub fn intersection(self, other: Self) -> Result<Option<Self>>
Returns intersection.
Sourcepub fn iou(self, other: Self) -> Result<f32>
pub fn iou(self, other: Self) -> Result<f32>
Returns intersection-over-union for two rectangles.
Sourcepub fn overlap_ratio(self, other: Self) -> Result<f32>
pub fn overlap_ratio(self, other: Self) -> Result<f32>
Returns the intersection area divided by this rectangle area.
Sourcepub fn center_f32(self) -> Point2f
pub fn center_f32(self) -> Point2f
Returns center f32.
Trait Implementations§
impl Copy for RectU32
Source§impl<'de> Deserialize<'de> for RectU32
impl<'de> Deserialize<'de> for RectU32
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RectU32
impl StructuralPartialEq for RectU32
Auto Trait Implementations§
impl Freeze for RectU32
impl RefUnwindSafe for RectU32
impl Send for RectU32
impl Sync for RectU32
impl Unpin for RectU32
impl UnsafeUnpin for RectU32
impl UnwindSafe for RectU32
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