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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

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

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