FastLED 3.10.6
Loading...
Searching...
No Matches

◆ getu8()

u8 fl::WaveSimulation2D_Real::getu8 ( fl::size x,
fl::size y ) const
inline

Definition at line 191 of file wave_simulation_real.h.

191 {
192 i16 value = geti16(x, y);
193 // Rebase the range from [-32768, 32767] to [0, 65535] then extract the
194 // upper 8 bits.
195 // return static_cast<u8>(((static_cast<u16>(value) + 32768))
196 // >>
197 // 8);
198 if (mHalfDuplex) {
199 u16 v2 = static_cast<u16>(value);
200 v2 *= 2;
201 return static_cast<u8>(v2 >> 8);
202 } else {
203 return static_cast<u8>(
204 ((static_cast<u16>(value) + 32768)) >> 8);
205 }
206 }
i16 geti16(fl::size x, fl::size y) const
unsigned char u8
Definition stdint.h:131
constexpr int type_rank< T >::value

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

+ Here is the call graph for this function: