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

◆ draw()

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

Implements fl::IAnimartrix2Viz.

Definition at line 107 of file spiral_matrix3.cpp.hpp.

107 {
108 auto *e = ctx.mEngine.get();
109 e->get_ready();
110 mState.ensureCache(e);
111 const fl::i32 *fade_lut = fl::assume_aligned<16>(mState.fade_lut);
112 const fl::u8 *perm = PERLIN_NOISE;
113
114 e->timings.master_speed = 0.02;
115 e->timings.ratio[0] = 0.025;
116 e->timings.ratio[1] = 0.027;
117 e->timings.ratio[2] = 0.031;
118 e->timings.ratio[3] = 0.0033;
119 e->timings.ratio[4] = 0.0036;
120 e->timings.ratio[5] = 0.0039;
121
122 e->calculate_oscillators(e->timings);
123
124 for (int x = 0; x < e->num_x; x++) {
125 for (int y = 0; y < e->num_y; y++) {
126
127 e->animation.dist = e->distance[x][y];
128 e->animation.angle = e->polar_theta[x][y];
129 e->animation.z = 5;
130 e->animation.scale_x = 0.09;
131 e->animation.scale_y = 0.09;
132 e->animation.offset_z = 0;
133 e->animation.offset_x = 0;
134 e->animation.offset_y = -20 * e->move.linear[0];
135 ;
136 e->animation.low_limit = -1;
137 e->animation.high_limit = 1;
138 e->show1 = render_value_fp_from_float(e->animation, fade_lut, perm);
139
140 e->animation.dist = e->distance[x][y];
141 e->animation.angle = e->polar_theta[x][y];
142 e->animation.z = 500;
143 e->animation.scale_x = 0.09;
144 e->animation.scale_y = 0.09;
145 e->animation.offset_z = 0;
146 e->animation.offset_x = 0;
147 e->animation.offset_y = -20 * e->move.linear[0];
148 ;
149 e->animation.low_limit = -1;
150 e->animation.high_limit = 1;
151 e->show2 = render_value_fp_from_float(e->animation, fade_lut, perm);
152
153 e->animation.dist = e->distance[x][y];
154 e->animation.angle = e->polar_theta[x][y];
155 e->animation.z = 50;
156 e->animation.scale_x = 0.09;
157 e->animation.scale_y = 0.09;
158 e->animation.offset_z = 0;
159 e->animation.offset_x = 500 + e->show1 / 20;
160 e->animation.offset_y = -4 * e->move.linear[0] + e->show2 / 20;
161 e->animation.low_limit = 0;
162 e->animation.high_limit = 1;
163 e->show3 = render_value_fp_from_float(e->animation, fade_lut, perm);
164
165 e->animation.dist = e->distance[x][y];
166 e->animation.angle = e->polar_theta[x][y];
167 e->animation.z = 50;
168 e->animation.scale_x = 0.09;
169 e->animation.scale_y = 0.09;
170 e->animation.offset_z = 0;
171 e->animation.offset_x = 500 + e->show1 / 18;
172 e->animation.offset_y = -4 * e->move.linear[0] + e->show2 / 18;
173 e->animation.low_limit = 0;
174 e->animation.high_limit = 1;
175 e->show4 = render_value_fp_from_float(e->animation, fade_lut, perm);
176
177 e->animation.dist = e->distance[x][y];
178 e->animation.angle = e->polar_theta[x][y];
179 e->animation.z = 50;
180 e->animation.scale_x = 0.09;
181 e->animation.scale_y = 0.09;
182 e->animation.offset_z = 0;
183 e->animation.offset_x = 500 + e->show1 / 19;
184 e->animation.offset_y = -4 * e->move.linear[0] + e->show2 / 19;
185 e->animation.low_limit = 0.3;
186 e->animation.high_limit = 1;
187 e->show5 = render_value_fp_from_float(e->animation, fade_lut, perm);
188
189 e->pixel.red = e->show4;
190 e->pixel.green = e->show3;
191 e->pixel.blue = e->show5;
192
193 e->pixel = e->rgb_sanity_check(e->pixel);
194
195 e->setPixelColorInternal(x, y, e->pixel);
196 }
197 }
198}
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: