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

◆ mapf()

s16x16 fl::PerlinParticlePunch::mapf ( s16x16 x,
s16x16 in_min,
s16x16 in_max,
s16x16 out_min,
s16x16 out_max )
staticprivate

Definition at line 224 of file perlin_particle_punch.cpp.hpp.

225 {
226 // Divide first to avoid s16x16 overflow on large intermediate products.
227 // e.g. (223 * 255) exceeds s16x16 max (~32767), but 223/223 * 255 = 255 fits.
228 return (x - in_min) / (in_max - in_min) * (out_max - out_min) + out_min;
229}

References fl::x.

Referenced by noiseCircleDraw().

+ Here is the caller graph for this function: