48 template <
typename IntT, alpha_detail::enable_if_
integer_t<IntT> = 0>
75 return static_cast<unsigned char>(
76 f <= 0.0f ? 0 : (f >= 1.0f ? 255 :
static_cast<unsigned char>(f * 255.0f + 0.5f)));
93 template <
typename IntT, alpha_detail::enable_if_
integer_t<IntT> = 0>
122 template <
typename T>
124 return static_cast<T
>(
125 (
static_cast<long long>(v) *
126 static_cast<long long>(
static_cast<unsigned int>(
value) + 1u)) >> 16);
131 return static_cast<unsigned short>(
132 f <= 0.0f ? 0 : (f >= 1.0f ? 65535 :
static_cast<unsigned short>(f * 65535.0f + 0.5f)));
typename fl::enable_if< is_non_bool_integer< T >::value, int >::type enable_if_integer_t
Base definition for an LED controller.
constexpr float to_float() const FL_NOEXCEPT
constexpr alpha16(IntT v) FL_NOEXCEPT
alpha16 & operator*=(unsigned short rhs) FL_NOEXCEPT
alpha16 & operator++() FL_NOEXCEPT
alpha16 & operator+=(unsigned short rhs) FL_NOEXCEPT
constexpr T scale_signed(T v) const FL_NOEXCEPT
Scale a signed integer by this alpha (UNORM16 semantics).
alpha16 operator--(int) FL_NOEXCEPT
constexpr unsigned short raw() const FL_NOEXCEPT
alpha16 operator++(int) FL_NOEXCEPT
alpha16 & operator>>=(int rhs) FL_NOEXCEPT
constexpr alpha16(double f) FL_NOEXCEPT
constexpr alpha16(float f) FL_NOEXCEPT
constexpr alpha16() FL_NOEXCEPT
alpha16 & operator--() FL_NOEXCEPT
alpha16 & operator-=(unsigned short rhs) FL_NOEXCEPT
static constexpr alpha16 from_float(float f) FL_NOEXCEPT
alpha16 & operator<<=(int rhs) FL_NOEXCEPT
alpha16 & operator/=(unsigned short rhs) FL_NOEXCEPT
static constexpr unsigned short _clamp(float f) FL_NOEXCEPT
constexpr unsigned char raw() const FL_NOEXCEPT
constexpr alpha8(double f) FL_NOEXCEPT
alpha8 & operator--() FL_NOEXCEPT
alpha8 operator++(int) FL_NOEXCEPT
constexpr float to_float() const FL_NOEXCEPT
static constexpr alpha8 from_float(float f) FL_NOEXCEPT
constexpr alpha8(float f) FL_NOEXCEPT
alpha8 & operator>>=(int rhs) FL_NOEXCEPT
alpha8 & operator++() FL_NOEXCEPT
alpha8 & operator<<=(int rhs) FL_NOEXCEPT
alpha8 & operator+=(unsigned char rhs) FL_NOEXCEPT
alpha8 & operator*=(unsigned char rhs) FL_NOEXCEPT
static constexpr unsigned char _clamp(float f) FL_NOEXCEPT
alpha8 & operator-=(unsigned char rhs) FL_NOEXCEPT
constexpr alpha8(IntT v) FL_NOEXCEPT
alpha8 & operator/=(unsigned char rhs) FL_NOEXCEPT
alpha8 operator--(int) FL_NOEXCEPT
constexpr alpha8() FL_NOEXCEPT
static constexpr bool value