 |
Flutter Impeller
|
|
Go to the documentation of this file.
44 std::vector<float> points;
47 [&points](
const float* vertices,
size_t vertices_count,
48 const uint16_t* indices,
size_t indices_count) {
50 std::vector<Point> raw_points;
51 for (
auto i = 0u; i < vertices_count * 2; i += 2) {
52 raw_points.emplace_back(
Point{vertices[i], vertices[i + 1]});
54 for (
auto i = 0u; i < indices_count; i++) {
55 auto point = raw_points[indices[i]];
56 points.push_back(point.x);
57 points.push_back(point.y);
65 vertices->
points =
new float[points.size()];
69 vertices->
length = points.size();
70 std::copy(points.begin(), points.end(), vertices->
points);
void DestroyVertices(Vertices *vertices)
A utility that generates triangles of the specified fill type given a polyline. This happens on the C...
PathBuilder & CubicCurveTo(Point controlPoint1, Point controlPoint2, Point point, bool relative=false)
Insert a cubic curve from the curren position to point using the control points controlPoint1 and con...
void MoveTo(PathBuilder *builder, Scalar x, Scalar y)
Path CopyPath(FillType fill=FillType::kNonZero)
PathBuilder * CreatePathBuilder()
void CubicTo(PathBuilder *builder, Scalar x1, Scalar y1, Scalar x2, Scalar y2, Scalar x3, Scalar y3)
PathBuilder & LineTo(Point point, bool relative=false)
Insert a line from the current position to point.
void Close(PathBuilder *builder)
void LineTo(PathBuilder *builder, Scalar x, Scalar y)
Tessellator::Result Tessellate(const Path &path, Scalar tolerance, const BuilderCallback &callback)
Generates filled triangles from the path. A callback is invoked once for the entire tessellation.
PathBuilder & MoveTo(Point point, bool relative=false)
void DestroyPathBuilder(PathBuilder *builder)
struct Vertices * Tessellate(PathBuilder *builder, int fill_type, Scalar tolerance)