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

◆ setf()

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

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

377 {
378 if (!has(x))
379 return;
380 value = fl::clamp(value, -1.0f, 1.0f);
381 u8 mult = fl::max(1, mMultiplier);
382 for (u32 i = 0; i < mult; ++i) {
383 mSim->set(x * mult + i, value);
384 }
385}
fl::unique_ptr< WaveSimulation1D_Real > mSim
bool has(fl::size x) const FL_NO_EXCEPT
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
constexpr int type_rank< T >::value
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NO_EXCEPT

References fl::clamp(), fl::FL_NO_EXCEPT, 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: