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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

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

12 {
13 auto *e = ctx.mEngine.get();
14 e->get_ready();
15
16 e->timings.master_speed = 0.01;
17 e->timings.ratio[0] = 1;
18 e->timings.ratio[1] = 1.1;
19 e->timings.ratio[2] = 1.2;
20
21 e->timings.offset[1] = 100;
22 e->timings.offset[2] = 200;
23 e->timings.offset[3] = 300;
24
25 e->calculate_oscillators(e->timings);
26
27 for (int x = 0; x < e->num_x; x++) {
28 for (int y = 0; y < e->num_y; y++) {
29 e->animation.angle = 5;
30 e->animation.scale_x = 0.2;
31 e->animation.scale_y = 0.2;
32 e->animation.scale_z = 1;
33 e->animation.dist = e->distance[x][y];
34 e->animation.offset_y = -e->move.linear[0];
35 e->animation.offset_x = 0;
36 float show1 = e->render_value(e->animation);
37
38 e->animation.angle = 10;
39 e->animation.dist = e->distance[x][y];
40 e->animation.offset_y = -e->move.linear[1];
41 float show2 = e->render_value(e->animation);
42
43 e->animation.angle = 12;
44 e->animation.dist = e->distance[x][y];
45 e->animation.offset_y = -e->move.linear[2];
46 float show3 = e->render_value(e->animation);
47
48 e->pixel.red = show1;
49 e->pixel.green = show2 / 4;
50 e->pixel.blue = show3 / 4;
51
52 e->pixel = e->rgb_sanity_check(e->pixel);
53 e->setPixelColorInternal(x, y, e->pixel);
54 }
55 }
56}

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