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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 54 of file module_experiment1.cpp.hpp.

54 {
55 auto *e = ctx.mEngine.get();
56 e->get_ready();
57 mState.ensureCache(e);
58 const fl::i32 *fade_lut = fl::assume_aligned<16>(mState.fade_lut);
59 const fl::u8 *perm = PERLIN_NOISE;
60
61 e->timings.master_speed = 0.03;
62 e->timings.ratio[0] = 0.0025;
63 e->timings.ratio[1] = 0.0027;
64 e->timings.ratio[2] = 0.029;
65 e->timings.ratio[3] = 0.033;
66
67 e->calculate_oscillators(e->timings);
68
69 for (int x = 0; x < e->num_x; x++) {
70 for (int y = 0; y < e->num_y; y++) {
71
72 e->animation.dist = e->distance[x][y] + 20 * e->move.directional[0];
73 e->animation.angle = e->move.noise_angle[0] + e->move.noise_angle[1] +
74 e->polar_theta[x][y];
75 e->animation.z = 5;
76 e->animation.scale_x = 0.1;
77 e->animation.scale_y = 0.1;
78 e->animation.offset_z = -10;
79 e->animation.offset_y = 20 * e->move.linear[2];
80 e->animation.offset_x = 10;
81 e->animation.low_limit = 0;
82 e->show1 = render_value_fp_from_float(e->animation, fade_lut, perm);
83
84 e->pixel.red = 0;
85 e->pixel.green = 0;
86 e->pixel.blue = e->show1;
87
88 e->pixel = e->rgb_sanity_check(e->pixel);
89
90 e->setPixelColorInternal(x, y, e->pixel);
91 }
92 }
93}
unsigned char u8
Definition s16x16x4.h:132
T * assume_aligned(T *ptr) FL_NOEXCEPT
Definition s16x16x4.h:126
FASTLED_FORCE_INLINE fl::i32 render_value_fp_from_float(const render_parameters &anim, const fl::i32 *fade_lut, const fl::u8 *perm)

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

+ Here is the call graph for this function: