animator.skia.Rect

class animator.skia.Rect

Bases: pybind11_builtins.pybind11_object

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: animator.skia.Rect, t: tuple) -> None

Create an Rect from a tuple of 0, 2, or 4 floats.

  1. __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.

  2. __init__(self: animator.skia.Rect, w: float, h: float) -> None

    Constructs a Rect set to (0, 0, w, h). Does not validate input; w or h may be negative.

    param float w

    width of constructed Rect

    param float h

    height of constructed Rect

  3. __init__(self: animator.skia.Rect, size: animator.skia.Size) -> None

    Constructs a Rect set to (0, 0, size.width(), size.height()). Does not validate input; size.width() or size.height() may be negative.

    param Size size

    values for Rect width and height

  4. __init__(self: animator.skia.Rect, l: float, t: float, r: float, b: float) -> None

    Constructs a Rect set to (l, t, r, b). Does not sort input; Rect may result in fLeft greater than fRight, or fTop greater than fBottom.

    param float l

    stored in fLeft

    param float t

    stored in fTop

    param float r

    stored in fRight

    param float b

    stored in fBottom

  5. __init__(self: animator.skia.Rect, size: animator.skia.ISize) -> None

    Constructs a Rect set to (0, 0, size.width(), size.height()). Does not validate input; size.width() or size.height() may be negative.

    param ISize size

    values for Rect width and height

  6. __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.

MakeEmpty()

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 of Scalar containing the Rect'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 returns False 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.

  1. Make(size: animator.skia.ISize) -> animator.skia.Rect

  2. Make(irect: animator.skia.IRect) -> animator.skia.Rect

static MakeEmpty() animator.skia.Rect
static MakeIWH(w: int, h: int) animator.skia.Rect
static MakeLTRB(l: float, t: float, r: float, b: float) animator.skia.Rect
static MakeSize(size: animator.skia.Size) animator.skia.Rect
static MakeWH(w: float, h: float) animator.skia.Rect
static MakeXYWH(x: float, y: float, w: float, h: float) animator.skia.Rect
asScalars(self: animator.skia.Rect) memoryview

Returns a memoryview of Scalar containing the Rect’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.

  1. contains(self: animator.skia.Rect, x: float, y: float) -> bool

  2. contains(self: animator.skia.Rect, r: animator.skia.Rect) -> bool

  3. 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.

  1. intersect(self: animator.skia.Rect, r: animator.skia.Rect) -> bool

  2. 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.

  1. makeOffset(self: animator.skia.Rect, dx: float, dy: float) -> animator.skia.Rect

  2. 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.

  1. offset(self: animator.skia.Rect, dx: float, dy: float) -> None

  2. 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.

  1. set(self: animator.skia.Rect, src: animator.skia.IRect) -> None

  2. 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.

Parameters

points (Point[]) – Point array

setBoundsCheck(self: animator.skia.Rect, points: List[animator.skia.Point]) bool

Same as setBounds() but returns False 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, all Rect dimensions are set to NaN.

setEmpty(self: animator.skia.Rect) None
setIWH(self: animator.skia.Rect, width: int, height: int) None
setLTRB(self: animator.skia.Rect, left: float, top: float, right: float, bottom: float) None
setWH(self: animator.skia.Rect, width: float, height: float) None
setXYWH(self: animator.skia.Rect, x: float, y: float, 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