 |
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_
10 #include <type_traits>
23 std::vector<uint16_t>& indices);
32 bool previous_contour_odd_points_ =
false;
33 size_t contour_start_ = 0u;
34 std::vector<Point>& points_;
35 std::vector<uint16_t>& indices_;
50 std::vector<Point>
Extrema()
const;
53 return p1 == other.
p1 &&
p2 == other.
p2;
73 :
p1(ap1),
cp(acp),
p2(ap2) {}
80 std::vector<Point>& points)
const;
88 std::vector<Point>
Extrema()
const;
91 return p1 == other.
p1 &&
cp == other.
cp &&
p2 == other.
p2;
114 cp1(q.
p1 + (q.cp - q.
p1) * (2.0 / 3.0)),
115 cp2(q.
p2 + (q.cp - q.
p2) * (2.0 / 3.0)),
127 std::vector<Point>
Extrema()
const;
168 static_assert(!std::is_polymorphic<LinearPathComponent>::value);
169 static_assert(!std::is_polymorphic<QuadraticPathComponent>::value);
170 static_assert(!std::is_polymorphic<CubicPathComponent>::value);
174 #endif // FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
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
Point Solve(Scalar time) const
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
VertexWriter(std::vector< Point > &points, std::vector< uint16_t > &indices)
QuadraticPathComponent(Point ap1, Point acp, Point ap2)
ContourComponent(Point p, Point closed)
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
An interface for generating a multi contour polyline as a triangle strip.
constexpr bool IsClosed() const
std::function< void(const Point &point)> PointProc
std::vector< Point > Extrema() const
std::optional< Vector2 > GetEndDirection() const
Point Solve(Scalar time) const
std::vector< Point > Extrema() const
CubicPathComponent(Point ap1, Point acp1, Point acp2, Point ap2)