Skia
2D Graphics Library
|
Iterates through verb array, and associated SkPoint array and conic weight. More...
#include <SkPath.h>
Public Member Functions | |
Iter () | |
Initializes SkPath::Iter with an empty SkPath. More... | |
Iter (const SkPath &path, bool forceClose) | |
Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path. More... | |
void | setPath (const SkPath &path, bool forceClose) |
Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path. More... | |
Verb | next (SkPoint pts[4]) |
Returns next SkPath::Verb in verb array, and advances SkPath::Iter. More... | |
SkScalar | conicWeight () const |
Returns conic weight if next() returned kConic_Verb. More... | |
bool | isCloseLine () const |
Returns true if last kLine_Verb returned by next() was generated by kClose_Verb. More... | |
bool | isClosedContour () const |
Returns true if subsequent calls to next() return kClose_Verb before returning kMove_Verb. More... | |
Iterates through verb array, and associated SkPoint array and conic weight.
Provides options to treat open contours as closed, and to ignore degenerate data.
SkPath::Iter::Iter | ( | ) |
Initializes SkPath::Iter with an empty SkPath.
next() on SkPath::Iter returns kDone_Verb. Call setPath to initialize SkPath::Iter at a later time.
SkPath::Iter::Iter | ( | const SkPath & | path, |
bool | forceClose | ||
) |
Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path.
If forceClose is true, SkPath::Iter will add kLine_Verb and kClose_Verb after each open contour. path is not altered.
path | SkPath to iterate |
forceClose | true if open contours generate kClose_Verb |
|
inline |
bool SkPath::Iter::isClosedContour | ( | ) | const |
Returns true if subsequent calls to next() return kClose_Verb before returning kMove_Verb.
if true, contour SkPath::Iter is processing may end with kClose_Verb, or SkPath::Iter may have been initialized with force close set to true.
example: https://fiddle.skia.org/c/@Path_Iter_isClosedContour
|
inline |
Returns true if last kLine_Verb returned by next() was generated by kClose_Verb.
When true, the end point returned by next() is also the start point of contour.
If next() has not been called, or next() did not return kLine_Verb, result is undefined.
Verb SkPath::Iter::next | ( | SkPoint | pts[4] | ) |
Returns next SkPath::Verb in verb array, and advances SkPath::Iter.
When verb array is exhausted, returns kDone_Verb.
Zero to four SkPoint are stored in pts, depending on the returned SkPath::Verb.
pts | storage for SkPoint data describing returned SkPath::Verb |
void SkPath::Iter::setPath | ( | const SkPath & | path, |
bool | forceClose | ||
) |
Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path.
If forceClose is true, SkPath::Iter will add kLine_Verb and kClose_Verb after each open contour. path is not altered.
path | SkPath to iterate |
forceClose | true if open contours generate kClose_Verb |