63 for (
int i = 0; i < 256; i++)
66 for (
int i = 255; i > 0; i--) {
67 s = s * 1664525u + 1013904223u;
68 int j = (int)((s >> 16) % (u32)(i + 1));
73 for (
int i = 0; i < 256; i++) {
80 int xi = ((int)
floorf(
x)) & 255;
81 int yi = ((int)
floorf(
y)) & 255;
89 int bb =
perm[
perm[xi + 1] + yi + 1];
90 float x1 =
lerp(
grad(aa, xf, yf),
grad(ba, xf - 1.0f, yf), u);
91 float x2 =
lerp(
grad(ab, xf, yf - 1.0f),
92 grad(bb, xf - 1.0f, yf - 1.0f), u);
93 return lerp(x1, x2, v);
140 return r < 0.0f ? r + m : r;
144 return (v < lo) ? lo : (v > hi) ? hi : v;
168 float rad = diam * 0.5f;
173 for (
int y = y0;
y <= y1;
y++) {
174 for (
int x = x0;
x <= x1;
x++) {
175 float dx = (
x + 0.5f) - cx;
176 float dy = (
y + 0.5f) - cy;
177 float dist =
sqrtf(dx * dx + dy * dy);
178 float cov =
clampf(rad + 0.5f - dist, 0.0f, 1.0f);
181 float inv = 1.0f - cov;
183 mR[i] =
mR[i] * inv + cr * cov;
184 mG[i] =
mG[i] * inv + cg * cov;
185 mB[i] =
mB[i] * inv + cb * cov;
197 float invSteps = 1.0f / (float)
steps;
199 for (
int i = 0; i <=
steps; i++) {
200 float u = i * invSteps;
201 float px = x0 + dx * u;
202 float py = y0 + dy * u;
211 (1.0f - fx) * (1.0f - fy),
216 int offX[4] = {0, 1, 0, 1};
217 int offY[4] = {0, 0, 1, 1};
219 for (
int j = 0; j < 4; j++) {
220 int cx = ix + offX[j];
221 int cy = iy + offY[j];
222 if (cx < 0 || cx >= w || cy < 0 || cy >= h)
224 float wt = weights[j];
227 int gi =
idx(cy, cx);
228 float inv = 1.0f - wt;
229 mR[gi] =
mR[gi] * inv + c.r * wt;
230 mG[gi] =
mG[gi] * inv + c.g * wt;
231 mB[gi] =
mB[gi] * inv + c.b * wt;
239 float cx = (w - 1) * 0.5f;
240 float cy = (h - 1) * 0.5f;
241 float s =
mParams.endpoint_speed;
244 float x1 = cx + cx * 0.742f *
sinf(
t * s * 1.13f + 0.20f);
245 float y1 = cy + cy * 0.677f *
sinf(
t * s * 1.71f + 1.30f);
246 float x2 = cx + cx * 0.774f *
sinf(
t * s * 1.89f + 2.20f);
247 float y2 = cy + cy * 0.710f *
sinf(
t * s * 1.37f + 0.70f);
253 float discDiam = 1.7f;
254 drawDot(x1, y1, discDiam, endA.r, endA.g, endA.b);
255 drawDot(x2, y2, discDiam, endB.r, endB.g, endB.b);
264 float ocx = w * 0.5f - 0.5f;
265 float ocy = h * 0.5f - 0.5f;
266 float orad = minDim * 0.35f;
267 float base =
t * 3.0f;
268 float dotDiam = 1.5f;
269 for (
int i = 0; i < n; i++) {
270 float a = base + i * (2.0f *
FL_PI / fn);
271 float cx = ocx +
cosf(a) * orad;
272 float cy = ocy +
sinf(a) * orad;
274 drawDot(cx, cy, dotDiam, c.r, c.g, c.b);
281 const float kBaseFreq = 0.23f;
283 for (
int i = 0; i < w; i++) {
290 if (
mParams.reverse_x_profile) {
291 for (
int i = 0; i < w / 2; i++) {
298 for (
int i = 0; i < h; i++) {
306 for (
int i = 0; i < w; i++) {
309 for (
int i = 0; i < h; i++) {
318 float fade =
powf(0.5f, dt / halfLife);
319 float shift =
mParams.flow_shift;
322 for (
int y = 0;
y < h;
y++) {
324 for (
int x = 0;
x < w;
x++) {
325 float sx =
fmodPos((
float)
x - sh, (
float)w);
326 int ix0 = (int)
floorf(sx) % w;
327 int ix1 = (ix0 + 1) % w;
328 float f = sx -
floorf(sx);
329 float inv = 1.0f - f;
330 int src0 =
idx(
y, ix0);
331 int src1 =
idx(
y, ix1);
333 mTR[dst] =
mR[src0] * inv +
mR[src1] * f;
334 mTG[dst] =
mG[src0] * inv +
mG[src1] * f;
335 mTB[dst] =
mB[src0] * inv +
mB[src1] * f;
340 for (
int x = 0;
x < w;
x++) {
342 for (
int y = 0;
y < h;
y++) {
343 float sy =
fmodPos((
float)
y - sh, (
float)h);
344 int iy0 = (int)
floorf(sy) % h;
345 int iy1 = (iy0 + 1) % h;
346 float f = sy -
floorf(sy);
347 float inv = 1.0f - f;
348 int src0 =
idx(iy0,
x);
349 int src1 =
idx(iy1,
x);
363 auto plotTile = [&](
const CRGB &
color,
float px,
float py,
367 float fx = px - (float)ix;
368 float fy = py - (float)iy;
373 tile.at(0, 0) = (
u8)((1.0f - fy) * 255.0f);
375 tile.at(0, 1) = (
u8)(fy * 255.0f);
379 tile.at(0, 0) = (
u8)((1.0f - fx) * 255.0f);
380 tile.at(1, 0) = (
u8)(fx * 255.0f);
388 constexpr float amp = 0.3f;
392 CRGB xColor(0, 255, 255);
393 float centerY = (float)(h - 1) * 0.5f;
395 for (
int x = 0;
x < w;
x++) {
397 float py = centerY - val * amp * centerY;
398 plotTile(xColor, (
float)
x, py,
true);
400 float dy = py - prevPy;
401 int gap = (int)
fabsf(dy);
402 for (
int s = 1; s < gap; s++) {
403 float t = (float)s / (
float)gap;
404 float midY = prevPy + dy *
t;
405 float midX = (float)(
x - 1) +
t;
406 plotTile(xColor, midX, midY,
true);
414 CRGB yColor(255, 255, 0);
415 float centerX = (float)(w - 1) * 0.5f;
417 for (
int y = 0;
y < h;
y++) {
419 float px = centerX + val * amp * centerX;
420 plotTile(yColor, px, (
float)
y,
false);
422 float dx = px - prevPx;
423 int gap = (int)
fabsf(dx);
424 for (
int s = 1; s < gap; s++) {
425 float t = (float)s / (
float)gap;
426 float midX = prevPx + dx *
t;
427 float midY = (float)(
y - 1) +
t;
428 plotTile(yColor, midX, midY,
false);
436 float dt = dt_ms * 0.001f;
437 float t = t_ms * 0.001f;
440 switch (
mParams.emitter_mode) {
459 for (
int y = 0;
y < h;
y++) {
460 for (
int x = 0;
x < w;
x++) {
461 int ledIdx =
mXyMap.mapToIndex(
x,
y);
463 context.leds.data()[ledIdx].r =
f2u8(
mR[i]);
464 context.leds.data()[ledIdx].g =
f2u8(
mG[i]);
465 context.leds.data()[ledIdx].b =
f2u8(
mB[i]);
469 if (
mParams.show_flow_vectors) {
493 for (
int i = 0; i < 256; i++)
496 for (
int i = 255; i > 0; i--) {
497 s = s * 1664525u + 1013904223u;
498 int j = (int)((s >> 16) % (u32)(i + 1));
518 if (!
mState.fade_lut_initialized) {
520 mState.fade_lut_initialized =
true;
539 return (v < lo) ? lo : (v > hi) ? hi : v;
543 i32 integer = v >> 16;
544 if (integer < 0)
return 0;
545 if (integer > 255)
return 255;
550 constexpr s16x16 one(1.0f);
551 constexpr s16x16 fp_255(255.0f);
558 u8 hue_u8 = (
u8)hue_int;
559 CHSV hsv(hue_u8, 255, 255);
573 constexpr s16x16 half(0.5f);
574 constexpr s16x16 one(1.0f);
582 s16x16 rad_plus_half = rad + half;
584 i32 threshold_sq_raw = (rad_plus_half * rad_plus_half).raw();
585 i32 cr_raw =
static_cast<i32
>(cr) << 16;
586 i32 cg_raw =
static_cast<i32
>(cg) << 16;
587 i32 cb_raw =
static_cast<i32
>(cb) << 16;
588 i32 *__restrict__ rp =
mState.r.data();
589 i32 *__restrict__ gp =
mState.g.data();
590 i32 *__restrict__ bp =
mState.b.data();
592 for (
int y = y0;
y <= y1;
y++) {
594 i32 dy_sq_raw = (dy * dy).raw();
596 if (dy_sq_raw >= threshold_sq_raw)
continue;
597 int row_base =
y * w;
598 for (
int x = x0;
x <= x1;
x++) {
600 i32 dist_sq_raw = dy_sq_raw + (dx * dx).raw();
601 if (dist_sq_raw >= threshold_sq_raw)
605 if (cov.
raw() <= 0)
continue;
606 int i = row_base +
x;
608 i32 cov_q16 = cov.
raw();
609 rp[i] +=
static_cast<i32
>((
static_cast<i64>(cr_raw - rp[i]) * cov_q16) >> 16);
610 gp[i] +=
static_cast<i32
>((
static_cast<i64>(cg_raw - gp[i]) * cov_q16) >> 16);
611 bp[i] +=
static_cast<i32
>((
static_cast<i64>(cb_raw - bp[i]) * cov_q16) >> 16);
626 i32 *__restrict__ rp =
mState.r.data();
627 i32 *__restrict__ gp =
mState.g.data();
628 i32 *__restrict__ bp =
mState.b.data();
631 s16x16 dx_step = dx * invSteps;
632 s16x16 dy_step = dy * invSteps;
637 for (
int i = 0; i <=
steps; i++, u = u + invSteps, px = px + dx_step, py = py + dy_step) {
644 constexpr s16x16 one(1.0f);
649 (inv_fx * inv_fy).raw(),
656 i32 cr_raw =
static_cast<i32
>(c.r) << 16;
657 i32 cg_raw =
static_cast<i32
>(c.g) << 16;
658 i32 cb_raw =
static_cast<i32
>(c.b) << 16;
660 int offX[4] = {0, 1, 0, 1};
661 int offY[4] = {0, 0, 1, 1};
663 for (
int j = 0; j < 4; j++) {
664 int cx = ix + offX[j];
665 int cy = iy + offY[j];
666 if (cx < 0 || cx >= w || cy < 0 || cy >= h)
668 i32 wt_q16 = weights[j];
669 if (wt_q16 <= 0)
continue;
670 int gi = cy * w + cx;
672 rp[gi] +=
static_cast<i32
>((
static_cast<i64>(cr_raw - rp[gi]) * wt_q16) >> 16);
673 gp[gi] +=
static_cast<i32
>((
static_cast<i64>(cg_raw - gp[gi]) * wt_q16) >> 16);
674 bp[gi] +=
static_cast<i32
>((
static_cast<i64>(cb_raw - bp[gi]) * wt_q16) >> 16);
682 constexpr s16x16 half(0.5f);
690 constexpr s16x16 k_0742(0.742f);
691 constexpr s16x16 k_0677(0.677f);
692 constexpr s16x16 k_0774(0.774f);
693 constexpr s16x16 k_0710(0.710f);
694 s16x16 cx_r1 = cx * k_0742;
695 s16x16 cy_r1 = cy * k_0677;
696 s16x16 cx_r2 = cx * k_0774;
697 s16x16 cy_r2 = cy * k_0710;
700 constexpr s16x16 k_113(1.13f);
701 constexpr s16x16 k_171(1.71f);
702 constexpr s16x16 k_189(1.89f);
703 constexpr s16x16 k_137(1.37f);
704 constexpr s16x16 k_020(0.20f);
705 constexpr s16x16 k_130(1.30f);
706 constexpr s16x16 k_220(2.20f);
707 constexpr s16x16 k_070(0.70f);
718 constexpr s16x16 discDiam(1.7f);
719 drawDot(x1, y1, discDiam, endA.r, endA.g, endA.b);
720 drawDot(x2, y2, discDiam, endB.r, endB.g, endB.b);
728 constexpr s16x16 half(0.5f);
729 constexpr s16x16 two_pi(6.2831853f);
736 constexpr s16x16 dotDiam(1.5f);
739 for (
int i = 0; i < n; i++) {
743 s16x16 cx = ocx + cos_a * orad;
744 s16x16 cy = ocy + sin_a * orad;
746 drawDot(cx, cy, dotDiam, c.r, c.g, c.b);
757 constexpr s16x16 kBaseFreq(0.23f);
758 constexpr s16x16 neg_one(-1.0f);
759 constexpr s16x16 one(1.0f);
761 const i32 *fade_lut =
mState.fade_lut;
767 for (
int i = 0; i < w; i++) {
776 if (
mParams.reverse_x_profile) {
777 for (
int i = 0; i < w / 2; i++) {
778 i32 tmp =
mState.x_prof[i];
780 mState.x_prof[w - 1 - i] = tmp;
788 for (
int i = 0; i < h; i++) {
798 for (
int i = 0; i < w; i++) {
801 neg_one.
raw(), one.
raw());
803 for (
int i = 0; i < h; i++) {
806 neg_one.
raw(), one.
raw());
819 constexpr s16x16 half_fp(0.5f);
820 constexpr s16x16 min_persistence(0.001f);
829 i32 w_q16 =
static_cast<i32
>(w) << 16;
830 i32 h_q16 =
static_cast<i32
>(h) << 16;
833 i32 *__restrict__ r =
mState.r.data();
834 i32 *__restrict__
g =
mState.g.data();
835 i32 *__restrict__ b =
mState.b.data();
836 i32 *__restrict__ tr =
mState.tr.data();
837 i32 *__restrict__ tg =
mState.tg.data();
838 i32 *__restrict__ tb =
mState.tb.data();
843 for (
int y = 0;
y < h;
y++) {
844 i32 sh =
static_cast<i32
>((
static_cast<i64>(
mState.y_prof[
y]) * shift_raw) >> 16);
845 int row_base =
y * w;
846 for (
int x = 0;
x < w;
x++) {
847 i32 sx_raw = (
static_cast<i32
>(
x) << 16) - sh;
849 if (sx_raw < 0) sx_raw += w_q16;
850 else if (sx_raw >= w_q16) sx_raw -= w_q16;
852 if (sx_raw < 0) sx_raw += w_q16;
853 if (sx_raw >= w_q16) sx_raw -= w_q16;
855 int ix0 = sx_raw >> 16;
856 int ix1 = (ix0 + 1 < w) ? ix0 + 1 : 0;
857 i32 f = sx_raw & 0xFFFF;
859 int src0 = row_base + ix0;
860 int src1 = row_base + ix1;
861 int dst = row_base +
x;
863 tr[dst] = r[src0] +
static_cast<i32
>((
static_cast<i64>(r[src1] - r[src0]) * f) >> 16);
864 tg[dst] =
g[src0] +
static_cast<i32
>((
static_cast<i64>(
g[src1] -
g[src0]) * f) >> 16);
865 tb[dst] = b[src0] +
static_cast<i32
>((
static_cast<i64>(b[src1] - b[src0]) * f) >> 16);
871 for (
int x = 0;
x < w;
x++) {
872 i32 sh =
static_cast<i32
>((
static_cast<i64>(
mState.x_prof[
x]) * shift_raw) >> 16);
873 for (
int y = 0;
y < h;
y++) {
874 i32 sy_raw = (
static_cast<i32
>(
y) << 16) - sh;
875 if (sy_raw < 0) sy_raw += h_q16;
876 else if (sy_raw >= h_q16) sy_raw -= h_q16;
877 if (sy_raw < 0) sy_raw += h_q16;
878 if (sy_raw >= h_q16) sy_raw -= h_q16;
880 int iy0 = sy_raw >> 16;
881 int iy1 = (iy0 + 1 < h) ? iy0 + 1 : 0;
882 i32 f = sy_raw & 0xFFFF;
884 int src0 = iy0 * w +
x;
885 int src1 = iy1 * w +
x;
889 i32 interp_r = tr[src0] +
static_cast<i32
>((
static_cast<i64>(tr[src1] - tr[src0]) * f) >> 16);
890 i32 interp_g = tg[src0] +
static_cast<i32
>((
static_cast<i64>(tg[src1] - tg[src0]) * f) >> 16);
891 i32 interp_b = tb[src0] +
static_cast<i32
>((
static_cast<i64>(tb[src1] - tb[src0]) * f) >> 16);
893 r[dst] =
static_cast<i32
>((
static_cast<i64>(interp_r) *
fade_raw) >> 16);
894 g[dst] =
static_cast<i32
>((
static_cast<i64>(interp_g) *
fade_raw) >> 16);
895 b[dst] =
static_cast<i32
>((
static_cast<i64>(interp_b) *
fade_raw) >> 16);
910 auto plotTile = [&](
const CRGB &
color,
float px,
float py,
914 float fx = px - (float)ix;
915 float fy = py - (float)iy;
919 tile.at(0, 0) = (
u8)((1.0f - fy) * 255.0f);
921 tile.at(0, 1) = (
u8)(fy * 255.0f);
924 tile.at(0, 0) = (
u8)((1.0f - fx) * 255.0f);
925 tile.at(1, 0) = (
u8)(fx * 255.0f);
933 constexpr float amp = 0.3f;
937 CRGB xColor(0, 255, 255);
938 float centerY = (float)(h - 1) * 0.5f;
940 for (
int x = 0;
x < w;
x++) {
942 float py = centerY - val.
to_float() * amp * centerY;
943 plotTile(xColor, (
float)
x, py,
true);
945 float dy = py - prevPy;
946 int gap = (int)
fabsf(dy);
947 for (
int s = 1; s < gap; s++) {
948 float t = (float)s / (
float)gap;
949 float midY = prevPy + dy *
t;
950 float midX = (float)(
x - 1) +
t;
951 plotTile(xColor, midX, midY,
true);
959 CRGB yColor(255, 255, 0);
960 float centerX = (float)(w - 1) * 0.5f;
962 for (
int y = 0;
y < h;
y++) {
964 float px = centerX + val.
to_float() * amp * centerX;
965 plotTile(yColor, px, (
float)
y,
false);
967 float dx = px - prevPx;
968 int gap = (int)
fabsf(dx);
969 for (
int s = 1; s < gap; s++) {
970 float t = (float)s / (
float)gap;
971 float midX = prevPx + dx *
t;
972 float midY = (float)(
y - 1) +
t;
973 plotTile(yColor, midX, midY,
false);
990 i32 dt_raw = dt.
raw();
993 switch (
mParams.emitter_mode) {
1013 const i32 *rp =
mState.r.data();
1014 const i32 *gp =
mState.g.data();
1015 const i32 *bp =
mState.b.data();
1017 for (
int y = 0;
y < h;
y++) {
1018 int row_base =
y * w;
1019 for (
int x = 0;
x < w;
x++) {
1020 int i = row_base +
x;
1021 u16 ledIdx =
mXyMap.mapToIndex(
static_cast<u16
>(
x),
static_cast<u16
>(
y));
1028 if (
mParams.show_flow_vectors) {
fl::UISlider colorShift("Color Shift", 0.04f, 0.0f, 0.5f, 0.01f)
virtual void drawImpl(DrawContext context, u32 dt_ms, u32 t_ms) FL_NO_EXCEPT=0
Subclasses implement rendering given the time delta and total time.
FlowField(const XYMap &xyMap, const Params ¶ms=Params()) FL_NO_EXCEPT
void draw(DrawContext context) FL_NO_EXCEPT override
Handles timing, then delegates to drawImpl().
void noisePunchY(float center, float width, float amplitude=1.0f, BumpShape shape=BumpShape::HalfSine) FL_NO_EXCEPT
Trigger a noise punch on the Y axis (rows).
void noisePunchX(float center, float width, float amplitude=1.0f, BumpShape shape=BumpShape::HalfSine) FL_NO_EXCEPT
Trigger a noise punch on the X axis (columns).
float speed() const FL_NO_EXCEPT
void noisePunch(float amplitude=1.0f, BumpShape shape=BumpShape::HalfSine) FL_NO_EXCEPT
Trigger a noise punch on both axes at center with proportional width.
FlowFieldFP(const XYMap &xyMap, const Params ¶ms=Params()) FL_NO_EXCEPT
void emitLissajousLine(s16x16 t) FL_NO_EXCEPT
void drawAALine(s16x16 x0, s16x16 y0, s16x16 x1, s16x16 y1, s16x16 t, s16x16 colorShift) FL_NO_EXCEPT
void drawDot(s16x16 cx, s16x16 cy, s16x16 diam, u8 cr, u8 cg, u8 cb) FL_NO_EXCEPT
void syncParams() FL_NO_EXCEPT
static u8 q16_to_u8(i32 v) FL_NO_EXCEPT
void drawImpl(DrawContext context, u32 dt_ms, u32 t_ms) FL_NO_EXCEPT override
Subclasses implement rendering given the time delta and total time.
static CRGB rainbow(s16x16 t, s16x16 speed, s16x16 phase) FL_NO_EXCEPT
void flowPrepare(s16x16 t) FL_NO_EXCEPT
static void initPerm256(u8 *perm, u32 seed) FL_NO_EXCEPT
static i32 clamp_q16(i32 v, i32 lo, i32 hi) FL_NO_EXCEPT
void emitOrbitalDots(s16x16 t) FL_NO_EXCEPT
void drawFlowVectors(fl::span< CRGB > leds) FL_NO_EXCEPT
void flowAdvect(i32 dt_raw) FL_NO_EXCEPT
void init(u32 seed) FL_NO_EXCEPT
float noise(float x, float y) const FL_NO_EXCEPT
static float grad(int h, float x, float y) FL_NO_EXCEPT
void drawAALine(float x0, float y0, float x1, float y1, float t, float colorShift) FL_NO_EXCEPT
fl::vector< float > mYProf
Per-row values; drives horizontal shift.
void flowPrepare(float t) FL_NO_EXCEPT
void drawDot(float cx, float cy, float diam, u8 cr, u8 cg, u8 cb) FL_NO_EXCEPT
void emitLissajousLine(float t) FL_NO_EXCEPT
void flowAdvect(float dt) FL_NO_EXCEPT
static float fmodPos(float x, float m) FL_NO_EXCEPT
fl::vector< float > mXProf
Per-column values; drives vertical shift.
void drawFlowVectors(fl::span< CRGB > leds) FL_NO_EXCEPT
static float clampf(float v, float lo, float hi) FL_NO_EXCEPT
FlowFieldFloat(const XYMap &xyMap, const Params ¶ms=Params()) FL_NO_EXCEPT
static CRGB rainbow(float t, float speed, float phase) FL_NO_EXCEPT
void drawImpl(DrawContext context, u32 dt_ms, u32 t_ms) FL_NO_EXCEPT override
Subclasses implement rendering given the time delta and total time.
int idx(int y, int x) const FL_NO_EXCEPT
static u8 f2u8(float v) FL_NO_EXCEPT
void emitOrbitalDots(float t) FL_NO_EXCEPT
u16 xyMap(u16 x, u16 y) const FL_NO_EXCEPT
u16 getWidth() const FL_NO_EXCEPT
Fx2d(const XYMap &xyMap) FL_NO_EXCEPT
u16 getHeight() const FL_NO_EXCEPT
void setOrigin(u16 x, u16 y) FL_NO_EXCEPT
constexpr float to_float() const FL_NO_EXCEPT
static constexpr i32 SCALE
constexpr FASTLED_FORCE_INLINE s16x16 fract() const FL_NO_EXCEPT
constexpr FASTLED_FORCE_INLINE s16x16 floor() const FL_NO_EXCEPT
constexpr i32 raw() const FL_NO_EXCEPT
FASTLED_FORCE_INLINE s16x16 sin() const FL_NO_EXCEPT
static constexpr FASTLED_FORCE_INLINE s16x16 clamp(s16x16 x, s16x16 lo, s16x16 hi) FL_NO_EXCEPT
static constexpr FASTLED_FORCE_INLINE s16x16 mod(s16x16 a, s16x16 b) FL_NO_EXCEPT
static constexpr FASTLED_FORCE_INLINE s16x16 from_raw(i32 raw) FL_NO_EXCEPT
static FASTLED_FORCE_INLINE s16x16 pow(s16x16 base, s16x16 exp) FL_NO_EXCEPT
static constexpr FASTLED_FORCE_INLINE s16x16 ceil(s16x16 x) FL_NO_EXCEPT
constexpr FASTLED_FORCE_INLINE s16x16 sqrt() const FL_NO_EXCEPT
static FASTLED_FORCE_INLINE void sincos(s16x16 angle, s16x16 &out_sin, s16x16 &out_cos) FL_NO_EXCEPT
constexpr i32 to_int() const FL_NO_EXCEPT
static constexpr FASTLED_FORCE_INLINE s16x16 floor(s16x16 x) FL_NO_EXCEPT
static constexpr FASTLED_FORCE_INLINE s16x16 abs(s16x16 x) FL_NO_EXCEPT
#define FL_OPTIMIZATION_LEVEL_O3_BEGIN
#define FL_OPTIMIZATION_LEVEL_O3_END
fl::UISlider steps("Steps", 100.0f, 1.0f, 200.0f, 1.0f)
2D flow field visualization: emitters paint color, noise advects it
CRGB hsv2rgb_rainbow(const CHSV &hsv) FL_NO_EXCEPT
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
FASTLED_FORCE_INLINE float lerp(float t, float a, float b) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
float sinf(float value) FL_NO_EXCEPT
FASTLED_FORCE_INLINE float grad(int hash, float x, float y, float z) FL_NO_EXCEPT
void fade_raw(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy) FL_NO_EXCEPT
static constexpr i32 FP_ONE
static constexpr i32 FP_255
constexpr enable_if< is_fixed_point< T >::value, T >::type step(T edge, T x) FL_NO_EXCEPT
float sqrtf(float value) FL_NO_EXCEPT
BumpShape
Shape function for NoiseBias triggers.
float fmodf(float x, float y) FL_NO_EXCEPT
float cosf(float value) FL_NO_EXCEPT
float fabsf(float value) FL_NO_EXCEPT
FASTLED_FORCE_INLINE float fade(float t) FL_NO_EXCEPT
float powf(float base, float exponent) FL_NO_EXCEPT
float floorf(float value) FL_NO_EXCEPT
float ceilf(float value) FL_NO_EXCEPT
Base definition for an LED controller.
Representation of an 8-bit RGB pixel (Red, Green, Blue)
static fl::i32 pnoise2d_raw(fl::i32 fx_raw, fl::i32 fy_raw, const fl::i32 *fade_lut, const fl::u8 *perm) FL_NO_EXCEPT
static void init_fade_lut(fl::i32 *table) FL_NO_EXCEPT