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

◆ smoothstep()

static FASTLED_FORCE_INLINE s16x16 fl::s16x16::smoothstep ( s16x16 edge0,
s16x16 edge1,
s16x16 x )
inlinestatic

Definition at line 170 of file s16x16.h.

170 {
171 constexpr s16x16 zero(0.0f);
172 constexpr s16x16 one(1.0f);
173 constexpr s16x16 two(2.0f);
174 constexpr s16x16 three(3.0f);
175 s16x16 t = clamp((x - edge0) / (edge1 - edge0), zero, one);
176 return t * t * (three - two * t);
177 }
static constexpr FASTLED_FORCE_INLINE s16x16 clamp(s16x16 x, s16x16 lo, s16x16 hi) FL_NOEXCEPT
Definition s16x16.h:162
constexpr s16x16() FL_NOEXCEPT=default

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

+ Here is the call graph for this function: