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

◆ smoothstep()

template<typename Derived, int IntBits, int FracBits>
static FASTLED_FORCE_INLINE Derived fl::fixed_point_base< Derived, IntBits, FracBits >::smoothstep ( Derived edge0,
Derived edge1,
Derived x )
inlinestatic

Definition at line 155 of file base.h.

155 {
156 constexpr Derived zero(0.0f);
157 constexpr Derived one(1.0f);
158 constexpr Derived two(2.0f);
159 constexpr Derived three(3.0f);
160 Derived t = clamp((x - edge0) / (edge1 - edge0), zero, one);
161 return t * t * (three - two * t);
162 }
static constexpr FASTLED_FORCE_INLINE Derived clamp(Derived x, Derived lo, Derived hi)
Definition base.h:147

References clamp(), FASTLED_FORCE_INLINE, fl::t, and fl::x.

+ Here is the call graph for this function: