8 #ifndef SkContourMeasure_DEFINED
9 #define SkContourMeasure_DEFINED
14 #include "include/private/base/SkAPI.h"
15 #include "include/private/base/SkTDArray.h"
31 [[nodiscard]]
bool getPosTan(
SkScalar distance, SkPoint* position, SkVector* tangent)
const;
34 kGetPosition_MatrixFlag = 0x01,
35 kGetTangent_MatrixFlag = 0x02,
36 kGetPosAndTan_MatrixFlag = kGetPosition_MatrixFlag | kGetTangent_MatrixFlag
45 MatrixFlags flags = kGetPosAndTan_MatrixFlag)
const;
54 bool startWithMoveTo)
const;
64 unsigned fTValue : 30;
70 static const Segment* Next(
const Segment* seg) {
71 unsigned ptIndex = seg->fPtIndex;
74 }
while (seg->fPtIndex == ptIndex);
80 const SkTDArray<Segment> fSegments;
81 const SkTDArray<SkPoint> fPts;
135 std::unique_ptr<Impl> fImpl;
float SkScalar
Definition: SkScalar.h:14
Definition: SkContourMeasure.h:95
sk_sp< SkContourMeasure > next()
Iterates through contours in path, returning a contour-measure object for each contour in the path.
SkContourMeasureIter(SkContourMeasureIter &&)
SkContourMeasureIter(const SkPath &path, bool forceClosed, SkScalar resScale=1)
Initialize the Iter with a path.
void reset(const SkPath &path, bool forceClosed, SkScalar resScale=1)
Reset the Iter with a path.
SkContourMeasureIter & operator=(SkContourMeasureIter &&)
Definition: SkContourMeasure.h:22
bool getMatrix(SkScalar distance, SkMatrix *matrix, MatrixFlags flags=kGetPosAndTan_MatrixFlag) const
Pins distance to 0 <= distance <= getLength(), and then computes the corresponding matrix (by calling...
bool getSegment(SkScalar startD, SkScalar stopD, SkPath *dst, bool startWithMoveTo) const
Given a start and stop distance, return in dst the intervening segment(s).
bool getPosTan(SkScalar distance, SkPoint *position, SkVector *tangent) const
Pins distance to 0 <= distance <= length(), and then computes the corresponding position and tangent.
MatrixFlags
Definition: SkContourMeasure.h:33
SkScalar length() const
Return the length of the contour.
Definition: SkContourMeasure.h:26
bool isClosed() const
Return true if the contour is closed()
Definition: SkContourMeasure.h:58
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:53
SkPath contain geometry.
Definition: SkPath.h:58
Definition: SkRefCnt.h:119