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

◆ getu8()

uint8_t fl::WaveSimulation2D_Real::getu8 ( size_t x,
size_t y ) const
inline

Definition at line 149 of file wave_simulation_real.h.

149 {
150 int16_t value = geti16(x, y);
151 // Rebase the range from [-32768, 32767] to [0, 65535] then extract the
152 // upper 8 bits.
153 // return static_cast<uint8_t>(((static_cast<uint16_t>(value) + 32768))
154 // >>
155 // 8);
156 if (mHalfDuplex) {
157 uint16_t v2 = static_cast<uint16_t>(value);
158 v2 *= 2;
159 return static_cast<uint8_t>(v2 >> 8);
160 } else {
161 return static_cast<uint8_t>(
162 ((static_cast<uint16_t>(value) + 32768)) >> 8);
163 }
164 }
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81
int16_t geti16(size_t x, size_t y) const

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

+ Here is the call graph for this function: