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

◆ geti16Previous()

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

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

113 {
114 if (!has(x, y))
115 return 0;
116 i32 sum = 0;
117 u8 mult = fl::max(1, mMultiplier);
118 for (u32 j = 0; j < mult; ++j) {
119 for (u32 i = 0; i < mult; ++i) {
120 sum +=
121 mSim->geti16Previous(x * mult + i, y * mult + j);
122 }
123 }
124 i16 out = static_cast<i16>(sum / (mult * mult));
125 return out;
126}
bool has(fl::size x, fl::size y) const
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_NOEXCEPT
Definition math.h:75

References 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: