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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 50 of file zoom2.cpp.hpp.

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