252 {
253
256 constexpr s16x16 two_pi(6.2831853f);
258 s16x16 theta = -time_factor;
259 constexpr s16x16 threshold(32.0f);
260 constexpr s16x16 zero(0.0f);
261 constexpr s16x16 max_val(255.0f);
262 for (u16 i = 0; i <
mNumLeds; ++i) {
264 if (val < threshold) {
265 val = zero;
266 } else {
267 val =
mapf(val, threshold, max_val, zero, max_val);
268 }
269 u8 val_u8 =
u8(val.to_int());
270
272 theta = theta +
step;
273 }
274}
static s16x16 mapf(s16x16 x, s16x16 in_min, s16x16 in_max, s16x16 out_min, s16x16 out_max)
s16x16 circleNoiseGen(u32 now, s16x16 theta) const
CRGBPalette16 mNoisePalette
static constexpr FASTLED_FORCE_INLINE s16x16 from_raw(i32 raw) FL_NOEXCEPT
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
constexpr enable_if< is_fixed_point< T >::value, T >::type step(T edge, T x) FL_NOEXCEPT