PathEffect

class PathEffect

PathEffect is the base class for objects in the Paint that affect the geometry of a drawing primitive before it is transformed by the canvas’ matrix and drawn.

Dashing is implemented as a subclass of PathEffect.

Subclasses

DiscretePathEffect

DashPathEffect

CornerPathEffect

CornerPathEffect is a subclass of PathEffect that can turn sharp corners into various treatments (e.g.

Line2DPathEffect

Path1DPathEffect

Path2DPathEffect

TrimPathEffect

Classes

DashInfo

DashType

If the PathEffect can be represented as a dash pattern, asADash

Type

Members:

Methods

Deserialize

GetFlattenableType

MakeCompose

Returns a patheffect that applies the inner effect to the path, and then applies the outer effect to the result of the inner's.

MakeSum

Returns a patheffect that apples each effect (first and second) to the original path, and returns a path with the sum of these.

__init__

asADash

filterPath

Given a src path (input) and a stroke-rec (input and output), apply this effect to the src path, returning the new path in dst, and return true.

getFlattenableType

getTypeName

Returns the name of the object's class.

ref

Increment the reference count.

serialize

unique

May return true if the caller is the only owner.

unref

Decrement the reference count.

Attributes

kColorFilter_Type

kDash_DashType

kDrawLooper_Type

kDrawable_Type

kImageFilter_Type

kMaskFilter_Type

kNone_DashType

kPathEffect_Type

Methods

static PathEffect.Deserialize(data: buffer) skia.PathEffect
static PathEffect.GetFlattenableType() skia.Flattanable.Type
static PathEffect.MakeCompose(outer: skia.PathEffect, inner: skia.PathEffect) skia.PathEffect

Returns a patheffect that applies the inner effect to the path, and then applies the outer effect to the result of the inner’s.

result = outer(inner(path))

static PathEffect.MakeSum(first: skia.PathEffect, second: skia.PathEffect) skia.PathEffect

Returns a patheffect that apples each effect (first and second) to the original path, and returns a path with the sum of these.

result = first(path) + second(path)

PathEffect.__init__(*args, **kwargs)
PathEffect.asADash(self: skia.PathEffect, info: skia.PathEffect.DashInfo) skia.PathEffect.DashType
PathEffect.filterPath(self: skia.PathEffect, dst: SkPath, src: SkPath, stroke_rec: skia.StrokeRec, cullR: skia.Rect) bool

Given a src path (input) and a stroke-rec (input and output), apply this effect to the src path, returning the new path in dst, and return true.

If this effect cannot be applied, return false and ignore dst and stroke-rec.

The stroke-rec specifies the initial request for stroking (if any). The effect can treat this as input only, or it can choose to change the rec as well. For example, the effect can decide to change the stroke’s width or join, or the effect can change the rec from stroke to fill (or fill to stroke) in addition to returning a new (dst) path.

If this method returns true, the caller will apply (as needed) the resulting stroke-rec to dst and then draw.

PathEffect.getFlattenableType(self: skia.Flattanable) skia.Flattanable.Type
PathEffect.getTypeName(self: skia.Flattanable) str

Returns the name of the object’s class.

Implemented in Drawable.

PathEffect.ref(self: skia.RefCntBase) None

Increment the reference count.

Must be balanced by a call to unref().

PathEffect.serialize(self: skia.Flattanable) skia.Data
PathEffect.unique(self: skia.RefCntBase) bool

May return true if the caller is the only owner.

Ensures that all previous owner’s actions are complete.

PathEffect.unref(self: skia.RefCntBase) None

Decrement the reference count.

If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.

Attributes

PathEffect.kColorFilter_Type = <Type.kColorFilter_Type: 0>
PathEffect.kDash_DashType = <DashType.kDash_DashType: 1>
PathEffect.kDrawLooper_Type = <Type.kDrawLooper_Type: 3>
PathEffect.kDrawable_Type = <Type.kDrawable_Type: 2>
PathEffect.kImageFilter_Type = <Type.kImageFilter_Type: 4>
PathEffect.kMaskFilter_Type = <Type.kMaskFilter_Type: 5>
PathEffect.kNone_DashType = <DashType.kNone_DashType: 0>
PathEffect.kPathEffect_Type = <Type.kPathEffect_Type: 6>