 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
41 std::vector<Point>
Extrema()
const;
44 return p1 == other.
p1 &&
p2 == other.
p2;
64 :
p1(ap1),
cp(acp),
p2(ap2) {}
81 std::vector<Point>& points)
const;
87 std::vector<Point>
Extrema()
const;
90 return p1 == other.
p1 &&
cp == other.
cp &&
p2 == other.
p2;
113 cp1(q.
p1 + (q.cp - q.
p1) * (2.0 / 3.0)),
114 cp2(q.
p2 + (q.cp - q.
p2) * (2.0 / 3.0)),
131 std::vector<Point>
Extrema()
const;
167 const LinearPathComponent*,
168 const QuadraticPathComponent*,
175 std::optional<Vector2>
operator()(std::monostate monostate) {
184 std::optional<Vector2>
operator()(std::monostate monostate) {
189 static_assert(!std::is_polymorphic<LinearPathComponent>::value);
190 static_assert(!std::is_polymorphic<QuadraticPathComponent>::value);
191 static_assert(!std::is_polymorphic<CubicPathComponent>::value);
195 #endif // FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
static constexpr Scalar kDefaultCurveTolerance
std::optional< Vector2 > operator()(std::monostate monostate)
CubicPathComponent Subsegment(Scalar t0, Scalar t1) const
bool operator==(const QuadraticPathComponent &other) const
std::optional< Vector2 > GetStartDirection() const
void AppendPolylinePoints(Scalar scale, std::vector< Point > &points) const
void AppendPolylinePoints(std::vector< Point > &points) const
std::optional< Vector2 > GetStartDirection() const
ContourComponent(Point p, bool is_closed=false)
Point Solve(Scalar time) const
std::optional< Vector2 > operator()(const LinearPathComponent *component)
std::optional< Vector2 > GetEndDirection() const
bool operator==(const ContourComponent &other) const
void ToLinearPathComponents(Scalar scale_factor, const PointProc &proc) const
std::function< void(const Point &point)> PointProc
Point SolveDerivative(Scalar time) const
QuadraticPathComponent(Point ap1, Point acp, Point ap2)
std::optional< Vector2 > GetStartDirection() const
Point Solve(Scalar time) const
bool operator==(const LinearPathComponent &other) const
bool operator==(const CubicPathComponent &other) const
Point SolveDerivative(Scalar time) const
LinearPathComponent(Point ap1, Point ap2)
std::vector< Point > Extrema() const
std::optional< Vector2 > GetEndDirection() const
CubicPathComponent(const QuadraticPathComponent &q)
void ToLinearPathComponents(Scalar scale, const PointProc &proc) const
void AppendPolylinePoints(Scalar scale_factor, std::vector< Point > &points) const
std::optional< Vector2 > operator()(const LinearPathComponent *component)
std::function< void(const Point &point)> PointProc
std::vector< Point > Extrema() const
std::variant< std::monostate, const LinearPathComponent *, const QuadraticPathComponent *, const CubicPathComponent * > PathComponentVariant
std::optional< Vector2 > operator()(std::monostate monostate)
std::optional< Vector2 > GetEndDirection() const
Point Solve(Scalar time) const
std::vector< Point > Extrema() const
CubicPathComponent(Point ap1, Point acp1, Point acp2, Point ap2)