5 #ifndef FLUTTER_IMPELLER_GEOMETRY_ROUND_SUPERELLIPSE_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_ROUND_SUPERELLIPSE_H_
51 [[nodiscard]] constexpr
bool IsFinite()
const {
61 [[nodiscard]] constexpr
bool IsRect()
const {
65 [[nodiscard]] constexpr
bool IsOval()
const {
122 return bounds_ == rr.bounds_ && radii_ == rr.radii_;
126 return !(*
this == r);
139 : bounds_(bounds), radii_(radii) {}
142 RoundingRadii radii_;
constexpr bool ScalarNearlyEqual(Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
std::ostream & operator<<(std::ostream &out, const impeller::Color &c)
constexpr RoundSuperellipse Expand(Scalar left, Scalar top, Scalar right, Scalar bottom) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr RoundSuperellipse Expand(Scalar horizontal, Scalar vertical) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr static RoundSuperellipse MakeRectXY(const Rect &rect, Size corner_radii)
RoundSuperellipse()=default
constexpr static RoundSuperellipse MakeOval(const Rect &rect)
constexpr const RoundingRadii & GetRadii() const
static RoundSuperellipse MakeRectRadii(const Rect &rect, const RoundingRadii &radii)
constexpr bool IsOval() const
constexpr static RoundSuperellipse MakeRect(const Rect &rect)
constexpr bool IsFinite() const
constexpr bool IsEmpty() const
constexpr RoundSuperellipse Expand(Scalar amount) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr bool IsRect() const
constexpr RoundSuperellipse Shift(Scalar dx, Scalar dy) const
Returns a new round rectangle translated by the given offset.
constexpr static RoundSuperellipse MakeRectRadius(const Rect &rect, Scalar radius)
RoundRect ToApproximateRoundRect() const
constexpr const Rect & GetBounds() const
constexpr bool operator==(const RoundSuperellipse &rr) const
constexpr bool operator!=(const RoundSuperellipse &r) const
bool Contains(const Point &p) const
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
constexpr static RoundSuperellipse MakeRectXY(const Rect &rect, Scalar x_radius, Scalar y_radius)
constexpr bool AreAllCornersEmpty() const
constexpr static RoundingRadii MakeRadii(Size radii)
constexpr bool AreAllCornersSame(Scalar tolerance=kEhCloseEnough) const
constexpr static RoundingRadii MakeRadius(Scalar radius)
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 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.
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...
IsFinite() const
Returns true if all of the fields of this floating point rectangle are finite.
constexpr TRect< T > Shift(T dx, T dy) const
Returns a new rectangle translated by the given offset.
constexpr Type GetWidth() const
Returns the width of the rectangle, equivalent to |GetSize().width|.