StrokeRec
- class StrokeRec
Classes
Members:
Members:
Methods
Overloaded function.
Overloaded function.
Apply these stroke parameters to a paint.
Apply these stroke parameters to the src path, returning the result in dst.
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.
Compare if two SkStrokeRecs have an equal effect on a path.
Returns true if this specifes any thick stroking, i.e.
Specify the strokewidth, and optionally if you want stroke + fill.
Attributes
Methods
- static StrokeRec.GetInflationRadius(*args, **kwargs)
Overloaded function.
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).GetInflationRadius(join: skia.Paint.Join, miterLimit: float, cap: skia.Paint.Cap, strokeWidth: float) -> float
- StrokeRec.__init__(*args, **kwargs)
Overloaded function.
__init__(self: skia.StrokeRec, style: skia.StrokeRec.InitStyle) -> None
__init__(self: skia.StrokeRec, paint: skia.Paint, style: skia.Paint.Style, resScale: float = 1) -> None
__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