8-bit quadratic ease-in / ease-out function.
Takes around 13 cycles on AVR.
Definition at line 580 of file lib8tion.h.
581{
582 uint8_t j = i;
583 if( j & 0x80 ) {
584 j = 255 - j;
585 }
586 uint8_t jj =
scale8( j, j);
587 uint8_t jj2 = jj << 1;
588 if( i & 0x80 ) {
589 jj2 = 255 - jj2;
590 }
591 return jj2;
592}
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
References LIB8STATIC, and scale8().
Referenced by quadwave8().