Path1DPathEffect

class Path1DPathEffect

Classes

DashInfo

DashType

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

PointData

PointData aggregates all the information needed to draw the point primitives returned by an asPoints call.

Style

Members:

Type

Members:

Methods

Deserialize

GetFlattenableType

Make

Dash by replicating the specified path.

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.

RegisterFlattenables

__init__

asADash

asPoints

Does applying this path effect to ‘src’ yield a set of points? If so, optionally return the points in ‘results’.

computeFastBounds

Compute a conservative bounds for its effect, given the src bounds.

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

kLastEnum_Style

kMaskFilter_Type

kMorph_Style

kNone_DashType

kPathEffect_Type

kPixelRef_Type

kRotate_Style

kShaderBase_Type

kTranslate_Style

kUnused_Type

kUnused_Type2

kUnused_Type3

kUnused_Type4

Methods

static Path1DPathEffect.Deserialize(data: buffer) skia.PathEffect
static Path1DPathEffect.GetFlattenableType() skia.Flattanable.Type
static Path1DPathEffect.Make(path: SkPath, advance: float, phase: float, style: skia.Path1DPathEffect.Style) skia.PathEffect

Dash by replicating the specified path.

Parameters
  • path (skia.Path) – The path to replicate (dash)

  • advance (float) – The space between instances of path

  • phase (float) – distance (mod advance) along path for its initial position

  • style (skia.Path1DPathEffect.Style) – how to transform path at each point (based on the current position and tangent)

static Path1DPathEffect.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 Path1DPathEffect.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)

static Path1DPathEffect.RegisterFlattenables() None
Path1DPathEffect.__init__(*args, **kwargs)
Path1DPathEffect.asADash(self: skia.PathEffect, info: skia.PathEffect.DashInfo) skia.PathEffect.DashType
Path1DPathEffect.asPoints(self: skia.PathEffect, results: skia.PathEffect.PointData, src: SkPath, stroke_rec: skia.StrokeRec, matrix: skia.Matrix, cullR: skia.Rect) bool

Does applying this path effect to ‘src’ yield a set of points? If so, optionally return the points in ‘results’.

Path1DPathEffect.computeFastBounds(self: skia.PathEffect, dst: skia.Rect, src: skia.Rect) None

Compute a conservative bounds for its effect, given the src bounds.

The baseline implementation just assigns src to dst.

Path1DPathEffect.filterPath(self: skia.PathEffect, dst: SkPath, dst: 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.

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

Returns the name of the object’s class.

Implemented in Drawable.

Path1DPathEffect.ref(self: skia.RefCntBase) None

Increment the reference count.

Must be balanced by a call to unref().

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

May return true if the caller is the only owner.

Ensures that all previous owner’s actions are complete.

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

Path1DPathEffect.kColorFilter_Type = <Type.kColorFilter_Type: 0>
Path1DPathEffect.kDash_DashType = <DashType.kDash_DashType: 1>
Path1DPathEffect.kDrawLooper_Type = <Type.kDrawLooper_Type: 2>
Path1DPathEffect.kDrawable_Type = <Type.kDrawable_Type: 1>
Path1DPathEffect.kImageFilter_Type = <Type.kImageFilter_Type: 3>
Path1DPathEffect.kLastEnum_Style = <Style.kMorph_Style: 2>
Path1DPathEffect.kMaskFilter_Type = <Type.kMaskFilter_Type: 4>
Path1DPathEffect.kMorph_Style = <Style.kMorph_Style: 2>
Path1DPathEffect.kNone_DashType = <DashType.kNone_DashType: 0>
Path1DPathEffect.kPathEffect_Type = <Type.kPathEffect_Type: 5>
Path1DPathEffect.kPixelRef_Type = <Type.kPixelRef_Type: 6>
Path1DPathEffect.kRotate_Style = <Style.kRotate_Style: 1>
Path1DPathEffect.kShaderBase_Type = <Type.kShaderBase_Type: 8>
Path1DPathEffect.kTranslate_Style = <Style.kTranslate_Style: 0>
Path1DPathEffect.kUnused_Type = <Type.kUnused_Type: 9>
Path1DPathEffect.kUnused_Type2 = <Type.kUnused_Type2: 10>
Path1DPathEffect.kUnused_Type3 = <Type.kUnused_Type3: 11>
Path1DPathEffect.kUnused_Type4 = <Type.kUnused_Type4: 7>