pub struct RectF32 {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}Expand description
Data type for rect f32.
Fields§
§x: f32The x value.
y: f32The y value.
width: f32Width in pixels.
height: f32Height in pixels.
Implementations§
Source§impl RectF32
impl RectF32
Sourcepub fn contains_point(self, point: Point2f) -> Result<bool>
pub fn contains_point(self, point: Point2f) -> Result<bool>
Returns contains point.
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.
Trait Implementations§
impl Copy for RectF32
Source§impl<'de> Deserialize<'de> for RectF32
impl<'de> Deserialize<'de> for RectF32
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 StructuralPartialEq for RectF32
Auto Trait Implementations§
impl Freeze for RectF32
impl RefUnwindSafe for RectF32
impl Send for RectF32
impl Sync for RectF32
impl Unpin for RectF32
impl UnsafeUnpin for RectF32
impl UnwindSafe for RectF32
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