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

◆ getu8()

u8 fl::WaveSimulation1D_Real::getu8 ( fl::size x) const
inline

Definition at line 72 of file wave_simulation_real.h.

72 {
73 i16 value = geti16(x);
74 // Rebase the range from [-32768, 32767] to [0, 65535] then extract the
75 // upper 8 bits.
76 // return static_cast<u8>(((static_cast<u16>(value) + 32768))
77 // >>
78 // 8);
79 if (mHalfDuplex) {
80 u16 v2 = static_cast<u16>(value);
81 v2 *= 2;
82 return static_cast<u8>(v2 >> 8);
83 } else {
84 return static_cast<u8>(
85 ((static_cast<u16>(value) + 32768)) >> 8);
86 }
87 }
unsigned char u8
Definition stdint.h:131
constexpr int type_rank< T >::value

References geti16(), mHalfDuplex, fl::type_rank< T >::value, and fl::x.

+ Here is the call graph for this function: