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

◆ getu8()

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

Definition at line 73 of file wave_simulation_real.h.

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

References geti16(), mHalfDuplex, and x.

+ Here is the call graph for this function: