FastLED 3.10.8
Loading...
Searching...
No Matches

◆ coordToU8< fl::s16x16 >()

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

Definition at line 50 of file primitives.h.

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

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

+ Here is the call graph for this function: