FastLED 3.10.8
Loading...
Searching...
No Matches

◆ geti16Previous()

i16 fl::WaveSimulation2D::geti16Previous ( fl::size x,
fl::size y ) const

Definition at line 114 of file wave_simulation.cpp.hpp.

114 {
115 if (!has(x, y))
116 return 0;
117 i32 sum = 0;
118 u8 mult = fl::max(1, mMultiplier);
119 for (u32 j = 0; j < mult; ++j) {
120 for (u32 i = 0; i < mult; ++i) {
121 sum +=
122 mSim->geti16Previous(x * mult + i, y * mult + j);
123 }
124 }
125 i16 out = static_cast<i16>(sum / (mult * mult));
126 return out;
127}
bool has(fl::size x, fl::size y) const FL_NO_EXCEPT
fl::unique_ptr< WaveSimulation2D_Real > mSim
unsigned char u8
Definition stdint.h:131
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
Definition math.h:75

References fl::FL_NO_EXCEPT, has(), fl::max(), mMultiplier, mSim, fl::x, and fl::y.

Referenced by geti16All().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: