#include <arc.h>
Classes | |
struct | Iteration |
Public Member Functions | |
Arc (const Rect &bounds, Degrees start, Degrees sweep, bool include_center) | |
const Rect & | GetOvalBounds () const |
Return the bounds of the oval in which this arc is inscribed. More... | |
const Point | GetOvalCenter () const |
Returns the center of the oval bounds. More... | |
const Size | GetOvalSize () const |
Returns the size of the oval bounds. More... | |
Rect | GetTightArcBounds () const |
constexpr Degrees | GetStart () const |
constexpr Degrees | GetSweep () const |
constexpr bool | IncludeCenter () const |
constexpr bool | IsPerfectCircle () const |
constexpr bool | IsFullCircle () const |
Iteration | ComputeIterations (size_t step_count, bool simplify_360=true) const |
Definition at line 9 of file arc.cc.
References impeller::Degrees::degrees, impeller::TRect< T >::IsFinite(), impeller::Degrees::IsFinite(), and start.
Arc::Iteration impeller::Arc::ComputeIterations | ( | size_t | step_count, |
bool | simplify_360 = true |
||
) | const |
Return an |ArcIteration| that explains how to generate vertices for the arc with the indicated number of steps in each full quadrant. The step_count is typically chosen based on the size of the bounds and the scale at which the arc is being drawn and so the computation of the step_count requirements is left to the caller.
If the sweep is more than 360 degrees then the code may simplify the iteration to a simple circle, but only if the simplify_360 parameter is true.
Definition at line 102 of file arc.cc.
References impeller::Matrix::CosSin(), impeller::Degrees::degrees, impeller::Arc::Iteration::end, end, impeller::Arc::Iteration::Quadrant::end_index, impeller::Degrees::GetPositive(), impeller::kQuadrantAxes, impeller::Arc::Iteration::quadrant_count, impeller::Arc::Iteration::quadrants, impeller::Arc::Iteration::start, start, and impeller::Arc::Iteration::Quadrant::start_index.
Referenced by impeller::ArcStrokeGeometry::Dispatch(), impeller::Tessellator::FilledArc(), impeller::StrokePathSegmentReceiver::RecordArc(), impeller::Tessellator::StrokedArc(), and impeller::testing::TEST().
|
inline |
Return the bounds of the oval in which this arc is inscribed.
Definition at line 94 of file arc.h.
Referenced by impeller::Canvas::DrawArc(), impeller::Tessellator::FilledArc(), std::operator<<(), and impeller::Tessellator::StrokedArc().
|
inline |
Returns the center of the oval bounds.
Definition at line 97 of file arc.h.
References impeller::TRect< T >::GetCenter().
Referenced by impeller::ArcStrokeGeometry::Dispatch().
|
inline |
Returns the size of the oval bounds.
Definition at line 100 of file arc.h.
References impeller::TRect< T >::GetSize().
Referenced by impeller::ArcStrokeGeometry::Dispatch(), impeller::Tessellator::FilledArc(), and impeller::Tessellator::StrokedArc().
|
inlineconstexpr |
Definition at line 106 of file arc.h.
Referenced by impeller::Canvas::DrawArc(), and std::operator<<().
|
inlineconstexpr |
Definition at line 108 of file arc.h.
Referenced by impeller::Canvas::DrawArc(), and std::operator<<().
Rect impeller::Arc::GetTightArcBounds | ( | ) | const |
Return the tight bounds of the arc taking into account its specific geometry such as the start and end angles and the center (if included).
Definition at line 59 of file arc.cc.
References impeller::Matrix::CosSin(), impeller::Degrees::degrees, impeller::TRect< T >::GetCenter(), impeller::Degrees::GetPositive(), impeller::TRect< T >::GetSize(), IsFullCircle(), impeller::kQuadrantAxes, and impeller::TRect< Scalar >::MakePointBounds().
Referenced by impeller::ArcStrokeGeometry::GetCoverage().
|
inlineconstexpr |
Definition at line 110 of file arc.h.
Referenced by impeller::ArcGeometry::ArcGeometry(), impeller::ArcStrokeGeometry::Dispatch(), impeller::Canvas::DrawArc(), impeller::Tessellator::FilledArc(), std::operator<<(), and impeller::Tessellator::StrokedArc().
|
inlineconstexpr |
Definition at line 114 of file arc.h.
References impeller::Degrees::degrees.
Referenced by impeller::Canvas::DrawArc(), and GetTightArcBounds().
|
inlineconstexpr |
Definition at line 112 of file arc.h.
References impeller::TRect< T >::IsSquare().
Referenced by impeller::ArcGeometry::ArcGeometry(), and impeller::Tessellator::StrokedArc().