132 {
133
135 const uint32_t now = millis();
136 uint32_t now_warped =
time_warp.update(now);
137
139 shape->setScale(
scale.value());
140
142 static float s_prev_alpha = 0.0f;
143
144
146
150 FASTLED_WARN(
"Transition triggered on " << shape->name());
152 s_prev_alpha = curr_alpha;
153 }
154
156 const CRGB purple =
CRGB(255, 0, 255);
159
160 float diff = curr_alpha - s_prev_alpha;
161 diff *= 1.0f;
162 float factor =
MAX(s_prev_alpha - diff, 0.f);
163
164 for (int i = 0; i < number_of_steps; ++i) {
165 float a =
166 fl::map_range<float>(i, 0, number_of_steps - 1, factor, curr_alpha);
167 if (a < .04) {
168
169 a = map_range<float>(a, 0.0f, .04f, 0.0f, .04f);
170 }
171 float diff_max_alpha =
maxAnimation.value() - curr_alpha;
172 if (diff_max_alpha < 0.94) {
173
174 a = map_range<float>(a, curr_alpha,
maxAnimation.value(),
176 }
177 uint8_t alpha =
178 fl::map_range<uint8_t>(i, 0.0f, number_of_steps - 1, 64, 255);
180 subpixel.
scale(alpha);
181
182 raster.rasterize(subpixel);
183 }
184
185 s_prev_alpha = curr_alpha;
186
190 } else {
192 }
193
194 int first =
xyMap(1, 1);
196
200
202 }
203
204
205
206
208
209
212 for (int i = 0; i < 10; ++i) {
215 }
216
218}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
void push_back(const T &value)
UISlider numberOfSteps("Number of Steps", 32.0f, 1.0f, 100.0f, 1.0f)
UIButton trigger("Trigger")
XYPathPtr getShape(int which)
UISlider maxAnimation("Max Animation", 1.0f, 5.0f, 20.0f, 1.f)
XYMap xyMap_Dst(WIDTH/2, HEIGHT/2, false)
float getAnimationTime(uint32_t now)
XYRaster raster(WIDTH, HEIGHT)
TimeClampedTransition shapeProgress(TIME_ANIMATION)
UICheckbox useWaveFx("Use WaveFX", true)
CRGB leds_downscaled[NUM_LEDS/4]
UISlider whichShape("Which Shape", 0.0f, 0.0f, shapes.size() - 1, 1.0f)
InlinedVector< T, INLINED_SIZE > vector_inlined
void downscaleHalf(const CRGB *src, fl::u16 srcWidth, fl::u16 srcHeight, CRGB *dst)
Representation of an RGB pixel (Red, Green, Blue)