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

Function easeOutCubic8

src/fl/math/ease.cpp.hpp:129–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129u8 easeOutCubic8(u8 i) {
130 // ease-out cubic: 1 - (1-t)³
131 // For 8-bit: y = MAX - (MAX-i)³ / MAX²
132 constexpr u16 MAX = 0xFF;
133 constexpr u32 DENOM = (u32)MAX * MAX;
134 constexpr u32 ROUND = DENOM >> 1;
135
136 u32 d = MAX - i; // (MAX - i)
137 u32 cube = d * d * d; // (MAX-i)³
138 u32 num = cube + ROUND;
139 return u8(MAX - (num / DENOM));
140}
141
142u8 easeInSine8(u8 i) {
143

Callers 1

ease8Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected