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 152 of file wave_simulation_real.h.

152 {
153 i16 value = geti16(x, y);
154 // Rebase the range from [-32768, 32767] to [0, 65535] then extract the
155 // upper 8 bits.
156 // return static_cast<u8>(((static_cast<u16>(value) + 32768))
157 // >>
158 // 8);
159 if (mHalfDuplex) {
160 u16 v2 = static_cast<u16>(value);
161 v2 *= 2;
162 return static_cast<u8>(v2 >> 8);
163 } else {
164 return static_cast<u8>(
165 ((static_cast<u16>(value) + 32768)) >> 8);
166 }
167 }
int y
Definition simple.h:93
int x
Definition simple.h:92
i16 geti16(fl::size x, fl::size y) const
unsigned char u8
Definition int.h:17

References geti16(), mHalfDuplex, x, and y.

+ Here is the call graph for this function: