11#include "../utility/module.hpp"
14namespace hi::inline
v1 {
16[[nodiscard]]
constexpr int8_t make_snorm_r8_value(
float rhs)
noexcept
18 return round_cast<int8_t>(std::clamp(rhs, -1.0f, 1.0f) * 127.0f);
29 snorm_r8(snorm_r8
const &rhs)
noexcept =
default;
30 snorm_r8(snorm_r8 &&rhs)
noexcept =
default;
31 snorm_r8 &operator=(snorm_r8
const &rhs)
noexcept =
default;
32 snorm_r8 &operator=(snorm_r8 &&rhs)
noexcept =
default;
33 ~snorm_r8() =
default;
35 explicit snorm_r8(
float rhs) noexcept : value(make_snorm_r8_value(rhs)) {}
37 snorm_r8 &operator=(
float rhs)
noexcept
39 value = make_snorm_r8_value(rhs);
43 explicit operator float()
const noexcept
DOXYGEN BUG.
Definition algorithm.hpp:13
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:367