PathBuilder
- class PathBuilder
Classes
Members:
Methods
Overloaded function.
Appends arc to the builder, as the start of new contour.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
the builder is reset to empty after returning this path
Overloaded function.
Overloaded function.
Overloaded function.
Append a series of lineTo(...)
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
the builder is unchanged after returning this path
Attributes
Methods
- PathBuilder.__init__(*args, **kwargs)
Overloaded function.
__init__(self: skia.PathBuilder) -> None
__init__(self: skia.PathBuilder, path: skia.Path) -> None
- PathBuilder.addArc(self: skia.PathBuilder, oval: skia.Rect, startAngleDeg: float, sweepAngleDeg: float) skia.PathBuilder
Appends arc to the builder, as the start of new contour. Arc added is part of ellipse bounded by oval, from startAngle through sweepAngle. Both startAngle and sweepAngle are measured in degrees, where zero degrees is aligned with the positive x-axis, and positive sweeps extends arc clockwise.
If sweepAngle <= -360, or sweepAngle >= 360; and startAngle modulo 90 is nearly zero, append oval instead of arc. Otherwise, sweepAngle values are treated modulo 360, and arc may or may not draw depending on numeric rounding.
- Parameters:
oval – bounds of ellipse containing arc
startAngleDeg – starting angle of arc in degrees
sweepAngleDeg – sweep, in degrees. Positive is clockwise; treated modulo 360
- Returns:
reference to this builder
- PathBuilder.addCircle(self: skia.PathBuilder, center_x: float, center_y: float, radius: float, pathDirection: skia.PathDirection = skia.PathDirection.kCW) skia.PathBuilder
- PathBuilder.addOval(*args, **kwargs)
Overloaded function.
addOval(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection, startIndex: int) -> skia.PathBuilder
addOval(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection = skia.PathDirection.kCW) -> skia.PathBuilder
- PathBuilder.addPolygon(self: skia.PathBuilder, points: list[skia.Point], isClosed: bool) skia.PathBuilder
- PathBuilder.addRRect(*args, **kwargs)
Overloaded function.
addRRect(self: skia.PathBuilder, rrect: skia.RRect, pathDirection: skia.PathDirection, startIndex: int) -> skia.PathBuilder
addRRect(self: skia.PathBuilder, rrect: skia.RRect, pathDirection: skia.PathDirection = skia.PathDirection.kCW) -> skia.PathBuilder
- PathBuilder.addRect(*args, **kwargs)
Overloaded function.
addRect(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection, startIndex: int) -> skia.PathBuilder
addRect(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection = skia.PathDirection.kCW) -> skia.PathBuilder
- PathBuilder.arcTo(*args, **kwargs)
Overloaded function.
arcTo(self: skia.PathBuilder, oval: skia.Rect, startAngleDeg: float, sweepAngleDeg: float, forceMoveTo: bool) -> skia.PathBuilder
Appends arc to the builder. Arc added is part of ellipse bounded by oval, from startAngle through sweepAngle. Both startAngle and sweepAngle are measured in degrees, where zero degrees is aligned with the positive x-axis, and positive sweeps extends arc clockwise.
arcTo() adds line connecting the builder’s last point to initial arc point if forceMoveTo is false and the builder is not empty. Otherwise, added contour begins with first point of arc. Angles greater than -360 and less than 360 are treated modulo 360.
- param oval:
bounds of ellipse containing arc
- param startAngleDeg:
starting angle of arc in degrees
- param sweepAngleDeg:
sweep, in degrees. Positive is clockwise; treated modulo 360
- param forceMoveTo:
true to start a new contour with arc
- return:
reference to the builder
arcTo(self: skia.PathBuilder, p1: skia.Point, p2: skia.Point, radius: float) -> skia.PathBuilder
Appends arc to
Path
, after appending line if needed. Arc is implemented by conic weighted to describe part of circle. Arc is contained by tangent from lastPath
point to p1, and tangent from p1 to p2. Arc is part of circle sized to radius, positioned so it touches both tangent lines.If last
Path
SkPoint does not start arc, arcTo() appends connecting line toPath
. The length of vector from p1 to p2 does not affect arc.Arc sweep is always less than 180 degrees. If radius is zero, or if tangents are nearly parallel, arcTo() appends line from last
Path
SkPoint to p1.arcTo() appends at most one line and one conic. arcTo() implements the functionality of PostScript arct and HTML Canvas arcTo.
- param p1:
SkPoint common to pair of tangents
- param p2:
end of second tangent
- param radius:
distance from arc to circle center
- return:
reference to
Path
arcTo(self: skia.PathBuilder, r: skia.Point, xAxisRotate: float, largeArc: skia.PathBuilder.ArcSize, sweep: skia.PathDirection, xy: skia.Point) -> skia.PathBuilder
Appends arc to
Path
. Arc is implemented by one or more conic weighted to describe part of oval with radii (r.fX, r.fY) rotated by xAxisRotate degrees. Arc curves from lastPath
Point
to (xy.fX, xy.fY), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger.Arc sweep is always less than 360 degrees. arcTo() appends line to xy if either radii are zero, or if last
Path
Point
equals (xy.fX, xy.fY). arcTo() scales radii r to fit lastPath
Point
and xy if both are greater than zero but too small to describe an arc.arcTo() appends up to four conic curves. arcTo() implements the functionality of SVG arc, although SVG sweep-flag value is opposite the integer value of sweep; SVG sweep-flag uses 1 for clockwise, while kCW_Direction cast to int is zero.
- param r:
radii on axes before x-axis rotation
- param xAxisRotate:
x-axis rotation in degrees; positive values are clockwise
- param largeArc:
chooses smaller or larger arc
- param sweep:
chooses clockwise or counterclockwise arc
- param xy:
end of arc
- return:
reference to
Path
- PathBuilder.close(self: skia.PathBuilder) skia.PathBuilder
- PathBuilder.computeBounds(self: skia.PathBuilder) skia.Rect
- PathBuilder.conicTo(*args, **kwargs)
Overloaded function.
conicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, w: float) -> skia.PathBuilder
conicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, w: float) -> skia.PathBuilder
conicTo(self: skia.PathBuilder, pts: list[skia.Point], w: float) -> skia.PathBuilder
- PathBuilder.cubicTo(*args, **kwargs)
Overloaded function.
cubicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, pt3: skia.Point) -> skia.PathBuilder
cubicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float) -> skia.PathBuilder
cubicTo(self: skia.PathBuilder, pts: list[skia.Point]) -> skia.PathBuilder
- PathBuilder.detach(self: skia.PathBuilder) skia.Path
the builder is reset to empty after returning this path
- PathBuilder.fillType(self: skia.PathBuilder) skia.PathFillType
- PathBuilder.incReserve(*args, **kwargs)
Overloaded function.
incReserve(self: skia.PathBuilder, extraPtCount: int, extraVerbCount: int) -> None
Performance hint, to reserve extra storage for subsequent calls to lineTo, quadTo, etc.
incReserve(self: skia.PathBuilder, extraPtCount: int) -> None
- PathBuilder.lineTo(*args, **kwargs)
Overloaded function.
lineTo(self: skia.PathBuilder, pt: skia.Point) -> skia.PathBuilder
lineTo(self: skia.PathBuilder, x: float, y: float) -> skia.PathBuilder
- PathBuilder.moveTo(*args, **kwargs)
Overloaded function.
moveTo(self: skia.PathBuilder, pt: skia.Point) -> skia.PathBuilder
moveTo(self: skia.PathBuilder, x: float, y: float) -> skia.PathBuilder
- PathBuilder.offset(self: skia.PathBuilder, dx: float, dy: float) skia.PathBuilder
- PathBuilder.polylineTo(self: skia.PathBuilder, points: list[skia.Point]) skia.PathBuilder
Append a series of lineTo(…)
- PathBuilder.quadTo(*args, **kwargs)
Overloaded function.
quadTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point) -> skia.PathBuilder
quadTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float) -> skia.PathBuilder
quadTo(self: skia.PathBuilder, pts: list[skia.Point]) -> skia.PathBuilder
- PathBuilder.rConicTo(*args, **kwargs)
Overloaded function.
rConicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, w: float) -> skia.PathBuilder
rConicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, w: float) -> skia.PathBuilder
- PathBuilder.rCubicTo(*args, **kwargs)
Overloaded function.
rCubicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, pt3: skia.Point) -> skia.PathBuilder
rCubicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float) -> skia.PathBuilder
- PathBuilder.rLineTo(*args, **kwargs)
Overloaded function.
rLineTo(self: skia.PathBuilder, pt: skia.Point) -> skia.PathBuilder
rLineTo(self: skia.PathBuilder, x: float, y: float) -> skia.PathBuilder
- PathBuilder.rQuadTo(*args, **kwargs)
Overloaded function.
rQuadTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point) -> skia.PathBuilder
rQuadTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float) -> skia.PathBuilder
- PathBuilder.reset(self: skia.PathBuilder) skia.PathBuilder
- PathBuilder.setFillType(self: skia.PathBuilder, fillType: skia.PathFillType) skia.PathBuilder
- PathBuilder.setIsVolatile(self: skia.PathBuilder, isVolatile: bool) skia.PathBuilder
- PathBuilder.snapshot(self: skia.PathBuilder) skia.Path
the builder is unchanged after returning this path
- PathBuilder.toggleInverseFillType(self: skia.PathBuilder) skia.PathBuilder
Attributes
- PathBuilder.kLarge_ArcSize = <ArcSize.kLarge_ArcSize: 1>
- PathBuilder.kSmall_ArcSize = <ArcSize.kSmall_ArcSize: 0>