Flutter Impeller
impeller::Path::Polyline Struct Reference

#include <path.h>

Public Member Functions

std::tuple< size_t, size_t > GetContourPointBounds (size_t contour_index) const
 

Public Attributes

std::vector< Pointpoints
 
std::vector< PolylineContourcontours
 

Detailed Description

One or more contours represented as a series of points and indices in the point vector representing the start of a new contour.

Definition at line 78 of file path.h.

Member Function Documentation

◆ GetContourPointBounds()

std::tuple< size_t, size_t > impeller::Path::Polyline::GetContourPointBounds ( size_t  contour_index) const

Convenience method to compute the start (inclusive) and end (exclusive) point of the given contour index.

The contour_index parameter is clamped to contours.size().

Definition at line 20 of file path.cc.

21  {
22  if (contour_index >= contours.size()) {
23  return {points.size(), points.size()};
24  }
25  const size_t start_index = contours.at(contour_index).start_index;
26  const size_t end_index = (contour_index >= contours.size() - 1)
27  ? points.size()
28  : contours.at(contour_index + 1).start_index;
29  return std::make_tuple(start_index, end_index);
30 }

References contours, and points.

Referenced by impeller::Tessellator::Tessellate(), impeller::TessellateConvex(), and impeller::testing::TEST().

Member Data Documentation

◆ contours

◆ points

std::vector<Point> impeller::Path::Polyline::points

Points in the polyline, which may represent multiple contours specified by indices in |breaks|.

Definition at line 81 of file path.h.

Referenced by impeller::Path::CreatePolyline(), GetContourPointBounds(), impeller::Tessellator::Tessellate(), impeller::TessellateConvex(), and impeller::testing::TEST().


The documentation for this struct was generated from the following files:
impeller::Path::Polyline::points
std::vector< Point > points
Definition: path.h:81
impeller::Path::Polyline::contours
std::vector< PolylineContour > contours
Definition: path.h:82