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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 12 of file zoom2.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.003;
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 = (e->distance[x][y] * e->distance[x][y]) / 2;
23 e->animation.angle = e->polar_theta[x][y];
24
25 e->animation.scale_x = 0.005;
26 e->animation.scale_y = 0.005;
27
28 e->animation.offset_y = -10 * e->move.linear[0];
29 e->animation.offset_x = 0;
30 e->animation.offset_z = 0.1 * e->move.linear[0];
31
32 e->animation.z = 0;
33 e->animation.low_limit = 0;
34 float show1 = e->render_value(e->animation);
35
36 e->pixel.red = show1;
37 e->pixel.green = 0;
38 e->pixel.blue = 40 - show1;
39
40 e->pixel = e->rgb_sanity_check(e->pixel);
41 e->setPixelColorInternal(x, y, e->pixel);
42 }
43 }
44}

References fl::FL_NO_EXCEPT, fl::x, and fl::y.