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

◆ LuminanceDecay()

float anonymous_namespace{Painter.cpp}::LuminanceDecay ( float time)

Definition at line 16 of file Painter.cpp.

16 {
17 typedef InterpData<float, float> Datum;
18 static const Datum kData[] = {
19 Datum(0, 0),
20 Datum(1, 0),
21 Datum(10, 0),
22 Datum(47, 60),
23 Datum(120, 100),
24 Datum(230, 160),
25 Datum(250, 255),
26 Datum(254, 255),
27 Datum(255, 64),
28 };
29
30 const float key = time * 255.f;
31 static const int n = sizeof(kData) / sizeof(kData[0]);
32 float approx_val = Interp(key, kData, n);
33
34
35 static const float k = (1.0f / 255.f);
36 const float out = approx_val * k;
37 return out;
38}
ValT Interp(const KeyT &k, const InterpData< KeyT, ValT > *array, const int n)

References Interp().

Referenced by CalcLuminance().

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