122 {
123
125 const uint32_t now = millis();
126 uint32_t now_warped =
time_warp.update(now);
127
129 shape->setScale(
scale.value());
130
132 static float s_prev_alpha = 0.0f;
133
134
136
140 FASTLED_WARN(
"Transition triggered on " << shape->name());
142 s_prev_alpha = curr_alpha;
143 }
144
145 const bool is_active =
146 true || curr_alpha <
maxAnimation.value() && curr_alpha > 0.0f;
147
148 static uint32_t frame = 0;
149 frame++;
151 const CRGB purple =
CRGB(255, 0, 255);
154
155 float diff = curr_alpha - s_prev_alpha;
156 diff *= 1.0f;
157 float factor =
MAX(s_prev_alpha - diff, 0.f);
158
159 for (int i = 0; i < number_of_steps; ++i) {
160 float a =
162 if (a < .04) {
163
165 }
166 float diff_max_alpha =
maxAnimation.value() - curr_alpha;
167 if (diff_max_alpha < 0.94) {
168
171 }
172 uint8_t alpha =
174 if (!is_active) {
175 alpha = 0;
176 }
178 subpixel.
scale(alpha);
179
180 raster.rasterize(subpixel);
181 }
182
183 s_prev_alpha = curr_alpha;
184
185
189 } else {
191 }
192
193 int first =
xyMap(1, 1);
195
199
201 }
202
203
204
205
207
208
211 for (int i = 0; i < 10; ++i) {
214 }
215
217}
TimeClampedTransition shapeProgress(TIME_ANIMATION)
XYPathPtr getShape(int which)
XYMap xyMap_Dst(WIDTH/2, HEIGHT/2, false)
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)
float getAnimationTime(uint32_t now)
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")
CRGB leds_downscaled[NUM_LEDS/4]
CFastLED FastLED
Global LED strip management instance.
void push_back(const T &value)
void scale(uint8_t scale)
InlinedVector< T, INLINED_SIZE > vector_inlined
void downscaleHalf(const CRGB *src, uint16_t srcWidth, uint16_t srcHeight, CRGB *dst)
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)