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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

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

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

References fl::Context::mEngine, fl::sqrtf(), fl::x, and fl::y.

+ Here is the call graph for this function: