11namespace hi {
inline namespace v1 {
15 using array_type = simd<float, 4>;
16 using value_type = array_type::value_type;
20 constexpr scale3& operator=(
scale3 const&)
noexcept =
default;
21 constexpr scale3& operator=(
scale3&&)
noexcept =
default;
25 [[nodiscard]]
constexpr explicit operator scale2()
const noexcept
32 [[nodiscard]]
constexpr explicit operator f32x4()
const noexcept
37 [[nodiscard]]
constexpr explicit scale3(f32x4
const& v) noexcept : _v(v)
42 [[nodiscard]]
constexpr explicit scale3(
vector3 const& v) noexcept : _v(
static_cast<f32x4
>(v).xyz1()) {}
44 [[nodiscard]]
constexpr scale3() noexcept : _v(1.0f, 1.0f, 1.0f, 1.0f) {}
46 [[nodiscard]]
constexpr scale3(
float value) noexcept : _v(value, value, value, 1.0f) {}
48 [[nodiscard]]
constexpr scale3(
float x,
float y,
float z = 1.0f) noexcept : _v(x, y, z, 1.0f) {}
57 hilet non_uniform_scale =
static_cast<f32x4
>(dst_extent).xyzx() /
static_cast<f32x4
>(src_extent).xyzx();
58 hilet uniform_scale =
std::min({non_uniform_scale.x(), non_uniform_scale.y(), non_uniform_scale.z()});
59 return scale3{uniform_scale};
62 [[nodiscard]]
constexpr friend bool operator==(
scale3 const& lhs,
scale3 const& rhs)
noexcept
64 return equal(lhs._v, rhs._v);
67 [[nodiscard]]
constexpr bool holds_invariant() const noexcept
69 return _v.w() == 1.0f;
72 [[nodiscard]]
constexpr float& x() noexcept
77 [[nodiscard]]
constexpr float& y() noexcept
82 [[nodiscard]]
constexpr float& z() noexcept
87 [[nodiscard]]
constexpr float x() const noexcept
92 [[nodiscard]]
constexpr float y() const noexcept
97 [[nodiscard]]
constexpr float z() const noexcept
106[[nodiscard]]
constexpr scale3 operator/(extent3
const& lhs, extent3
const& rhs)
noexcept
108 return scale3{f32x4{lhs}.xyz1() / f32x4{rhs}.xyz1()};
Defined the geo::extent, extent2 and extent3 types.
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
@ other
The gui_event does not have associated data.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
A high-level geometric extent.
Definition extent3.hpp:27
static constexpr scale3 uniform(extent3 src_extent, extent3 dst_extent) noexcept
Get a uniform-scale-transform to scale an extent to another extent.
Definition scale3.hpp:55
A high-level geometric vector Part of the high-level vector, point, mat and color types.
Definition vector3.hpp:19