11#include "../utility/module.hpp"
14namespace hi::inline
v1 {
16[[nodiscard]]
constexpr int8_t make_snorm_r8_value(
float rhs)
noexcept
18 return narrow_cast<int8_t>(
std::round(std::clamp(rhs, -1.0f, 1.0f) * 127.0f));
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
45 return narrow_cast<float>(value) / 127.0f;
DOXYGEN BUG.
Definition algorithm.hpp:13
1 x int8_t pixel format.
Definition snorm_r8.hpp:25