 |
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_
40 std::vector<Point>
Extrema()
const;
43 return p1 == other.
p1 &&
p2 == other.
p2;
63 :
p1(ap1),
cp(acp),
p2(ap2) {}
80 std::vector<Point>& points)
const;
82 std::vector<Point>
Extrema()
const;
85 return p1 == other.
p1 &&
cp == other.
cp &&
p2 == other.
p2;
108 cp1(q.
p1 + (q.cp - q.
p1) * (2.0 / 3.0)),
109 cp2(q.
p2 + (q.cp - q.
p2) * (2.0 / 3.0)),
126 std::vector<Point>
Extrema()
const;
161 const LinearPathComponent*,
162 const QuadraticPathComponent*,
169 std::optional<Vector2>
operator()(std::monostate monostate) {
178 std::optional<Vector2>
operator()(std::monostate monostate) {
183 static_assert(!std::is_polymorphic<LinearPathComponent>::value);
184 static_assert(!std::is_polymorphic<QuadraticPathComponent>::value);
185 static_assert(!std::is_polymorphic<CubicPathComponent>::value);
189 #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
Point SolveDerivative(Scalar time) const
QuadraticPathComponent(Point ap1, Point acp, Point ap2)
std::optional< Vector2 > GetStartDirection() const
Point Solve(Scalar time) const
std::vector< QuadraticPathComponent > ToQuadraticPathComponents(Scalar accuracy) 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 AppendPolylinePoints(Scalar scale_factor, std::vector< Point > &points) const
std::optional< Vector2 > operator()(const LinearPathComponent *component)
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)