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

Method getf

src/fl/math/wave/wave_simulation.cpp.hpp:74–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72float WaveSimulation2D::getSpeed() const { return mSim->getSpeed(); }
73
74float WaveSimulation2D::getf(fl::size x, fl::size y) const {
75 if (!has(x, y))
76 return 0.0f;
77 float sum = 0.0f;
78 for (u32 j = 0; j < mMultiplier; ++j) {
79 for (u32 i = 0; i < mMultiplier; ++i) {
80 sum += mSim->getf(x * mMultiplier + i, y * mMultiplier + j);
81 }
82 }
83 return sum / static_cast<float>(mMultiplier * mMultiplier);
84}
85
86i16 WaveSimulation2D::geti16(fl::size x, fl::size y) const {
87 if (!has(x, y))

Callers 1

addfMethod · 0.45

Calls 2

hasFunction · 0.85
maxFunction · 0.85

Tested by

no test coverage detected