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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 59 of file waves.cpp.hpp.

59 {
60 auto *e = ctx.mEngine.get();
61 e->get_ready();
62 mState.ensureCache(e);
63 const fl::i32 *fade_lut = fl::assume_aligned<16>(mState.fade_lut);
64 const fl::u8 *perm = PERLIN_NOISE;
65
66 e->timings.master_speed = 0.01;
67 e->timings.ratio[0] = 2;
68 e->timings.ratio[1] = 2.1;
69 e->timings.ratio[2] = 1.2;
70
71 e->timings.offset[1] = 100;
72 e->timings.offset[2] = 200;
73 e->timings.offset[3] = 300;
74
75 e->calculate_oscillators(e->timings);
76
77 for (int x = 0; x < e->num_x; x++) {
78 for (int y = 0; y < e->num_y; y++) {
79 e->animation.angle = e->polar_theta[x][y];
80 e->animation.scale_x = 0.1;
81 e->animation.scale_y = 0.1;
82 e->animation.scale_z = 0.1;
83 e->animation.dist = e->distance[x][y];
84 e->animation.offset_y = 0;
85 e->animation.offset_x = 0;
86 e->animation.z = 2 * e->distance[x][y] - e->move.linear[0];
87 float show1 = render_value_fp_from_float(e->animation, fade_lut, perm);
88
89 e->animation.angle = e->polar_theta[x][y];
90 e->animation.dist = e->distance[x][y];
91 e->animation.z = 2 * e->distance[x][y] - e->move.linear[1];
92 float show2 = render_value_fp_from_float(e->animation, fade_lut, perm);
93
94 e->pixel.red = show1;
95 e->pixel.green = 0;
96 e->pixel.blue = show2;
97
98 e->pixel = e->rgb_sanity_check(e->pixel);
99 e->setPixelColorInternal(x, y, e->pixel);
100 }
101 }
102}
FPVizState mState
Definition waves.h:23
T * assume_aligned(T *ptr) FL_NO_EXCEPT
Definition s16x16x4.h:126
unsigned char u8
Definition stdint.h:131
FASTLED_FORCE_INLINE fl::i32 render_value_fp_from_float(const render_parameters &anim, const fl::i32 *fade_lut, const fl::u8 *perm) FL_NO_EXCEPT

References fl::fl::assume_aligned(), fl::FL_NO_EXCEPT, mState, fl::render_value_fp_from_float(), fl::x, and fl::y.

+ Here is the call graph for this function: