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

152 {
153 int16_t 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<uint8_t>(((static_cast<uint16_t>(value) + 32768))
157 // >>
158 // 8);
159 if (mHalfDuplex) {
160 uint16_t v2 = static_cast<uint16_t>(value);
161 v2 *= 2;
162 return static_cast<uint8_t>(v2 >> 8);
163 } else {
164 return static_cast<uint8_t>(
165 ((static_cast<uint16_t>(value) + 32768)) >> 8);
166 }
167 }
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:82
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:83
int16_t geti16(size_t x, size_t y) const

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

+ Here is the call graph for this function: