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

◆ float_to_fixed()

i16 fl::wave_detail::float_to_fixed ( float f)

Definition at line 19 of file wave_simulation_real.cpp.hpp.

19 {
20 f = fl::clamp(f, -1.0f, 1.0f);
21 if (f < 0.0f) {
22 return (i16)(f * INT16_NEG);
23 } else {
24 return (i16)(f * INT16_POS); // Round to nearest
25 }
26}
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NOEXCEPT
#define INT16_NEG
#define INT16_POS

References fl::clamp(), INT16_NEG, and INT16_POS.

Referenced by fl::WaveSimulation1D_Real::WaveSimulation1D_Real(), fl::WaveSimulation2D_Real::WaveSimulation2D_Real(), compute_damp_decay_q15(), fl::WaveSimulation1D_Real::set(), fl::WaveSimulation2D::setf(), fl::WaveSimulation2D_Real::setf(), fl::WaveSimulation1D_Real::setSpeed(), and fl::WaveSimulation2D_Real::setSpeed().

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