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

◆ setf()

void fl::WaveSimulation1D::setf ( fl::size x,
float value )

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

376 {
377 if (!has(x))
378 return;
379 value = fl::clamp(value, -1.0f, 1.0f);
380 u8 mult = fl::max(1, mMultiplier);
381 for (u32 i = 0; i < mult; ++i) {
382 mSim->set(x * mult + i, value);
383 }
384}
fl::unique_ptr< WaveSimulation1D_Real > mSim
bool has(fl::size x) const
unsigned char u8
Definition stdint.h:131
constexpr int type_rank< T >::value
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Definition math.h:75
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NOEXCEPT

References fl::clamp(), has(), fl::max(), mMultiplier, mSim, fl::type_rank< T >::value, and fl::x.

Referenced by ~WaveSimulation1D().

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