FastLED 3.9.15
Loading...
Searching...
No Matches

◆ coordToU8< fl::s16x16 >()

template<>
fl::u8 fl::gfx::coordToU8< fl::s16x16 > ( fl::s16x16 alpha)
inline

Definition at line 48 of file primitives.h.

48 {
50 constexpr fl::s16x16 half = fl::s16x16::from_raw(1 << 15);
51 return (fl::u8)fl::clamp((alpha * c255 + half).to_int(), (fl::i32)0, (fl::i32)255);
52}
static constexpr i32 SCALE
Definition s16x16.h:23
static constexpr FASTLED_FORCE_INLINE s16x16 from_raw(i32 raw) FL_NOEXCEPT
Definition s16x16.h:54
unsigned char u8
Definition s16x16x4.h:132
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NOEXCEPT

References fl::clamp(), fl::s16x16::from_raw(), and fl::s16x16::SCALE.

+ Here is the call graph for this function: