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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 53 of file zoom.cpp.hpp.

53 {
54 auto *e = ctx.mEngine.get();
55 e->get_ready();
56 mState.ensureCache(e);
57 const fl::i32 *fade_lut = fl::assume_aligned<16>(mState.fade_lut);
58 const fl::u8 *perm = PERLIN_NOISE;
59
60 e->run_default_oscillators();
61 e->timings.master_speed = 0.003;
62 e->calculate_oscillators(e->timings);
63
64 for (int x = 0; x < e->num_x; x++) {
65 for (int y = 0; y < e->num_y; y++) {
66 e->animation.dist = (e->distance[x][y] * e->distance[x][y]) / 2;
67 e->animation.angle = e->polar_theta[x][y];
68
69 e->animation.scale_x = 0.005;
70 e->animation.scale_y = 0.005;
71
72 e->animation.offset_y = -10 * e->move.linear[0];
73 e->animation.offset_x = 0;
74 e->animation.offset_z = 0;
75
76 e->animation.z = 0;
77 e->animation.low_limit = 0;
78 float show1 = render_value_fp_from_float(e->animation, fade_lut, perm);
79
80 float linear = 1;
81
82 e->pixel.red = show1 * linear;
83 e->pixel.green = 0;
84 e->pixel.blue = 0;
85
86 e->pixel = e->rgb_sanity_check(e->pixel);
87 e->setPixelColorInternal(x, y, e->pixel);
88 }
89 }
90}
FPVizState mState
Definition zoom.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: