FastLED 3.10.8
Loading...
Searching...
No Matches

◆ draw()

void fl::Slow_Fade::draw ( Context & ctx)
overridevirtual

Implements fl::IAnimartrix2Viz.

Definition at line 12 of file slow_fade.cpp.hpp.

12 {
13 auto *e = ctx.mEngine.get();
14 e->get_ready();
15
16 e->run_default_oscillators();
17 e->timings.master_speed = 0.00005;
18 e->calculate_oscillators(e->timings);
19
20 for (int x = 0; x < e->num_x; x++) {
21 for (int y = 0; y < e->num_y; y++) {
22 e->animation.dist =
23 fl::sqrtf(e->distance[x][y]) * 0.7 * (e->move.directional[0] + 1.5);
24 e->animation.angle =
25 e->polar_theta[x][y] - e->move.radial[0] + e->distance[x][y] / 5;
26
27 e->animation.scale_x = 0.11;
28 e->animation.scale_y = 0.11;
29
30 e->animation.offset_y = -50 * e->move.linear[0];
31 e->animation.offset_x = 0;
32 e->animation.offset_z = 0;
33
34 e->animation.z = e->move.linear[0];
35 e->animation.low_limit = -0.1;
36 e->animation.high_limit = 1;
37 float show1 = e->render_value(e->animation);
38
39 e->animation.dist = e->animation.dist * 1.1;
40 e->animation.angle += e->move.noise_angle[0] / 10;
41 float show2 = e->render_value(e->animation);
42
43 e->animation.dist = e->animation.dist * 1.1;
44 e->animation.angle += e->move.noise_angle[1] / 10;
45 float show3 = e->render_value(e->animation);
46
47 float radius = e->radial_filter_radius;
48 float radial = (radius - e->distance[x][y]) / e->distance[x][y];
49
50 e->pixel.red = radial * show1;
51 e->pixel.green = radial * (show1 - show2) / 6;
52 e->pixel.blue = radial * (show1 - show3) / 5;
53
54 e->pixel = e->rgb_sanity_check(e->pixel);
55 e->setPixelColorInternal(x, y, e->pixel);
56 }
57 }
58}
float sqrtf(float value) FL_NO_EXCEPT
Definition math.h:461

References fl::FL_NO_EXCEPT, fl::sqrtf(), fl::x, and fl::y.

+ Here is the call graph for this function: