[][src]Struct skia_safe::Rect

#[repr(C)]
pub struct Rect {
    pub left: scalar,
    pub top: scalar,
    pub right: scalar,
    pub bottom: scalar,
}

Fields

left: scalartop: scalarright: scalarbottom: scalar

Methods

impl Rect[src]

pub fn new(left: scalar, top: scalar, right: scalar, bottom: scalar) -> Self[src]

pub fn new_empty() -> Self[src]

pub fn from_wh(w: scalar, h: scalar) -> Self[src]

pub fn from_iwh(w: i32, h: i32) -> Self[src]

pub fn from_size(size: impl Into<Size>) -> Self[src]

pub fn from_xywh(x: scalar, y: scalar, w: scalar, h: scalar) -> Self[src]

pub fn from_point_and_size(p: impl Into<Point>, sz: impl Into<Size>) -> Self[src]

pub fn from_isize(isize: impl Into<ISize>) -> Self[src]

pub fn from_irect(irect: impl AsRef<IRect>) -> Self[src]

pub fn is_empty(&self) -> bool[src]

pub fn is_sorted(&self) -> bool[src]

pub fn is_finite(&self) -> bool[src]

pub fn left_top(&self) -> Point[src]

Deprecated since 0.12.0:

removed without replacement

pub fn x(&self) -> scalar[src]

pub fn y(&self) -> scalar[src]

pub fn left(&self) -> scalar[src]

pub fn top(&self) -> scalar[src]

pub fn right(&self) -> scalar[src]

pub fn bottom(&self) -> scalar[src]

pub fn size(&self) -> Size[src]

pub fn width(&self) -> scalar[src]

pub fn height(&self) -> scalar[src]

pub fn center(&self) -> Point[src]

pub fn center_x(&self) -> scalar[src]

pub fn center_y(&self) -> scalar[src]

pub fn to_quad(&self) -> [Point; 4][src]

pub fn set_empty(&mut self)[src]

pub fn set_irect(&mut self, irect: impl AsRef<IRect>)[src]

pub fn set(&mut self, left: scalar, top: scalar, right: scalar, bottom: scalar)[src]

pub fn set_ltrb(
    &mut self,
    left: scalar,
    top: scalar,
    right: scalar,
    bottom: scalar
)
[src]

pub fn iset(&mut self, left: i32, top: i32, right: i32, bottom: i32)[src]

pub fn iset_wh(&mut self, width: i32, height: i32)[src]

pub fn set_bounds(&mut self, points: &[Point])[src]

pub fn set_bounds_check(&mut self, points: &[Point]) -> bool[src]

pub fn set_bounds_no_check(&mut self, points: &[Point])[src]

pub fn set_bounds2(&mut self, p0: impl Into<Point>, p1: impl Into<Point>)[src]

pub fn from_bounds(points: &[Point]) -> Option<Self>[src]

pub fn set_xywh(&mut self, x: scalar, y: scalar, width: scalar, height: scalar)[src]

pub fn set_wh(&mut self, w: scalar, h: scalar)[src]

pub fn with_offset(&self, d: impl Into<Vector>) -> Self[src]

pub fn with_inset(&self, d: impl Into<Vector>) -> Self[src]

pub fn with_outset(&self, d: impl Into<Vector>) -> Self[src]

pub fn offset(&mut self, d: impl Into<Vector>)[src]

pub fn offset_to(&mut self, new_p: impl Into<Point>)[src]

pub fn with_offset_to(&self, new_p: impl Into<Point>) -> Self[src]

pub fn inset(&mut self, d: impl Into<Vector>)[src]

pub fn outset(&mut self, d: impl Into<Vector>)[src]

pub fn intersect(&mut self, r: impl AsRef<Rect>) -> bool[src]

pub fn intersect_ltrb(
    &mut self,
    left: scalar,
    top: scalar,
    right: scalar,
    bottom: scalar
) -> bool
[src]

#[must_use] pub fn intersect2(&mut self, a: impl AsRef<Rect>, b: impl AsRef<Rect>) -> bool[src]

pub fn intersects_ltrb(
    &self,
    left: scalar,
    top: scalar,
    right: scalar,
    bottom: scalar
) -> bool
[src]

pub fn intersects(&self, r: impl AsRef<Rect>) -> bool[src]

pub fn intersects2(a: impl AsRef<Rect>, b: impl AsRef<Rect>) -> bool[src]

pub fn join_ltrb(
    &mut self,
    left: scalar,
    top: scalar,
    right: scalar,
    bottom: scalar
)
[src]

pub fn join(&mut self, r: impl AsRef<Rect>)[src]

pub fn join2(a: impl AsRef<Rect>, b: impl AsRef<Rect>) -> Rect[src]

pub fn join_non_empty_arg(&mut self, r: impl AsRef<Rect>)[src]

pub fn join_possibly_empty_rect(&mut self, r: impl AsRef<Rect>)[src]

#[must_use] pub fn round(&self) -> IRect[src]

#[must_use] pub fn round_in(&self) -> IRect[src]

pub fn sort(&mut self)[src]

#[must_use] pub fn sorted(&self) -> Rect[src]

pub fn as_scalars(&self) -> &[scalar; 4][src]

pub fn dump(&self, as_hex: impl Into<Option<bool>>)[src]

pub fn dump_hex(&self)[src]

Trait Implementations

impl RoundOut<IRect> for Rect[src]

impl RoundOut<Rect> for Rect[src]

impl<'_> Contains<&'_ Rect> for IRect[src]

impl Contains<Rect> for IRect[src]

impl Contains<Point> for Rect[src]

impl Contains<Rect> for Rect[src]

impl Contains<IRect> for Rect[src]

impl QuickReject<Rect> for Canvas[src]

impl Default for Rect[src]

impl Clone for Rect[src]

impl PartialEq<Rect> for Rect[src]

impl AsRef<Rect> for Rect[src]

impl From<(Point, Size)> for Rect[src]

impl From<ISize> for Rect[src]

impl From<IRect> for Rect[src]

impl Copy for Rect[src]

impl Debug for Rect[src]

Auto Trait Implementations

impl Send for Rect

impl Unpin for Rect

impl Sync for Rect

impl UnwindSafe for Rect

impl RefUnwindSafe for Rect

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]