117 {
118
120 const uint32_t now = millis();
121 uint32_t now_warped =
time_warp.update(now);
122
124 shape->setScale(
scale.value());
125
127 static float s_prev_alpha = 0.0f;
128
129
131
135 FASTLED_WARN(
"Transition triggered on " << shape->name());
137 s_prev_alpha = curr_alpha;
138 }
139
140
141
142
143 const bool is_active =
144 true || curr_alpha <
maxAnimation.value() && curr_alpha > 0.0f;
145
146
147 static uint32_t frame = 0;
148 frame++;
150 const CRGB purple =
CRGB(255, 0, 255);
153
154
155
156 float diff = curr_alpha - s_prev_alpha;
157 diff *= 1.0f;
158 float factor =
MAX(s_prev_alpha - diff, 0.f);
159
160 for (int i = 0; i < number_of_steps; ++i) {
161 float a =
163 if (a < .04) {
164
166 }
167 float diff_max_alpha =
maxAnimation.value() - curr_alpha;
168 if (diff_max_alpha < 0.94) {
169
172 }
173 uint8_t alpha =
175 if (!is_active) {
176 alpha = 0;
177 }
179 subpixel.
scale(alpha);
180
181 raster.rasterize(subpixel);
182 }
183
184 s_prev_alpha = curr_alpha;
185
186
190 } else {
192 }
193
194 int first =
xyMap(1, 1);
196
200
202 }
203
205 uint32_t frame_time = millis() - now;
207 }
208
210}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
void scale(uint8_t scale)
XYPathPtr getShape(int which)
float getAnimationTime(uint32_t now)
UISlider numberOfSteps("Number of Steps", 32.0f, 1.0f, 100.0f, 1.0f)
UIButton trigger("Trigger")
UISlider maxAnimation("Max Animation", 1.0f, 5.0f, 20.0f, 1.f)
XYRaster raster(WIDTH, HEIGHT)
TimeClampedTransition shapeProgress(TIME_ANIMATION)
UICheckbox useWaveFx("Use WaveFX", true)
UISlider whichShape("Which Shape", 0.0f, 0.0f, shapes.size() - 1, 1.0f)
#define EVERY_N_SECONDS(N)
Checks whether to execute a block of code every N seconds.
FASTLED_FORCE_INLINE U map_range(T value, T in_min, T in_max, U out_min, U out_max)
Representation of an RGB pixel (Red, Green, Blue)