 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_PATH_H_
126 size_t contour_index)
const;
148 using Applier = std::function<void(
size_t index,
const T& component)>;
175 std::make_unique<std::vector<Point>>(),
193 void SetBounds(
Rect rect);
197 Path& AddQuadraticComponent(
const Point& p1,
206 Path& AddContourComponent(
const Point& destination,
bool is_closed =
false);
212 void ComputeBounds();
214 void SetContourClosed(
bool is_closed);
216 void Shift(
Point shift);
218 struct ComponentIndexPair {
222 ComponentIndexPair() {}
225 : type(a_type), index(a_index) {}
230 std::vector<ComponentIndexPair> components_;
231 std::vector<Point> points_;
232 std::vector<ContourComponent> contours_;
234 std::optional<Rect> computed_bounds_;
239 #endif // FLUTTER_IMPELLER_GEOMETRY_PATH_H_
bool GetQuadraticComponentAtIndex(size_t index, QuadraticPathComponent &quadratic) const
Path Clone() const
Deeply clone this path and all data associated with it.
size_t start_index
Index that denotes the first point of this contour.
std::vector< Component > components
std::optional< Rect > GetBoundingBox() const
std::optional< std::pair< Point, Point > > GetMinMaxCoveragePoints() const
Polyline(PointBufferPtr point_buffer, ReclaimPointBufferCallback reclaim)
bool GetCubicComponentAtIndex(size_t index, CubicPathComponent &cubic) const
std::function< void(PointBufferPtr)> ReclaimPointBufferCallback
void EnumerateComponents(const Applier< LinearPathComponent > &linear_applier, const Applier< QuadraticPathComponent > &quad_applier, const Applier< CubicPathComponent > &cubic_applier, const Applier< ContourComponent > &contour_applier) const
Vector2 start_direction
The direction of the contour's start cap.
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
Point & GetPoint(size_t index) const
std::optional< Rect > GetTransformedBoundingBox(const Matrix &transform) const
std::tuple< size_t, size_t > GetContourPointBounds(size_t contour_index) const
Vector2 end_direction
The direction of the contour's end cap.
bool GetContourComponentAtIndex(size_t index, ContourComponent &contour) const
std::function< void(size_t index, const T &component)> Applier
size_t GetComponentCount(std::optional< ComponentType > type={}) const
std::vector< PolylineContour > contours
std::unique_ptr< std::vector< Point > > PointBufferPtr
size_t component_start_index
Polyline CreatePolyline(Scalar scale, Polyline::PointBufferPtr point_buffer=std::make_unique< std::vector< Point >>(), Polyline::ReclaimPointBufferCallback reclaim=nullptr) const
bool GetLinearComponentAtIndex(size_t index, LinearPathComponent &linear) const
A 4x4 matrix using column-major storage.
FillType GetFillType() const