Path.Iter
- class Iter
Iterates through verb array, and associated
Pointarray and conic weight.Provides options to treat open contours as closed, and to ignore degenerate data.
Example:
it = iter(path) verb, points = it.next() while verb != skia.Path.kDone_Verb: print(verb) print(points) print(it.conicWeight()) verb, points = it.next()
Methods
conicWeight(self: skia.Path.Iter) -> float
isCloseLine(self: skia.Path.Iter) -> bool
isClosedContour(self: skia.Path.Iter) -> bool
next(self: skia.Path.Iter) -> tuple
setPath(self: skia.Path.Iter, path: skia.Path, forceClose: bool) -> None
Methods
- Iter.__init__(*args, **kwargs)
Overloaded function.
__init__(self: skia.Path.Iter) -> None
Initializes
Iterwith an emptyPath.next() on
IterreturnskDone_Verb. Call setPath to initializeIterat a later time.- return:
Iterof empty SkPath
__init__(self: skia.Path.Iter, path: skia.Path, forceClose: bool) -> None
Sets
Iterto return elements of verb array,Pointarray, and conic weight in path.If forceClose is true,
Iterwill addkLine_VerbandkClose_Verbafter each open contour. path is not altered.- path:
Pathto iterate- forceClose:
true if open contours generate
kClose_Verb- return:
Iterof path
- Iter.conicWeight(self: skia.Path.Iter) float
Returns conic weight if
next()returnedkConic_Verb.If
next()has not been called, ornext()did not returnkConic_Verb, result is undefined.- Returns:
conic weight for conic
Pointreturned bynext()
- Iter.isCloseLine(self: skia.Path.Iter) bool
Returns true if last:py:attr:~skia.Path.kLine_Verb returned by
next()was generated bykClose_Verb.When true, the end point returned by
next()is also the start point of contour.If
next()has not been called, ornext()did not returnkLine_Verb, result is undefined.- Returns:
true if last
kLine_Verbwas generated bykClose_Verb
- Iter.isClosedContour(self: skia.Path.Iter) bool
Returns true if subsequent calls to
next()returnkClose_Verbbefore returningkMove_Verb.if true, contour
Iteris processing may end withkClose_Verb, orItermay have been initialized with force close set to true.- Returns:
true if contour is closed
- Iter.next(self: skia.Path.Iter) tuple
Returns next
Verbin verb array, and advancesIter.When verb array is exhausted, returns
kDone_Verb.Zero to four
Pointare stored in pts, depending on the returnedVerb.- Returns:
tuple of the following: next
Verbfrom verb array; and storage forPointdata describing returnedVerb- Return type:
Tuple[skia.Path.Verb,List[skia.Point]]
- Iter.setPath(self: skia.Path.Iter, path: skia.Path, forceClose: bool) None
Sets
Iterto return elements of verb array,Pointarray, and conic weight in path.If forceClose is true,
Iterwill addkLine_VerbandkClose_Verbafter each open contour. path is not altered.- Parameters:
path (skia.Path) –
Pathto iterateforceClose (bool) – true if open contours generate
kClose_Verb