5#ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
6#define FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
31 std::vector<Point>
Extrema()
const;
34 return p1 == other.
p1 &&
p2 == other.
p2;
54 :
p1(ap1),
cp(acp),
p2(ap2) {}
61 std::vector<Point>&
points)
const;
67 std::vector<Point>
Extrema()
const;
70 return p1 == other.
p1 &&
cp == other.
cp &&
p2 == other.
p2;
93 cp1(q.
p1 + (q.cp - q.
p1) * (2.0 / 3.0)),
94 cp2(q.
p2 + (q.cp - q.
p2) * (2.0 / 3.0)),
106 std::vector<Point>
Extrema()
const;
150 std::optional<Vector2>
operator()(std::monostate monostate) {
159 std::optional<Vector2>
operator()(std::monostate monostate) {
164static_assert(!std::is_polymorphic<LinearPathComponent>::value);
165static_assert(!std::is_polymorphic<QuadraticPathComponent>::value);
166static_assert(!std::is_polymorphic<CubicPathComponent>::value);
static const int points[]
std::variant< std::monostate, const LinearPathComponent *, const QuadraticPathComponent *, const CubicPathComponent * > PathComponentVariant
bool operator==(const ContourComponent &other) const
ContourComponent(Point p, bool is_closed=false)
void ToLinearPathComponents(Scalar scale, const PointProc &proc) const
void AppendPolylinePoints(Scalar scale, std::vector< Point > &points) const
CubicPathComponent(Point ap1, Point acp1, Point acp2, Point ap2)
bool operator==(const CubicPathComponent &other) const
std::function< void(const Point &point)> PointProc
CubicPathComponent Subsegment(Scalar t0, Scalar t1) const
Point Solve(Scalar time) const
std::optional< Vector2 > GetStartDirection() const
std::vector< Point > Extrema() const
std::optional< Vector2 > GetEndDirection() const
Point SolveDerivative(Scalar time) const
CubicPathComponent(const QuadraticPathComponent &q)
std::optional< Vector2 > GetEndDirection() const
LinearPathComponent(Point ap1, Point ap2)
std::optional< Vector2 > GetStartDirection() const
std::vector< Point > Extrema() const
bool operator==(const LinearPathComponent &other) const
Point Solve(Scalar time) const
void AppendPolylinePoints(std::vector< Point > &points) const
std::optional< Vector2 > operator()(const LinearPathComponent *component)
std::optional< Vector2 > operator()(std::monostate monostate)
std::optional< Vector2 > operator()(std::monostate monostate)
std::optional< Vector2 > operator()(const LinearPathComponent *component)
std::optional< Vector2 > GetEndDirection() const
QuadraticPathComponent(Point ap1, Point acp, Point ap2)
void AppendPolylinePoints(Scalar scale_factor, std::vector< Point > &points) const
bool operator==(const QuadraticPathComponent &other) const
std::function< void(const Point &point)> PointProc
std::vector< Point > Extrema() const
Point SolveDerivative(Scalar time) const
std::optional< Vector2 > GetStartDirection() const
void ToLinearPathComponents(Scalar scale_factor, const PointProc &proc) const
Point Solve(Scalar time) const