5#ifndef FLUTTER_IMPELLER_GEOMETRY_ROUND_SUPERELLIPSE_H_
6#define FLUTTER_IMPELLER_GEOMETRY_ROUND_SUPERELLIPSE_H_
52 [[nodiscard]]
constexpr bool IsFinite()
const {
62 [[nodiscard]]
constexpr bool IsRect()
const {
66 [[nodiscard]]
constexpr bool IsOval()
const {
123 return bounds_ == rr.bounds_ && radii_ == rr.radii_;
136 : bounds_(bounds), radii_(radii) {}
139 RoundingRadii radii_;
150 return round_superellipse_;
173inline std::ostream&
operator<<(std::ostream& out,
Collection of functions to receive path segments from the underlying path representation via the DlPa...
const RoundSuperellipse & GetRoundSuperellipse() const
Rect GetBounds() const override
bool IsConvex() const override
~RoundSuperellipsePathSource()
FillType GetFillType() const override
void Dispatch(PathReceiver &receiver) const override
constexpr bool ScalarNearlyEqual(Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
std::ostream & operator<<(std::ostream &out, const impeller::Arc &a)
constexpr const Rect & GetBounds() const
RoundSuperellipse Expand(Scalar amount) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
RoundSuperellipse()=default
static RoundSuperellipse MakeRectRadii(const Rect &rect, const RoundingRadii &radii)
constexpr bool IsOval() const
constexpr bool IsFinite() const
constexpr bool IsEmpty() const
RoundSuperellipse Expand(Scalar left, Scalar top, Scalar right, Scalar bottom) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr bool IsRect() const
static RoundSuperellipse MakeOval(const Rect &rect)
RoundRect ToApproximateRoundRect() const
RoundSuperellipse Expand(Scalar horizontal, Scalar vertical) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
RoundSuperellipse Shift(Scalar dx, Scalar dy) const
Returns a new round rectangle translated by the given offset.
static RoundSuperellipse MakeRect(const Rect &rect)
static RoundSuperellipse MakeRectRadius(const Rect &rect, Scalar radius)
constexpr const RoundingRadii & GetRadii() const
constexpr bool operator==(const RoundSuperellipse &rr) const
bool Contains(const Point &p) const
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
static RoundSuperellipse MakeRectXY(const Rect &rect, Size corner_radii)
static RoundSuperellipse MakeRectXY(const Rect &rect, Scalar x_radius, Scalar y_radius)
static constexpr RoundingRadii MakeRadii(Size radii)
constexpr bool AreAllCornersEmpty() const
static constexpr RoundingRadii MakeRadius(Scalar radius)
constexpr bool AreAllCornersSame(Scalar tolerance=kEhCloseEnough) const
constexpr TSize< Type > GetSize() const
Returns the size of the rectangle which may be negative in either width or height and may have been c...
constexpr Type GetHeight() const
Returns the height of the rectangle, equivalent to |GetSize().height|.
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
IsFinite() const
Returns true if all of the fields of this floating point rectangle are finite.
constexpr Type GetWidth() const
Returns the width of the rectangle, equivalent to |GetSize().width|.
constexpr TRect< T > Expand(T left, T top, T right, T bottom) const
Returns a rectangle with expanded edges. Negative expansion results in shrinking.
constexpr TRect< T > Shift(T dx, T dy) const
Returns a new rectangle translated by the given offset.