PathBuilder

class PathBuilder

Classes

ArcSize

Members:

Methods

__init__

__init__(*args, **kwargs) Overloaded function.

addArc

Appends arc to the builder, as the start of new contour.

addCircle

addOval

Overloaded function.

addPolygon

addRRect

Overloaded function.

addRect

Overloaded function.

arcTo

Overloaded function.

close

computeBounds

conicTo

Overloaded function.

cubicTo

Overloaded function.

detach

the builder is reset to empty after returning this path

fillType

incReserve

Overloaded function.

lineTo

Overloaded function.

moveTo

Overloaded function.

offset

polylineTo

Append a series of lineTo(…)

quadTo

Overloaded function.

rConicTo

Overloaded function.

rCubicTo

Overloaded function.

rLineTo

Overloaded function.

rQuadTo

Overloaded function.

reset

setFillType

setIsVolatile

snapshot

the builder is unchanged after returning this path

toggleInverseFillType

Attributes

kLarge_ArcSize

kSmall_ArcSize

Methods

PathBuilder.__init__(*args, **kwargs)

__init__(*args, **kwargs) Overloaded function.

  1. __init__(self: skia.PathBuilder) -> None

  2. __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 = <PathDirection.kCW: 0>) skia.PathBuilder
PathBuilder.addOval(*args, **kwargs)

Overloaded function.

  1. addOval(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection, startIndex: int) -> skia.PathBuilder

  2. addOval(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection = <PathDirection.kCW: 0>) -> skia.PathBuilder

PathBuilder.addPolygon(self: skia.PathBuilder, points: List[skia.Point], isClosed: bool) skia.PathBuilder
PathBuilder.addRRect(*args, **kwargs)

Overloaded function.

  1. addRRect(self: skia.PathBuilder, rrect: skia.RRect, pathDirection: skia.PathDirection, startIndex: int) -> skia.PathBuilder

  2. addRRect(self: skia.PathBuilder, rrect: skia.RRect, pathDirection: skia.PathDirection = <PathDirection.kCW: 0>) -> skia.PathBuilder

PathBuilder.addRect(*args, **kwargs)

Overloaded function.

  1. addRect(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection, startIndex: int) -> skia.PathBuilder

  2. addRect(self: skia.PathBuilder, rect: skia.Rect, pathDirection: skia.PathDirection = <PathDirection.kCW: 0>) -> skia.PathBuilder

PathBuilder.arcTo(*args, **kwargs)

Overloaded function.

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

  2. 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 last Path 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 to Path. 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

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

  1. conicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, w: float) -> skia.PathBuilder

  2. conicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, w: float) -> skia.PathBuilder

  3. conicTo(self: skia.PathBuilder, pts: List[skia.Point], w: float) -> skia.PathBuilder

PathBuilder.cubicTo(*args, **kwargs)

Overloaded function.

  1. cubicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, pt3: skia.Point) -> skia.PathBuilder

  2. cubicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float) -> skia.PathBuilder

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

  1. incReserve(self: skia.PathBuilder, extraPtCount: int, extraVerbCount: int) -> None

    Performance hint, to reserve extra storage for subsequent calls to lineTo, quadTo, etc.

  2. incReserve(self: skia.PathBuilder, extraPtCount: int) -> None

PathBuilder.lineTo(*args, **kwargs)

Overloaded function.

  1. lineTo(self: skia.PathBuilder, pt: skia.Point) -> skia.PathBuilder

  2. lineTo(self: skia.PathBuilder, x: float, y: float) -> skia.PathBuilder

PathBuilder.moveTo(*args, **kwargs)

Overloaded function.

  1. moveTo(self: skia.PathBuilder, pt: skia.Point) -> skia.PathBuilder

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

  1. quadTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point) -> skia.PathBuilder

  2. quadTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float) -> skia.PathBuilder

  3. quadTo(self: skia.PathBuilder, pts: List[skia.Point]) -> skia.PathBuilder

PathBuilder.rConicTo(*args, **kwargs)

Overloaded function.

  1. rConicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, w: float) -> skia.PathBuilder

  2. rConicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, w: float) -> skia.PathBuilder

PathBuilder.rCubicTo(*args, **kwargs)

Overloaded function.

  1. rCubicTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point, pt3: skia.Point) -> skia.PathBuilder

  2. rCubicTo(self: skia.PathBuilder, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float) -> skia.PathBuilder

PathBuilder.rLineTo(*args, **kwargs)

Overloaded function.

  1. rLineTo(self: skia.PathBuilder, pt: skia.Point) -> skia.PathBuilder

  2. rLineTo(self: skia.PathBuilder, x: float, y: float) -> skia.PathBuilder

PathBuilder.rQuadTo(*args, **kwargs)

Overloaded function.

  1. rQuadTo(self: skia.PathBuilder, pt1: skia.Point, pt2: skia.Point) -> skia.PathBuilder

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