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