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

◆ ease8InOutCubic()

LIB8STATIC fract8 ease8InOutCubic ( fract8 i)

8-bit cubic ease-in / ease-out function.

Takes around 18 cycles on AVR.

Definition at line 574 of file lib8tion.h.

575{
576 fl::u8 ii = scale8_LEAVING_R1_DIRTY( i, i);
577 fl::u8 iii = scale8_LEAVING_R1_DIRTY( ii, i);
578
579 fl::u16 r1 = (3 * (fl::u16)(ii)) - ( 2 * (fl::u16)(iii));
580
581 /* the code generated for the above *'s automatically
582 cleans up R1, so there's no need to explicitily call
583 cleanup_R1(); */
584
585 fl::u8 result = r1;
586
587 // if we got "256", return 255:
588 if( r1 & 0x100 ) {
589 result = 255;
590 }
591 return result;
592}
unsigned char u8
Definition stdint.h:131
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References LIB8STATIC.

Referenced by cubicwave8().

+ Here is the caller graph for this function: