MCPcopy Create free account
hub / github.com/FastLED/FastLED / addf

Method addf

src/fl/fx/2d/wave.h:307–311  ·  view source on GitHub ↗

@brief Add wave amplitude to existing value at a position @param x X coordinate in grid space @param y Y coordinate in grid space @param value Wave amplitude to add (clamped to max 1.0) Adds to existing wave amplitude, useful for creating multiple overlapping disturbances. Result is clamped to maximum of 1.0.

Source from the content-addressed store, hash-verified

305 /// Adds to existing wave amplitude, useful for creating multiple
306 /// overlapping disturbances. Result is clamped to maximum of 1.0.
307 void addf(size_t x, size_t y, float value) {
308 // Add a value at the given coordinates in the wave simulation.
309 float sum = value + mWaveSim.getf(x, y);
310 mWaveSim.setf(x, y, fl::min(1.0f, sum));
311 }
312
313 /// @brief Get wave amplitude as 8-bit value
314 /// @param x X coordinate in grid space

Callers

nothing calls this directly

Calls 2

getfMethod · 0.45
setfMethod · 0.45

Tested by

no test coverage detected