FastLED 3.9.15
Loading...
Searching...
No Matches

◆ NewWaveSimulation2D()

WaveEffect NewWaveSimulation2D ( const XYMap xymap)

Definition at line 42 of file wave.cpp.

42 {
43 // only apply complex xymap as the last step after compositiing.
44 XYMap xy_rect =
45 XYMap::constructRectangularGrid(xymap.getWidth(), xymap.getHeight());
46 Blend2dPtr fxBlend =
47 NewPtr<Blend2d>(xymap); // Final transformation goes to the blend stack.
48 int width = xymap.getWidth();
49 int height = xymap.getHeight();
50 XYMap xyRect(width, height, false);
51 WaveFx::Args args_lower = CreateArgsLower();
52 WaveFx::Args args_upper = CreateArgsUpper();
53 WaveFxPtr wave_fx_low = NewPtr<WaveFx>(xy_rect, args_lower);
54 WaveFxPtr wave_fx_high = NewPtr<WaveFx>(xy_rect, args_upper);
55 Blend2dPtr blend_stack = NewPtr<Blend2d>(xymap);
56 blend_stack->add(wave_fx_low);
57 blend_stack->add(wave_fx_high);
58 WaveEffect out = {
59 .wave_fx_low = wave_fx_low,
60 .wave_fx_high = wave_fx_high,
61 .blend_stack = blend_stack,
62 };
63
64 return out;
65}
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
Blend2d fxBlend(xyMap)
XYMap xyRect(WIDTH, HEIGHT, false)
static XYMap constructRectangularGrid(uint16_t width, uint16_t height, uint16_t offset=0)
Definition xymap.cpp:36
WaveFxArgs Args
Definition wave.h:79
WaveFx::Args CreateArgsLower()
Definition wave.cpp:20
WaveFx::Args CreateArgsUpper()
Definition wave.cpp:31
Ptr< T > NewPtr(Args... args)
Definition ptr.h:451

References XYMap::constructRectangularGrid(), CreateArgsLower(), CreateArgsUpper(), fxBlend, fl::NewPtr(), xymap, and xyRect.

Referenced by setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: