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

◆ getu8()

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

Definition at line 175 of file wave_simulation_real.h.

175 {
176 i16 value = geti16(x, y);
177 // Rebase the range from [-32768, 32767] to [0, 65535] then extract the
178 // upper 8 bits.
179 // return static_cast<u8>(((static_cast<u16>(value) + 32768))
180 // >>
181 // 8);
182 if (mHalfDuplex) {
183 u16 v2 = static_cast<u16>(value);
184 v2 *= 2;
185 return static_cast<u8>(v2 >> 8);
186 } else {
187 return static_cast<u8>(
188 ((static_cast<u16>(value) + 32768)) >> 8);
189 }
190 }
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: