StrokeRec

class StrokeRec

Classes

InitStyle

Members:

Style

Members:

Methods

GetInflationRadius

Overloaded function.

__init__

Overloaded function.

applyToPaint

Apply these stroke parameters to a paint.

applyToPath

Apply these stroke parameters to the src path, returning the result in dst.

getCap

getInflationRadius

Gives a conservative value for the outset that should applied to a geometries bounds to account for any inflation due to applying this strokeRec to the geometry.

getJoin

getMiter

getResScale

getStyle

getWidth

hasEqualEffect

Compare if two SkStrokeRecs have an equal effect on a path.

isFillStyle

isHairlineStyle

needToApply

Returns true if this specifes any thick stroking, i.e.

setFillStyle

setHairlineStyle

setResScale

setStrokeParams

setStrokeStyle

Specify the strokewidth, and optionally if you want stroke + fill.

Attributes

kFill_InitStyle

kFill_Style

kHairline_InitStyle

kHairline_Style

kStrokeAndFill_Style

kStroke_Style

kStyleCount

Methods

static StrokeRec.GetInflationRadius(*args, **kwargs)

Overloaded function.

  1. GetInflationRadius(paint: skia.Paint, style: skia.Paint.Style) -> float

    Equivalent to: StrokeRec rec(paint, style); rec.getInflationRadius(); This does not account for other effects on the paint (i.e. path effect).

  2. GetInflationRadius(join: skia.Paint.Join, miterLimit: float, cap: skia.Paint.Cap, strokeWidth: float) -> float

StrokeRec.__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: skia.StrokeRec, style: skia.StrokeRec.InitStyle) -> None

  2. __init__(self: skia.StrokeRec, paint: skia.Paint, style: skia.Paint.Style, resScale: float = 1) -> None

  3. __init__(self: skia.StrokeRec, paint: skia.Paint, resScale: float = 1) -> None

StrokeRec.applyToPaint(self: skia.StrokeRec, paint: skia.Paint) None

Apply these stroke parameters to a paint.

StrokeRec.applyToPath(self: skia.StrokeRec, dst: SkPath, src: SkPath) bool

Apply these stroke parameters to the src path, returning the result in dst.

If there was no change (i.e. style == hairline or fill) this returns false and dst is unchanged. Otherwise returns true and the result is stored in dst.

src and dst may be the same path.

StrokeRec.getCap(self: skia.StrokeRec) skia.Paint.Cap
StrokeRec.getInflationRadius(self: skia.StrokeRec) float

Gives a conservative value for the outset that should applied to a geometries bounds to account for any inflation due to applying this strokeRec to the geometry.

StrokeRec.getJoin(self: skia.StrokeRec) skia.Paint.Join
StrokeRec.getMiter(self: skia.StrokeRec) float
StrokeRec.getResScale(self: skia.StrokeRec) float
StrokeRec.getStyle(self: skia.StrokeRec) skia.StrokeRec.Style
StrokeRec.getWidth(self: skia.StrokeRec) float
StrokeRec.hasEqualEffect(self: skia.StrokeRec, other: skia.StrokeRec) bool

Compare if two SkStrokeRecs have an equal effect on a path.

Equal SkStrokeRecs produce equal paths. Equality of produced paths does not take the ResScale parameter into account.

StrokeRec.isFillStyle(self: skia.StrokeRec) bool
StrokeRec.isHairlineStyle(self: skia.StrokeRec) bool
StrokeRec.needToApply(self: skia.StrokeRec) bool

Returns true if this specifes any thick stroking, i.e.

applyToPath() will return true.

StrokeRec.setFillStyle(self: skia.StrokeRec) None
StrokeRec.setHairlineStyle(self: skia.StrokeRec) None
StrokeRec.setResScale(self: skia.StrokeRec, rs: float) None
StrokeRec.setStrokeParams(self: skia.StrokeRec, cap: skia.Paint.Cap, join: skia.Paint.Join, miterLimit: float) None
StrokeRec.setStrokeStyle(self: skia.StrokeRec, width: float, strokeAndFill: bool = False) None

Specify the strokewidth, and optionally if you want stroke + fill.

Note, if width==0, then this request is taken to mean: strokeAndFill==true -> new style will be Fill strokeAndFill==false -> new style will be Hairline

Attributes

StrokeRec.kFill_InitStyle = <InitStyle.kFill_InitStyle: 1>
StrokeRec.kFill_Style = <Style.kFill_Style: 1>
StrokeRec.kHairline_InitStyle = <InitStyle.kHairline_InitStyle: 0>
StrokeRec.kHairline_Style = <Style.kHairline_Style: 0>
StrokeRec.kStrokeAndFill_Style = <Style.kStrokeAndFill_Style: 3>
StrokeRec.kStroke_Style = <Style.kStroke_Style: 2>
StrokeRec.kStyleCount = 4