5 #ifndef FLUTTER_IMPELLER_GEOMETRY_SIZE_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_SIZE_H_
19 #define ONLY_ON_FLOAT_M(Modifiers, Return) \
20 template <typename U = T> \
21 Modifiers std::enable_if_t<std::is_floating_point_v<U>, Return>
22 #define ONLY_ON_FLOAT(Return) DL_ONLY_ON_FLOAT_M(, Return)
48 return TSize{std::numeric_limits<Type>::max(),
49 std::numeric_limits<Type>::max()};
56 template <
class U,
class = std::enable_if_t<std::is_arithmetic_v<U>>>
138 constexpr
size_t minimum_mip = 1u;
142 size_t result = std::min(log2(
width), log2(
height));
143 return std::max(result, minimum_mip);
149 template <
class T,
class U,
class = std::enable_if_t<std::is_arithmetic_v<U>>>
154 template <
class T,
class U,
class = std::enable_if_t<std::is_arithmetic_v<U>>>
156 return {
static_cast<T
>(s) / p.
width,
static_cast<T
>(s) / p.
height};
164 static_assert(
sizeof(
Size) == 2 *
sizeof(
Scalar));
constexpr Color operator/(T value, const Color &c)
constexpr Color operator*(T value, const Color &c)
std::ostream & operator<<(std::ostream &out, const impeller::Arc &a)
#define ONLY_ON_FLOAT_M(Modifiers, Return)
constexpr TSize operator-() const
constexpr TSize Floor() const
constexpr TSize operator/(Scalar scale) const
constexpr TSize Max(const TSize &o) const
constexpr TSize(const TSize< U > &other)
constexpr Type Area() const
constexpr TSize Min(const TSize &o) const
constexpr TSize operator*(Scalar scale) const
constexpr TSize Round() const
constexpr TSize Abs() const
constexpr Type MinDimension() const
constexpr Type MaxDimension() const
static constexpr TSize Ceil(const TSize< U > &other)
constexpr bool operator==(const TSize &s) const
constexpr bool IsSquare() const
constexpr TSize(Type dimension)
constexpr TSize operator+(const TSize &s) const
constexpr TSize Ceil() const
TSize operator*=(U scale)
constexpr TSize operator-(const TSize &s) const
constexpr TSize(Type width, Type height)
constexpr size_t MipCount() const
Return the mip count of the texture.
static constexpr TSize MakeWH(Type width, Type height)
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
constexpr bool operator!=(const TSize &s) const
constexpr TSize operator/(const TSize &s) const
static constexpr TSize Infinite()