#include <round_superellipse.h>
Public Member Functions | |
RoundSuperellipse ()=default | |
constexpr const Rect & | GetBounds () const |
constexpr const RoundingRadii & | GetRadii () const |
constexpr bool | IsFinite () const |
constexpr bool | IsEmpty () const |
constexpr bool | IsRect () const |
constexpr bool | IsOval () const |
bool | Contains (const Point &p) const |
Returns true iff the provided point |p| is inside the half-open interior of this rectangle. More... | |
RoundSuperellipse | Shift (Scalar dx, Scalar dy) const |
Returns a new round rectangle translated by the given offset. More... | |
RoundSuperellipse | Expand (Scalar left, Scalar top, Scalar right, Scalar bottom) const |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking. More... | |
RoundSuperellipse | Expand (Scalar horizontal, Scalar vertical) const |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking. More... | |
RoundSuperellipse | Expand (Scalar amount) const |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking. More... | |
constexpr bool | operator== (const RoundSuperellipse &rr) const |
constexpr bool | operator!= (const RoundSuperellipse &r) const |
RoundRect | ToApproximateRoundRect () const |
Static Public Member Functions | |
static RoundSuperellipse | MakeRect (const Rect &rect) |
static RoundSuperellipse | MakeOval (const Rect &rect) |
static RoundSuperellipse | MakeRectRadius (const Rect &rect, Scalar radius) |
static RoundSuperellipse | MakeRectXY (const Rect &rect, Scalar x_radius, Scalar y_radius) |
static RoundSuperellipse | MakeRectXY (const Rect &rect, Size corner_radii) |
static RoundSuperellipse | MakeRectRadii (const Rect &rect, const RoundingRadii &radii) |
Definition at line 18 of file round_superellipse.h.
|
default |
Referenced by MakeRectRadii().
bool impeller::RoundSuperellipse::Contains | ( | const Point & | p | ) | const |
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
For purposes of containment, a rectangle contains points along the top and left edges but not points along the right and bottom edges so that a point is only ever considered inside one of two abutting rectangles.
Definition at line 26 of file round_superellipse.cc.
References impeller::TRect< T >::Contains(), and impeller::RoundSuperellipseParam::MakeBoundsRadii().
|
inline |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
Definition at line 115 of file round_superellipse.h.
References impeller::TRect< T >::Expand(), and MakeRectRadii().
|
inline |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
Definition at line 105 of file round_superellipse.h.
References impeller::TRect< T >::Expand(), and MakeRectRadii().
|
inline |
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
Definition at line 93 of file round_superellipse.h.
References impeller::TRect< T >::Expand(), and MakeRectRadii().
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 49 of file round_superellipse.h.
Referenced by impeller::RoundSuperellipsePathSource::Dispatch(), impeller::Canvas::DrawRoundSuperellipse(), impeller::RoundSuperellipsePathSource::GetBounds(), std::operator<<(), impeller::testing::TEST(), and ToApproximateRoundRect().
|
inlineconstexpr |
Definition at line 50 of file round_superellipse.h.
Referenced by impeller::RoundSuperellipsePathSource::Dispatch(), impeller::Canvas::DrawRoundSuperellipse(), std::operator<<(), impeller::testing::TEST(), and ToApproximateRoundRect().
|
inlineconstexpr |
Definition at line 60 of file round_superellipse.h.
References impeller::TRect< T >::IsEmpty().
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 52 of file round_superellipse.h.
References impeller::RoundingRadii::bottom_left, impeller::RoundingRadii::bottom_right, impeller::TRect< T >::IsFinite(), impeller::TSize< T >::IsFinite(), impeller::RoundingRadii::top_left, and impeller::RoundingRadii::top_right.
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 66 of file round_superellipse.h.
References impeller::RoundingRadii::AreAllCornersSame(), impeller::TRect< T >::GetHeight(), impeller::TRect< T >::GetWidth(), impeller::TSize< T >::height, impeller::TRect< T >::IsEmpty(), impeller::ScalarNearlyEqual(), impeller::RoundingRadii::top_left, and impeller::TSize< T >::width.
Referenced by impeller::testing::TEST().
|
inlineconstexpr |
Definition at line 62 of file round_superellipse.h.
References impeller::RoundingRadii::AreAllCornersEmpty(), and impeller::TRect< T >::IsEmpty().
Referenced by impeller::testing::TEST().
|
inlinestatic |
Definition at line 25 of file round_superellipse.h.
References impeller::TRect< T >::GetSize(), impeller::RoundingRadii::MakeRadii(), and MakeRectRadii().
Referenced by impeller::testing::TEST().
|
inlinestatic |
Definition at line 21 of file round_superellipse.h.
References MakeRectRadii().
Referenced by impeller::testing::TEST().
|
static |
Definition at line 12 of file round_superellipse.cc.
References impeller::TRect< T >::GetPositive(), impeller::TRect< T >::IsFinite(), RoundSuperellipse(), and impeller::RoundingRadii::Scaled().
Referenced by Expand(), MakeOval(), MakeRect(), MakeRectRadius(), MakeRectXY(), Shift(), impeller::testing::TEST(), and impeller::testing::TEST_P().
|
inlinestatic |
Definition at line 29 of file round_superellipse.h.
References impeller::RoundingRadii::MakeRadius(), and MakeRectRadii().
Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().
|
inlinestatic |
Definition at line 34 of file round_superellipse.h.
References impeller::RoundingRadii::MakeRadii(), and MakeRectRadii().
Referenced by impeller::testing::TEST().
|
inlinestatic |
Definition at line 41 of file round_superellipse.h.
References impeller::RoundingRadii::MakeRadii(), and MakeRectRadii().
|
inlineconstexpr |
Definition at line 126 of file round_superellipse.h.
|
inlineconstexpr |
Definition at line 122 of file round_superellipse.h.
|
inline |
Returns a new round rectangle translated by the given offset.
Definition at line 84 of file round_superellipse.h.
References MakeRectRadii(), and impeller::TRect< T >::Shift().
Referenced by impeller::testing::TEST().
RoundRect impeller::RoundSuperellipse::ToApproximateRoundRect | ( | ) | const |
Definition at line 34 of file round_superellipse.cc.
References GetBounds(), GetRadii(), and impeller::RoundRect::MakeRectRadii().