 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_GEOMETRY_SIZE_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_SIZE_H_
39 return TSize{std::numeric_limits<Type>::max(),
40 std::numeric_limits<Type>::max()};
116 constexpr
size_t minimum_mip = 1u;
120 size_t result = std::max(ceil(log2(
width)), ceil(log2(
height)));
121 return std::max(result, minimum_mip);
127 template <
class T,
class U,
class = std::enable_if_t<std::is_arithmetic_v<U>>>
132 template <
class T,
class U,
class = std::enable_if_t<std::is_arithmetic_v<U>>>
134 return {
static_cast<T
>(s) / p.
width,
static_cast<T
>(s) / p.
height};
140 static_assert(
sizeof(
Size) == 2 *
sizeof(
Scalar));
155 #endif // FLUTTER_IMPELLER_GEOMETRY_SIZE_H_
constexpr TSize operator/(Scalar scale) const
constexpr bool operator==(const TSize &s) const
constexpr bool IsSquare() const
constexpr TSize Ceil() const
constexpr TSize Min(const TSize &o) const
constexpr Type MaxDimension() const
std::ostream & operator<<(std::ostream &out, const impeller::Color &c)
constexpr Color operator*(T value, const Color &c)
constexpr TSize operator+(const TSize &s) const
constexpr TSize Round() const
constexpr TSize(const TSize< U > &other)
constexpr TSize operator-() const
constexpr TSize Max(const TSize &o) const
constexpr TSize Abs() const
constexpr TSize operator/(const TSize &s) const
constexpr bool operator!=(const TSize &s) const
static constexpr TSize Ceil(const TSize< U > &other)
constexpr Type Area() const
constexpr Color operator/(T value, const Color &c)
static constexpr TSize Infinite()
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
constexpr size_t MipCount() const
constexpr TSize Floor() const
static constexpr TSize MakeWH(Type width, Type height)
constexpr TSize operator-(const TSize &s) const
constexpr TSize(Type width, Type height)
constexpr TSize operator*(Scalar scale) const