DiscretePathEffect
- class DiscretePathEffect
Classes
If the
PathEffect
can be represented as a dash pattern, asADashPointData
aggregates all the information needed to draw the point primitives returned by an asPoints call.Members:
Methods
Break the path into segments of segLength length, and randomly move the endpoints away from the original path by a maximum of deviation.
Returns a patheffect that applies the inner effect to the path, and then applies the outer effect to the result of the inner's.
Returns a patheffect that apples each effect (first and second) to the original path, and returns a path with the sum of these.
Does applying this path effect to 'src' yield a set of points? If so, optionally return the points in 'results'.
Compute a conservative bounds for its effect, given the src bounds.
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.
Returns the name of the object's class.
Increment the reference count.
May return true if the caller is the only owner.
Decrement the reference count.
Attributes
Methods
- static DiscretePathEffect.Deserialize(data: Buffer) skia.PathEffect
- static DiscretePathEffect.GetFlattenableType() skia.Flattanable.Type
- static DiscretePathEffect.Make(segLength: float, dev: float, seedAssist: int = 0) skia.PathEffect
Break the path into segments of segLength length, and randomly move the endpoints away from the original path by a maximum of deviation.
Note: works on filled or framed paths
- Parameters:
segLength – Segment length
dev – Deviation
seedAssist – This is a caller-supplied seedAssist that modifies the seed value that is used to randomize the path segments’ endpoints. If not supplied it defaults to 0, in which case filtering a path multiple times will result in the same set of segments (this is useful for testing). If a caller does not want this behaviour they can pass in a different seedAssist to get a different set of path segments.
- static DiscretePathEffect.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 DiscretePathEffect.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 DiscretePathEffect.RegisterFlattenables() None
- DiscretePathEffect.__init__(*args, **kwargs)
- DiscretePathEffect.asADash(self: skia.PathEffect, info: skia.PathEffect.DashInfo) skia.PathEffect.DashType
- DiscretePathEffect.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’.
- DiscretePathEffect.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.
- DiscretePathEffect.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.
- DiscretePathEffect.getFlattenableType(self: skia.Flattanable) skia.Flattanable.Type
- DiscretePathEffect.getTypeName(self: skia.Flattanable) str
Returns the name of the object’s class.
Implemented in
Drawable
.
- DiscretePathEffect.ref(self: skia.RefCntBase) None
Increment the reference count.
Must be balanced by a call to
unref()
.
- DiscretePathEffect.serialize(self: skia.Flattanable) skia.Data
- DiscretePathEffect.unique(self: skia.RefCntBase) bool
May return true if the caller is the only owner.
Ensures that all previous owner’s actions are complete.
- DiscretePathEffect.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
- DiscretePathEffect.kColorFilter_Type = <Type.kColorFilter_Type: 0>
- DiscretePathEffect.kDash_DashType = <DashType.kDash_DashType: 1>
- DiscretePathEffect.kDrawLooper_Type = <Type.kDrawLooper_Type: 2>
- DiscretePathEffect.kDrawable_Type = <Type.kDrawable_Type: 1>
- DiscretePathEffect.kImageFilter_Type = <Type.kImageFilter_Type: 3>
- DiscretePathEffect.kMaskFilter_Type = <Type.kMaskFilter_Type: 4>
- DiscretePathEffect.kNone_DashType = <DashType.kNone_DashType: 0>
- DiscretePathEffect.kPathEffect_Type = <Type.kPathEffect_Type: 5>
- DiscretePathEffect.kPixelRef_Type = <Type.kPixelRef_Type: 6>
- DiscretePathEffect.kShaderBase_Type = <Type.kShaderBase_Type: 8>
- DiscretePathEffect.kUnused_Type = <Type.kUnused_Type: 9>
- DiscretePathEffect.kUnused_Type2 = <Type.kUnused_Type2: 10>
- DiscretePathEffect.kUnused_Type3 = <Type.kUnused_Type3: 11>
- DiscretePathEffect.kUnused_Type4 = <Type.kUnused_Type4: 7>