131 {
132
133 uint8_t xx =
x & 0xff, yy =
y & 0xff, ix = 255 - xx, iy = 255 - yy;
134
135 #define WU_WEIGHT(a, b) ((uint8_t)(((a) * (b) + (a) + (b)) >> 8))
138 };
139 #undef WU_WEIGHT
140
141 for (uint8_t i = 0; i < 4; i++) {
142 uint8_t local_x = (
x >> 8) + (i & 1);
143 uint8_t local_y = (
y >> 8) + ((i >> 1) & 1);
146 uint16_t this_bright = bright * wu[i];
147 buf[
xy] =
qadd8(buf[
xy], this_bright >> 8);
148 }
149}
unsigned int xy(unsigned int x, unsigned int y)
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.