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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 119 of file fluffy_blobs.cpp.hpp.

119 {
120 auto *e = ctx.mEngine.get();
121 mState.ensureCache(e);
122 const fl::i32 *fade_lut = fl::assume_aligned<16>(mState.fade_lut);
123 const fl::u8 *perm = PERLIN_NOISE;
124
125 e->timings.master_speed = 0.015;
126 float size = 0.15;
127 float radial_speed = 1;
128 float linear_speed = 5;
129
130 e->timings.ratio[0] = 0.025;
131 e->timings.ratio[1] = 0.026;
132 e->timings.ratio[2] = 0.027;
133 e->timings.ratio[3] = 0.028;
134 e->timings.ratio[4] = 0.029;
135 e->timings.ratio[5] = 0.030;
136 e->timings.ratio[6] = 0.031;
137 e->timings.ratio[7] = 0.032;
138 e->timings.ratio[8] = 0.033;
139
140 e->calculate_oscillators(e->timings);
141
142 for (int x = 0; x < e->num_x; x++) {
143 for (int y = 0; y < e->num_y; y++) {
144
145 e->animation.dist = e->distance[x][y];
146 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[0]);
147 e->animation.z = 5;
148 e->animation.scale_x = size;
149 e->animation.scale_y = size;
150 e->animation.offset_z = 0;
151 e->animation.offset_x = 0;
152 e->animation.offset_y = linear_speed * e->move.linear[0];
153 e->animation.low_limit = 0;
154 e->animation.high_limit = 1;
155 e->show1 = render_value_fp_from_float(e->animation, fade_lut, perm);
156
157 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[1]);
158 e->animation.offset_y = linear_speed * e->move.linear[1];
159 e->animation.offset_z = 200;
160 e->animation.scale_x = size * 1.1;
161 e->animation.scale_y = size * 1.1;
162 e->show2 = render_value_fp_from_float(e->animation, fade_lut, perm);
163
164 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[2]);
165 e->animation.offset_y = linear_speed * e->move.linear[2];
166 e->animation.offset_z = 400;
167 e->animation.scale_x = size * 1.2;
168 e->animation.scale_y = size * 1.2;
169 e->show3 = render_value_fp_from_float(e->animation, fade_lut, perm);
170
171 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[3]);
172 e->animation.offset_y = linear_speed * e->move.linear[3];
173 e->animation.offset_z = 600;
174 e->animation.scale_x = size;
175 e->animation.scale_y = size;
176 e->show4 = render_value_fp_from_float(e->animation, fade_lut, perm);
177
178 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[4]);
179 e->animation.offset_y = linear_speed * e->move.linear[4];
180 e->animation.offset_z = 800;
181 e->animation.scale_x = size * 1.1;
182 e->animation.scale_y = size * 1.1;
183 e->show5 = render_value_fp_from_float(e->animation, fade_lut, perm);
184
185 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[5]);
186 e->animation.offset_y = linear_speed * e->move.linear[5];
187 e->animation.offset_z = 1800;
188 e->animation.scale_x = size * 1.2;
189 e->animation.scale_y = size * 1.2;
190 e->show6 = render_value_fp_from_float(e->animation, fade_lut, perm);
191
192 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[6]);
193 e->animation.offset_y = linear_speed * e->move.linear[6];
194 e->animation.offset_z = 2800;
195 e->animation.scale_x = size;
196 e->animation.scale_y = size;
197 e->show7 = render_value_fp_from_float(e->animation, fade_lut, perm);
198
199 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[7]);
200 e->animation.offset_y = linear_speed * e->move.linear[7];
201 e->animation.offset_z = 3800;
202 e->animation.scale_x = size * 1.1;
203 e->animation.scale_y = size * 1.1;
204 e->show8 = render_value_fp_from_float(e->animation, fade_lut, perm);
205
206 e->animation.angle = e->polar_theta[x][y] + (radial_speed * e->move.radial[8]);
207 e->animation.offset_y = linear_speed * e->move.linear[8];
208 e->animation.offset_z = 4800;
209 e->animation.scale_x = size * 1.2;
210 e->animation.scale_y = size * 1.2;
211 e->show9 = render_value_fp_from_float(e->animation, fade_lut, perm);
212
213 e->pixel.red = 0.8 * (e->show1 + e->show2 + e->show3) + (e->show4 + e->show5 + e->show6);
214 e->pixel.green = 0.8 * (e->show4 + e->show5 + e->show6);
215 e->pixel.blue = 0.3 * (e->show7 + e->show8 + e->show9);
216
217 e->pixel = e->rgb_sanity_check(e->pixel);
218
219 e->setPixelColorInternal(x, y, e->pixel);
220 }
221 }
222}
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: