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

◆ easeInSine8()

u8 fl::easeInSine8 ( u8 i)

8-bit sine ease-in function Takes an input value 0-255 and returns an eased value 0-255 Smooth sinusoidal acceleration

Definition at line 142 of file ease.cpp.hpp.

142 {
143
144 static const u8 easeInSineTable[256] FL_PROGMEM = {
145 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
146 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4,
147 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8,
148 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14,
149 15, 16, 16, 17, 17, 18, 18, 19, 20, 20, 21, 21, 22, 23,
150 23, 24, 25, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33,
151 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 42, 43, 44,
152 45, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57,
153 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72,
154 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88,
155 89, 90, 91, 93, 94, 95, 96, 98, 99, 100, 101, 103, 104, 105,
156 106, 108, 109, 110, 112, 113, 114, 115, 117, 118, 119, 121, 122, 123,
157 125, 126, 127, 129, 130, 132, 133, 134, 136, 137, 139, 140, 141, 143,
158 144, 146, 147, 148, 150, 151, 153, 154, 156, 157, 159, 160, 161, 163,
159 164, 166, 167, 169, 170, 172, 173, 175, 176, 178, 179, 181, 182, 184,
160 185, 187, 188, 190, 191, 193, 194, 196, 197, 199, 200, 202, 204, 205,
161 207, 208, 210, 211, 213, 214, 216, 217, 219, 221, 222, 224, 225, 227,
162 228, 230, 231, 233, 235, 236, 238, 239, 241, 242, 244, 246, 247, 249,
163 250, 252, 253, 255};
164
165 // ease-in sine: 1 - cos(t * π/2)
166 // Handle boundary conditions explicitly
167 return FL_PGM_READ_BYTE_NEAR(&easeInSineTable[i]);
168}
#define FL_PGM_READ_BYTE_NEAR(x)
Read a byte (8-bit) from PROGMEM memory.
#define FL_PROGMEM
PROGMEM keyword for storage.
unsigned char u8
Definition stdint.h:131

References FL_PGM_READ_BYTE_NEAR, and FL_PROGMEM.

Referenced by ease8(), and ease8().

+ Here is the caller graph for this function: