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

Method update8

src/fl/math/time_alpha.cpp.hpp:118–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118u8 TimeRamp::update8(u32 now) FL_NOEXCEPT {
119 if (!isActive(now)) {
120 return 0;
121 }
122 // u32 elapsed = now - mStart;
123 u8 out = 0;
124 if (now < mFinishedRisingTime) {
125 out = time_alpha8(now, mStart, mFinishedRisingTime);
126 } else if (now < mFinishedPlateauTime) {
127 // plateau
128 out = 255;
129 } else if (now < mFinishedFallingTime) {
130 // ramp down
131 u8 alpha =
132 time_alpha8(now, mFinishedPlateauTime, mFinishedFallingTime);
133 out = 255 - alpha;
134 } else {
135 // finished
136 out = 0;
137 }
138
139 mLastValue = out;
140 return out;
141}
142
143} // namespace fl

Callers 3

transitionMethod · 0.80
time_alpha.hppFile · 0.80
applyFancyEffectFunction · 0.80

Calls 1

time_alpha8Function · 0.85

Tested by

no test coverage detected