112 {
113
115 const uint32_t now = millis();
116 uint32_t now_warped =
time_warp.update(now);
117
119 shape->setScale(
scale.value());
120
122 static float s_prev_alpha = 0.0f;
123
124
126
130 FASTLED_WARN(
"Transition triggered on " << shape->name());
132 s_prev_alpha = curr_alpha;
133 }
134
135
136
137
138 const bool is_active =
139 true || curr_alpha <
maxAnimation.value() && curr_alpha > 0.0f;
140
141
142 static uint32_t frame = 0;
143 frame++;
145 const CRGB purple =
CRGB(255, 0, 255);
148
149
150
151 float diff = curr_alpha - s_prev_alpha;
152 diff *= 1.0f;
153 float factor =
MAX(s_prev_alpha - diff, 0.f);
154
155 for (int i = 0; i < number_of_steps; ++i) {
156 float a =
158 if (a < .04) {
159
161 }
162 float diff_max_alpha =
maxAnimation.value() - curr_alpha;
163 if (diff_max_alpha < 0.94) {
164
167 }
168 uint8_t alpha =
170 if (!is_active) {
171 alpha = 0;
172 }
174 subpixel.
scale(alpha);
175
176 raster.rasterize(subpixel);
177 }
178
179 s_prev_alpha = curr_alpha;
180
181
185 } else {
187 }
188
189 int first =
xyMap(1, 1);
191
195
197 }
198
200 uint32_t frame_time = millis() - now;
202 }
203
205}
TimeClampedTransition shapeProgress(TIME_ANIMATION)
XYMap xyMap(WIDTH, HEIGHT, false)
UICheckbox useWaveFx("Use WaveFX", true)
UISlider numberOfSteps("Number of Steps", 32.0f, 1.0f, 100.0f, 1.0f)
UISlider scale("Scale", 1.0f, 0.0f, 1.0f, 0.01f)
XYRaster raster(WIDTH, HEIGHT)
UISlider whichShape("Which Shape", 0.0f, 0.0f, shapes.size() - 1, 1.0f)
UISlider maxAnimation("Max Animation", 1.0f, 5.0f, 20.0f, 1.f)
UIButton trigger("Trigger")
CFastLED FastLED
Global LED strip management instance.
void scale(uint8_t scale)
XYPathPtr getShape(int which)
float getAnimationTime(uint32_t now)
#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)