animator.skia.Rect¶
- class animator.skia.Rect¶
Bases:
pybind11_builtins.pybind11_object
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: animator.skia.Rect, t: tuple) -> None
Create an
Rect
from a tuple of 0, 2, or 4 floats.__init__(self: animator.skia.Rect) -> None
Constructs a
Rect
set to (0, 0, 0, 0). Many other rectangles are empty; if left is equal to or greater than right, or if top is equal to or greater than bottom. Setting all members to zero is a convenience, but does not designate a special empty rectangle.__init__(self: animator.skia.Rect, w: float, h: float) -> None
__init__(self: animator.skia.Rect, size: animator.skia.Size) -> None
__init__(self: animator.skia.Rect, l: float, t: float, r: float, b: float) -> None
__init__(self: animator.skia.Rect, size: animator.skia.ISize) -> None
__init__(self: animator.skia.Rect, irect: animator.skia.IRect) -> None
Constructs a
Rect
set to iRect, promoting integer to floats. Does not validate input; fLeft may be greater than fRight, fTop may be greater than fBottom.
Methods
Intersects
(a, b)Make
(*args, **kwargs)Overloaded function.
MakeIWH
(w, h)MakeLTRB
(l, t, r, b)MakeSize
(size)MakeWH
(w, h)MakeXYWH
(x, y, w, h)__init__
(*args, **kwargs)Overloaded function.
asScalars
(self)Returns a
memoryview
ofScalar
containing theRect
's coordinates.bottom
(self)center
(self)centerX
(self)centerY
(self)contains
(*args, **kwargs)Overloaded function.
dump
(self[, asHex])dumpHex
(self)height
(self)inset
(self, dx, dy)intersect
(*args, **kwargs)Overloaded function.
intersects
(self, r)isEmpty
(self)isFinite
(self)isSorted
(self)join
(self, r)joinNonEmptyArg
(self, r)joinPossiblyEmptyRect
(self, r)left
(self)makeInset
(self, dx, dy)makeOffset
(*args, **kwargs)Overloaded function.
makeOutset
(self, dx, dy)makeSorted
(self)offset
(*args, **kwargs)Overloaded function.
offsetTo
(self, newX, newY)outset
(self, dx, dy)right
(self)round
(self)roundIn
(self)roundOut
(self)set
(*args, **kwargs)Overloaded function.
setBounds
(self, points)Sets to bounds of
Point
list.setBoundsCheck
(self, points)Same as
setBounds()
but returnsFalse
if list is empty or contains an infinity or NaN.setBoundsNoCheck
(self, points)Sets to bounds of
Point
list.setEmpty
(self)setIWH
(self, width, height)setLTRB
(self, left, top, right, bottom)setWH
(self, width, height)setXYWH
(self, x, y, width, height)sort
(self)toQuad
(self)Returns four points in quad that enclose
Rect
ordered as: top-left, top-right, bottom-right, bottom-left.top
(self)width
(self)x
(self)y
(self)Attributes
fBottom
fLeft
fRight
fTop
- static Intersects(a: animator.skia.Rect, b: animator.skia.Rect) bool ¶
- static Make(*args, **kwargs)¶
Overloaded function.
Make(size: animator.skia.ISize) -> animator.skia.Rect
Make(irect: animator.skia.IRect) -> animator.skia.Rect
- static MakeEmpty() animator.skia.Rect ¶
- static MakeIWH(w: int, h: int) animator.skia.Rect ¶
- static MakeSize(size: animator.skia.Size) animator.skia.Rect ¶
- static MakeWH(w: float, h: float) animator.skia.Rect ¶
- asScalars(self: animator.skia.Rect) memoryview ¶
Returns a
memoryview
ofScalar
containing theRect
’s coordinates.
- bottom(self: animator.skia.Rect) float ¶
- center(self: animator.skia.Rect) animator.skia.Point ¶
- centerX(self: animator.skia.Rect) float ¶
- centerY(self: animator.skia.Rect) float ¶
- contains(*args, **kwargs)¶
Overloaded function.
contains(self: animator.skia.Rect, x: float, y: float) -> bool
contains(self: animator.skia.Rect, r: animator.skia.Rect) -> bool
contains(self: animator.skia.Rect, r: animator.skia.IRect) -> bool
- dump(self: animator.skia.Rect, asHex: bool = False) None ¶
- dumpHex(self: animator.skia.Rect) None ¶
- height(self: animator.skia.Rect) float ¶
- inset(self: animator.skia.Rect, dx: float, dy: float) None ¶
- intersect(*args, **kwargs)¶
Overloaded function.
intersect(self: animator.skia.Rect, r: animator.skia.Rect) -> bool
intersect(self: animator.skia.Rect, a: animator.skia.Rect, b: animator.skia.Rect) -> bool
- intersects(self: animator.skia.Rect, r: animator.skia.Rect) bool ¶
- isEmpty(self: animator.skia.Rect) bool ¶
- isFinite(self: animator.skia.Rect) bool ¶
- isSorted(self: animator.skia.Rect) bool ¶
- join(self: animator.skia.Rect, r: animator.skia.Rect) None ¶
- joinNonEmptyArg(self: animator.skia.Rect, r: animator.skia.Rect) None ¶
- joinPossiblyEmptyRect(self: animator.skia.Rect, r: animator.skia.Rect) None ¶
- left(self: animator.skia.Rect) float ¶
- makeInset(self: animator.skia.Rect, dx: float, dy: float) animator.skia.Rect ¶
- makeOffset(*args, **kwargs)¶
Overloaded function.
makeOffset(self: animator.skia.Rect, dx: float, dy: float) -> animator.skia.Rect
makeOffset(self: animator.skia.Rect, v: animator.skia.Point) -> animator.skia.Rect
- makeOutset(self: animator.skia.Rect, dx: float, dy: float) animator.skia.Rect ¶
- makeSorted(self: animator.skia.Rect) animator.skia.Rect ¶
- offset(*args, **kwargs)¶
Overloaded function.
offset(self: animator.skia.Rect, dx: float, dy: float) -> None
offset(self: animator.skia.Rect, delta: animator.skia.Point) -> None
- offsetTo(self: animator.skia.Rect, newX: float, newY: float) None ¶
- outset(self: animator.skia.Rect, dx: float, dy: float) None ¶
- right(self: animator.skia.Rect) float ¶
- round(self: animator.skia.Rect) animator.skia.IRect ¶
- roundIn(self: animator.skia.Rect) animator.skia.IRect ¶
- roundOut(self: animator.skia.Rect) animator.skia.IRect ¶
- set(*args, **kwargs)¶
Overloaded function.
set(self: animator.skia.Rect, src: animator.skia.IRect) -> None
set(self: animator.skia.Rect, p0: animator.skia.Point, p1: animator.skia.Point) -> None
- setBounds(self: animator.skia.Rect, points: List[animator.skia.Point]) None ¶
Sets to bounds of
Point
list. If list is empty, or contains an infinity or NaN, sets to (0, 0, 0, 0). Result is either empty or sorted: fLeft is less than or equal to fRight, and fTop is less than or equal to fBottom.
- setBoundsCheck(self: animator.skia.Rect, points: List[animator.skia.Point]) bool ¶
Same as
setBounds()
but returnsFalse
if list is empty or contains an infinity or NaN.
- setBoundsNoCheck(self: animator.skia.Rect, points: List[animator.skia.Point]) None ¶
Sets to bounds of
Point
list. If any point is infinity or NaN, allRect
dimensions are set to NaN.
- setEmpty(self: animator.skia.Rect) None ¶
- setIWH(self: animator.skia.Rect, width: int, height: int) None ¶
- setWH(self: animator.skia.Rect, width: float, height: float) None ¶
- sort(self: animator.skia.Rect) None ¶
- toQuad(self: animator.skia.Rect) List[animator.skia.Point] ¶
Returns four points in quad that enclose
Rect
ordered as: top-left, top-right, bottom-right, bottom-left.- Returns
list of four
Point
objects
- top(self: animator.skia.Rect) float ¶
- width(self: animator.skia.Rect) float ¶
- x(self: animator.skia.Rect) float ¶
- y(self: animator.skia.Rect) float ¶