FastLED 3.9.15
Loading...
Searching...
No Matches
complex_kaleido_6.cpp.hpp
Go to the documentation of this file.
5
8
9namespace fl {
10
12 auto *e = ctx.mEngine.get();
13 e->get_ready();
14
15 e->timings.master_speed = 0.01;
16 e->timings.ratio[0] = 0.025;
17 e->timings.ratio[1] = 0.027;
18 e->timings.ratio[2] = 0.031;
19 e->timings.ratio[3] = 0.033;
20 e->timings.ratio[4] = 0.037;
21 e->timings.ratio[5] = 0.0038;
22 e->timings.ratio[6] = 0.041;
23
24 e->calculate_oscillators(e->timings);
25
26 for (int x = 0; x < e->num_x; x++) {
27 for (int y = 0; y < e->num_y; y++) {
28
29 e->animation.dist = e->distance[x][y];
30 e->animation.angle = 16 * e->polar_theta[x][y] + 16 * e->move.radial[0];
31 e->animation.z = 5;
32 e->animation.scale_x = 0.06;
33 e->animation.scale_y = 0.06;
34 e->animation.offset_z = -10 * e->move.linear[0];
35 e->animation.offset_y = 10 * e->move.noise_angle[0];
36 e->animation.offset_x = 10 * e->move.noise_angle[4];
37 e->animation.low_limit = 0;
38 e->show1 = e->render_value(e->animation);
39
40 e->animation.dist = e->distance[x][y];
41 e->animation.angle = 16 * e->polar_theta[x][y] + 16 * e->move.radial[1];
42 e->animation.z = 500;
43 e->animation.scale_x = 0.06;
44 e->animation.scale_y = 0.06;
45 e->animation.offset_z = -10 * e->move.linear[1];
46 e->animation.offset_y = 10 * e->move.noise_angle[1];
47 e->animation.offset_x = 10 * e->move.noise_angle[3];
48 e->animation.low_limit = 0;
49 e->show2 = e->render_value(e->animation);
50
51 e->pixel.red = e->show1;
52 e->pixel.green = 0;
53 e->pixel.blue = e->show2;
54
55 e->pixel = e->rgb_sanity_check(e->pixel);
56
57 e->setPixelColorInternal(x, y, e->pixel);
58 }
59 }
60}
61
62
63// ============================================================================
64// Fixed-Point Implementation of Complex_Kaleido_6
65// ============================================================================
66
68 auto *e = ctx.mEngine.get();
69 e->get_ready();
70 mState.ensureCache(e);
71 const fl::i32 *fade_lut = fl::assume_aligned<16>(mState.fade_lut);
72 const fl::u8 *perm = PERLIN_NOISE;
73
74 e->timings.master_speed = 0.01;
75 e->timings.ratio[0] = 0.025;
76 e->timings.ratio[1] = 0.027;
77 e->timings.ratio[2] = 0.031;
78 e->timings.ratio[3] = 0.033;
79 e->timings.ratio[4] = 0.037;
80 e->timings.ratio[5] = 0.0038;
81 e->timings.ratio[6] = 0.041;
82
83 e->calculate_oscillators(e->timings);
84
85 for (int x = 0; x < e->num_x; x++) {
86 for (int y = 0; y < e->num_y; y++) {
87
88 e->animation.dist = e->distance[x][y];
89 e->animation.angle = 16 * e->polar_theta[x][y] + 16 * e->move.radial[0];
90 e->animation.z = 5;
91 e->animation.scale_x = 0.06;
92 e->animation.scale_y = 0.06;
93 e->animation.offset_z = -10 * e->move.linear[0];
94 e->animation.offset_y = 10 * e->move.noise_angle[0];
95 e->animation.offset_x = 10 * e->move.noise_angle[4];
96 e->animation.low_limit = 0;
97 e->show1 = render_value_fp_from_float(e->animation, fade_lut, perm);
98
99 e->animation.dist = e->distance[x][y];
100 e->animation.angle = 16 * e->polar_theta[x][y] + 16 * e->move.radial[1];
101 e->animation.z = 500;
102 e->animation.scale_x = 0.06;
103 e->animation.scale_y = 0.06;
104 e->animation.offset_z = -10 * e->move.linear[1];
105 e->animation.offset_y = 10 * e->move.noise_angle[1];
106 e->animation.offset_x = 10 * e->move.noise_angle[3];
107 e->animation.low_limit = 0;
108 e->show2 = render_value_fp_from_float(e->animation, fade_lut, perm);
109
110 e->pixel.red = e->show1;
111 e->pixel.green = 0;
112 e->pixel.blue = e->show2;
113
114 e->pixel = e->rgb_sanity_check(e->pixel);
115
116 e->setPixelColorInternal(x, y, e->pixel);
117 }
118 }
119}
120
121} // namespace fl
122
void draw(Context &ctx) override
void draw(Context &ctx) override
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)
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_OPTIMIZATION_LEVEL_O3_BEGIN
#define FL_FAST_MATH_BEGIN
#define FL_FAST_MATH_END
#define FL_OPTIMIZATION_LEVEL_O3_END
fl::unique_ptr< Engine > mEngine
Definition context.h:38