5 #ifndef FLUTTER_IMPELLER_GEOMETRY_ROUND_RECT_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_ROUND_RECT_H_
55 [[nodiscard]] constexpr
bool IsFinite()
const {
65 [[nodiscard]] constexpr
bool IsRect()
const {
69 [[nodiscard]] constexpr
bool IsOval()
const {
126 return bounds_ == rr.bounds_ && radii_ == rr.radii_;
130 return !(*
this == r);
135 : bounds_(bounds), radii_(radii) {}
138 RoundingRadii radii_;
constexpr bool ScalarNearlyEqual(Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
std::ostream & operator<<(std::ostream &out, const impeller::Color &c)
constexpr bool IsFinite() const
constexpr const RoundingRadii & GetRadii() const
static RoundRect MakeRectRadii(const Rect &rect, const RoundingRadii &radii)
constexpr static RoundRect MakeRectRadius(const Rect &rect, Scalar radius)
constexpr RoundRect Expand(Scalar horizontal, Scalar vertical) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr bool IsEmpty() const
constexpr bool operator==(const RoundRect &rr) const
constexpr static RoundRect MakeNinePatch(const Rect &rect, Scalar left, Scalar top, Scalar right, Scalar bottom)
constexpr bool IsRect() const
constexpr static RoundRect MakeOval(const Rect &rect)
constexpr RoundRect Expand(Scalar left, Scalar top, Scalar right, Scalar bottom) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr bool operator!=(const RoundRect &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 RoundRect MakeRect(const Rect &rect)
constexpr RoundRect Shift(Scalar dx, Scalar dy) const
Returns a new round rectangle translated by the given offset.
constexpr const Rect & GetBounds() const
constexpr bool IsOval() const
constexpr RoundRect Expand(Scalar amount) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr static RoundRect MakeRectXY(const Rect &rect, Scalar x_radius, Scalar y_radius)
constexpr static RoundRect MakeRectXY(const Rect &rect, Size corner_radii)
constexpr static RoundingRadii MakeNinePatch(Scalar left, Scalar top, Scalar right, Scalar bottom)
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|.