animator.skia.Path

class animator.skia.Path

Bases: pybind11_builtins.pybind11_object

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: animator.skia.Path) -> None

  2. __init__(self: animator.skia.Path, path: animator.skia.Path) -> None

Methods

Circle(center_x, center_y, radius, dir)

ConvertConicToQuads(p0, p1, p2, w, pow2)

Approximates conic represented by start point p0, control point p1, end point p2 and weight w, with quad array and returns it.

GetFromText(text, x, y, font, encoding)

Returns the path representing the text using SkTextUtils.

IsCubicDegenerate(p1, p2, p3, p4, exact)

IsLineDegenerate(p1, p2, exact)

IsQuadDegenerate(p1, p2, p3, exact)

Line(a, b)

Make(pts, vbs, ws, ft[, isVolatile])

Oval(*args, **kwargs)

Overloaded function.

Polygon(points, isClosed, ft, isVolatile)

Create a polygonal path from a list of points.

RRect(*args, **kwargs)

Overloaded function.

Rect(rect, dir, startIndex)

__init__(*args, **kwargs)

Overloaded function.

addArc(self, oval, startAngle, sweepAngle)

addCircle(self, x, y, radius, dir)

addOval(*args, **kwargs)

Overloaded function.

addPath(*args, **kwargs)

Overloaded function.

addPoly(self, pts, close)

Adds contour created from pts.

addRRect(*args, **kwargs)

Overloaded function.

addRect(*args, **kwargs)

Overloaded function.

addRoundRect(*args, **kwargs)

Overloaded function.

approximateBytesUsed(self)

arcTo(*args, **kwargs)

Overloaded function.

asWinding(self)

Return the result with fill type winding to area equivalent to path.

close(self)

computeTightBounds(self)

conicTo(*args, **kwargs)

Overloaded function.

conservativelyContainsRect(self, rect)

contains(self, x, y)

countPoints(self)

countVerbs(self)

cubicTo(*args, **kwargs)

Overloaded function.

dump(self)

dumpArrays(self)

dumpHex(self)

fillPathWithPaint(*args, **kwargs)

Overloaded function.

getBounds(self)

getFillType(self)

getGenerationID(self)

getLastPt(self)

Returns last point on Path.

getPoint(self, index)

getPoints(self[, max])

Returns a list of Point representing the points in the Path, up to a maximum of max points.

getSegmentMasks(self)

getVerbs(self[, max])

Returns a list of :py:enum:`Path.Verb` representing the verbs in the Path, up to a maximum of max verbs. If max is negative, return all verbs.

incReserve(self, extraPtCount)

interpolate(self, ending, weight)

Interpolates between Path with Point array of equal size and return the result.

iop(self, other, op)

Apply the op to this path and the specified path in place and return itself.

isConvex(self)

isEmpty(self)

isFinite(self)

isInterpolatable(self, compare)

isInverseFillType(self)

isLastContourClosed(self)

isLine(self)

If the Path contains only one line, return the start and end points as a list of two Point.

isOval(self[, oval])

isRRect(self[, rrect])

isRect(self)

Returns a tuple of (rect - storage for bounds of Rect, isClosed - if Path is closed, direction - Path direcion) if :py:class`Path` is equivalent to Rect when filled.

isValid(self)

isVolatile(self)

isimplify(self)

Simplify the path in place and return itself.

lineTo(*args, **kwargs)

Overloaded function.

makeOffset(self, dx, dy)

Offsets Point array by (dx, dy) and returns the result as a new Path.

makeScale(self, sx, sy)

makeTransform(self, m, pc)

moveTo(*args, **kwargs)

Overloaded function.

offset(self, dx, dy)

op(self, two, op)

Return the resultant path of applying the op to this path and the specified path.

quadTo(*args, **kwargs)

Overloaded function.

rArcTo(self, rx, ry, xAxisRotate, largeArc, ...)

rConicTo(self, dx1, dy1, dx2, dy2, w)

rCubicTo(self, dx1, dy1, dx2, dy2, dx3, dy3)

rLineTo(self, dx, dy)

rMoveTo(self, dx, dy)

rQuadTo(self, dx1, dy1, dx2, dy2)

readFromMemory(self, data)

Reads the path from the buffer and returns the number of bytes read.

reset(self)

reverseAddPath(self, src)

rewind(self)

serialize(self)

setFillType(self, ft)

setIsVolatile(self, isVolatile)

setLastPt(*args, **kwargs)

Overloaded function.

simplify(self)

Return the path as a set of non-overlapping contours that describe the same area as the original path.

swap(self, other)

tightBounds(self)

Return the resulting rectangle to the tight bounds of the path.

toggleInverseFillType(self)

transform(self, matrix, pc)

updateBoundsCache(self)

class AddPathMode

Bases: pybind11_builtins.pybind11_object

Members:

kAppend_AddPathMode

kExtend_AddPathMode

property name
class ArcSize

Bases: pybind11_builtins.pybind11_object

Members:

kSmall_ArcSize

kLarge_ArcSize

property name
static Circle(center_x: float, center_y: float, radius: float, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) animator.skia.Path
static ConvertConicToQuads(p0: animator.skia.Point, p1: animator.skia.Point, p2: animator.skia.Point, w: float, pow2: int) List[animator.skia.Point]

Approximates conic represented by start point p0, control point p1, end point p2 and weight w, with quad array and returns it. Maximum possible return array size is given by: (1 + 2 * (1 << pow2)).

static GetFromText(text: str, x: float, y: float, font: animator.skia.Font, encoding: animator.skia.TextEncoding = <TextEncoding.kUTF8: 0>) animator.skia.Path

Returns the path representing the text using SkTextUtils.

static IsCubicDegenerate(p1: animator.skia.Point, p2: animator.skia.Point, p3: animator.skia.Point, p4: animator.skia.Point, exact: bool) bool
static IsLineDegenerate(p1: animator.skia.Point, p2: animator.skia.Point, exact: bool) bool
static IsQuadDegenerate(p1: animator.skia.Point, p2: animator.skia.Point, p3: animator.skia.Point, exact: bool) bool
static Line(a: animator.skia.Point, b: animator.skia.Point) animator.skia.Path
static Make(pts: List[animator.skia.Point], vbs: List[int], ws: List[float], ft: animator.skia.PathFillType, isVolatile: bool = False) animator.skia.Path
static Oval(*args, **kwargs)

Overloaded function.

  1. Oval(r: animator.skia.Rect, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

  2. Oval(r: animator.skia.Rect, dir: animator.skia.PathDirection, startIndex: int) -> animator.skia.Path

static Polygon(points: List[animator.skia.Point], isClosed: bool, ft: animator.skia.PathFillType = <PathFillType.kWinding: 0>, isVolatile: bool = False) animator.skia.Path

Create a polygonal path from a list of points.

static RRect(*args, **kwargs)

Overloaded function.

  1. RRect(rr: animator.skia.RRect, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

  2. RRect(rr: animator.skia.RRect, dir: animator.skia.PathDirection, startIndex: int) -> animator.skia.Path

  3. RRect(bounds: animator.skia.Rect, rx: float, ry: float, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

static Rect(rect: animator.skia.Rect, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>, startIndex: int = 0) animator.skia.Path
class SegmentMask

Bases: pybind11_builtins.pybind11_object

Members:

kLine_SegmentMask

kQuad_SegmentMask

kConic_SegmentMask

kCubic_SegmentMask

property name
class Verb

Bases: pybind11_builtins.pybind11_object

Members:

kMove_Verb

kLine_Verb

kQuad_Verb

kConic_Verb

kCubic_Verb

kClose_Verb

kDone_Verb

property name
addArc(self: animator.skia.Path, oval: animator.skia.Rect, startAngle: float, sweepAngle: float) animator.skia.Path
addCircle(self: animator.skia.Path, x: float, y: float, radius: float, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) animator.skia.Path
addOval(*args, **kwargs)

Overloaded function.

  1. addOval(self: animator.skia.Path, oval: animator.skia.Rect, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

  2. addOval(self: animator.skia.Path, oval: animator.skia.Rect, dir: animator.skia.PathDirection, start: int) -> animator.skia.Path

addPath(*args, **kwargs)

Overloaded function.

  1. addPath(self: animator.skia.Path, src: animator.skia.Path, dx: float, dy: float, mode: animator.skia.Path.AddPathMode = <AddPathMode.kAppend_AddPathMode: 0>) -> animator.skia.Path

  2. addPath(self: animator.skia.Path, src: animator.skia.Path, mode: animator.skia.Path.AddPathMode = <AddPathMode.kAppend_AddPathMode: 0>) -> animator.skia.Path

  3. addPath(self: animator.skia.Path, src: animator.skia.Path, matrix: animator.skia.Matrix, mode: animator.skia.Path.AddPathMode = <AddPathMode.kAppend_AddPathMode: 0>) -> animator.skia.Path

addPoly(self: animator.skia.Path, pts: List[animator.skia.Point], close: bool) animator.skia.Path

Adds contour created from pts.

addRRect(*args, **kwargs)

Overloaded function.

  1. addRRect(self: animator.skia.Path, rrect: animator.skia.RRect, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

  2. addRRect(self: animator.skia.Path, rrect: animator.skia.RRect, dir: animator.skia.PathDirection, start: int) -> animator.skia.Path

addRect(*args, **kwargs)

Overloaded function.

  1. addRect(self: animator.skia.Path, rect: animator.skia.Rect, dir: animator.skia.PathDirection, start: int) -> animator.skia.Path

  2. addRect(self: animator.skia.Path, rect: animator.skia.Rect, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

  3. addRect(self: animator.skia.Path, left: float, top: float, right: float, bottom: float, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

addRoundRect(*args, **kwargs)

Overloaded function.

  1. addRoundRect(self: animator.skia.Path, rect: animator.skia.Rect, rx: float, ry: float, dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

  2. addRoundRect(self: animator.skia.Path, rect: animator.skia.Rect, radii: List[float], dir: animator.skia.PathDirection = <PathDirection.kCW: 0>) -> animator.skia.Path

approximateBytesUsed(self: animator.skia.Path) int
arcTo(*args, **kwargs)

Overloaded function.

  1. arcTo(self: animator.skia.Path, oval: animator.skia.Rect, startAngle: float, sweepAngle: float, forceMoveTo: bool) -> animator.skia.Path

  2. arcTo(self: animator.skia.Path, x1: float, y1: float, x2: float, y2: float, radius: float) -> animator.skia.Path

  3. arcTo(self: animator.skia.Path, p1: animator.skia.Point, p2: animator.skia.Point, radius: float) -> animator.skia.Path

  4. arcTo(self: animator.skia.Path, rx: float, ry: float, xAxisRotate: float, largeArc: animator.skia.Path.ArcSize, sweep: animator.skia.PathDirection, x: float, y: float) -> animator.skia.Path

  5. arcTo(self: animator.skia.Path, r: animator.skia.Point, xAxisRotate: float, largeArc: animator.skia.Path.ArcSize, sweep: animator.skia.PathDirection, xy: animator.skia.Point) -> animator.skia.Path

asWinding(self: animator.skia.Path) animator.skia.Path

Return the result with fill type winding to area equivalent to path. If the conversion fails, throws a runtime error.

close(self: animator.skia.Path) animator.skia.Path
computeTightBounds(self: animator.skia.Path) animator.skia.Rect
conicTo(*args, **kwargs)

Overloaded function.

  1. conicTo(self: animator.skia.Path, x1: float, y1: float, x2: float, y2: float, w: float) -> animator.skia.Path

  2. conicTo(self: animator.skia.Path, p1: animator.skia.Point, p2: animator.skia.Point, w: float) -> animator.skia.Path

conservativelyContainsRect(self: animator.skia.Path, rect: animator.skia.Rect) bool
contains(self: animator.skia.Path, x: float, y: float) bool
countPoints(self: animator.skia.Path) int
countVerbs(self: animator.skia.Path) int
cubicTo(*args, **kwargs)

Overloaded function.

  1. cubicTo(self: animator.skia.Path, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float) -> animator.skia.Path

  2. cubicTo(self: animator.skia.Path, p1: animator.skia.Point, p2: animator.skia.Point, p3: animator.skia.Point) -> animator.skia.Path

dump(self: animator.skia.Path) None
dumpArrays(self: animator.skia.Path) None
dumpHex(self: animator.skia.Path) None
fillPathWithPaint(*args, **kwargs)

Overloaded function.

  1. fillPathWithPaint(self: animator.skia.Path, paint: SkPaint, cullRect: animator.skia.Rect = None, resScale: float = 1) -> tuple

    Returns the filled equivalent of the stroked path.

    param paint

    Paint from which attributes such as stroke cap, width, miter, and join, as well as pathEffect will be used

    param cullRect

    optional limit passed to PathEffect

    param resScale

    if > 1, increase precision, else if (0 < resScale < 1) reduce precision to favor speed and size

    return

    a tuple of (Path, bool) where the bool indicates whether the path represents style fill or hairline (true for fill, false for hairline)

  2. fillPathWithPaint(self: animator.skia.Path, paint: SkPaint, cullRect: animator.skia.Rect, ctm: animator.skia.Matrix) -> tuple

Returns the filled equivalent of the stroked path.

getBounds(self: animator.skia.Path) animator.skia.Rect
getFillType(self: animator.skia.Path) animator.skia.PathFillType
getGenerationID(self: animator.skia.Path) int
getLastPt(self: animator.skia.Path) Optional[animator.skia.Point]

Returns last point on Path. Returns None if Point array is empty.

getPoint(self: animator.skia.Path, index: int) animator.skia.Point
getPoints(self: animator.skia.Path, max: int = - 1) List[animator.skia.Point]

Returns a list of Point representing the points in the Path, up to a maximum of max points. If max is negative, return all points.

getSegmentMasks(self: animator.skia.Path) int
getVerbs(self: animator.skia.Path, max: int = - 1) List[animator.skia.Path.Verb]

Returns a list of :py:enum:`Path.Verb` representing the verbs in the Path, up to a maximum of max verbs. If max is negative, return all verbs.

incReserve(self: animator.skia.Path, extraPtCount: int) None
interpolate(self: animator.skia.Path, ending: animator.skia.Path, weight: float) Optional[animator.skia.Path]

Interpolates between Path with Point array of equal size and return the result. If arrays were not equal size, returns None.

Parameters
  • endingPoint array averaged with this Point array

  • weight – contribution of this Point array, and one minus contribution of ending Point array

Returns

interpolated average or None

Return type

Path | None

iop(self: animator.skia.Path, other: animator.skia.Path, op: animator.skia.PathOp) animator.skia.Path

Apply the op to this path and the specified path in place and return itself. If the operation fails, throws a runtime error.

isConvex(self: animator.skia.Path) bool
isEmpty(self: animator.skia.Path) bool
isFinite(self: animator.skia.Path) bool
isInterpolatable(self: animator.skia.Path, compare: animator.skia.Path) bool
isInverseFillType(self: animator.skia.Path) bool
isLastContourClosed(self: animator.skia.Path) bool
isLine(self: animator.skia.Path) Optional[List[animator.skia.Point]]

If the Path contains only one line, return the start and end points as a list of two Point. If the Path is not one line, return None.

Returns

start and end points of the line or None

Return type

List[Point] | None

isOval(self: animator.skia.Path, oval: animator.skia.Rect = None) bool
isRRect(self: animator.skia.Path, rrect: animator.skia.RRect = None) bool
isRect(self: animator.skia.Path) Optional[tuple]

Returns a tuple of (rect - storage for bounds of Rect, isClosed - if Path is closed, direction - Path direcion) if :py:class`Path` is equivalent to Rect when filled. Otherwise returns None.

Return type

Tuple[Rect, bool, :py:enum:`PathDirection`] | None

isValid(self: animator.skia.Path) bool
isVolatile(self: animator.skia.Path) bool
isimplify(self: animator.skia.Path) animator.skia.Path

Simplify the path in place and return itself. If the simplify fails, throws a runtime error.

lineTo(*args, **kwargs)

Overloaded function.

  1. lineTo(self: animator.skia.Path, x: float, y: float) -> animator.skia.Path

  2. lineTo(self: animator.skia.Path, p: animator.skia.Point) -> animator.skia.Path

makeOffset(self: animator.skia.Path, dx: float, dy: float) animator.skia.Path

Offsets Point array by (dx, dy) and returns the result as a new Path.

makeScale(self: animator.skia.Path, sx: float, sy: float) animator.skia.Path
makeTransform(self: animator.skia.Path, m: animator.skia.Matrix, pc: animator.skia.ApplyPerspectiveClip = <ApplyPerspectiveClip.kYes: 1>) animator.skia.Path
moveTo(*args, **kwargs)

Overloaded function.

  1. moveTo(self: animator.skia.Path, x: float, y: float) -> animator.skia.Path

  2. moveTo(self: animator.skia.Path, p: animator.skia.Point) -> animator.skia.Path

offset(self: animator.skia.Path, dx: float, dy: float) None
op(self: animator.skia.Path, two: animator.skia.Path, op: animator.skia.PathOp) animator.skia.Path

Return the resultant path of applying the op to this path and the specified path. If the operation fails, throws a runtime error.

quadTo(*args, **kwargs)

Overloaded function.

  1. quadTo(self: animator.skia.Path, x1: float, y1: float, x2: float, y2: float) -> animator.skia.Path

  2. quadTo(self: animator.skia.Path, p1: animator.skia.Point, p2: animator.skia.Point) -> animator.skia.Path

rArcTo(self: animator.skia.Path, rx: float, ry: float, xAxisRotate: float, largeArc: animator.skia.Path.ArcSize, sweep: animator.skia.PathDirection, dx: float, dy: float) animator.skia.Path
rConicTo(self: animator.skia.Path, dx1: float, dy1: float, dx2: float, dy2: float, w: float) animator.skia.Path
rCubicTo(self: animator.skia.Path, dx1: float, dy1: float, dx2: float, dy2: float, dx3: float, dy3: float) animator.skia.Path
rLineTo(self: animator.skia.Path, dx: float, dy: float) animator.skia.Path
rMoveTo(self: animator.skia.Path, dx: float, dy: float) animator.skia.Path
rQuadTo(self: animator.skia.Path, dx1: float, dy1: float, dx2: float, dy2: float) animator.skia.Path
readFromMemory(self: animator.skia.Path, data: buffer) int

Reads the path from the buffer and returns the number of bytes read.

reset(self: animator.skia.Path) animator.skia.Path
reverseAddPath(self: animator.skia.Path, src: animator.skia.Path) animator.skia.Path
rewind(self: animator.skia.Path) animator.skia.Path
serialize(self: animator.skia.Path) animator.skia.Data
setFillType(self: animator.skia.Path, ft: animator.skia.PathFillType) None
setIsVolatile(self: animator.skia.Path, isVolatile: bool) animator.skia.Path
setLastPt(*args, **kwargs)

Overloaded function.

  1. setLastPt(self: animator.skia.Path, x: float, y: float) -> None

  2. setLastPt(self: animator.skia.Path, p: animator.skia.Point) -> None

simplify(self: animator.skia.Path) animator.skia.Path

Return the path as a set of non-overlapping contours that describe the same area as the original path. If the simplify fails, throws a runtime error.

swap(self: animator.skia.Path, other: animator.skia.Path) None
tightBounds(self: animator.skia.Path) animator.skia.Rect

Return the resulting rectangle to the tight bounds of the path.

toggleInverseFillType(self: animator.skia.Path) None
transform(self: animator.skia.Path, matrix: animator.skia.Matrix, pc: animator.skia.ApplyPerspectiveClip = <ApplyPerspectiveClip.kYes: 1>) None
updateBoundsCache(self: animator.skia.Path) None