2 #include "lv_alpha_blend.h"
5 #include "lv_alpha_blend_orc.h"
10 #if VISUAL_LITTLE_ENDIAN == 1
11 uint16_t b:5, g:6, r:5;
13 uint16_t r:5, g:6, b:5;
19 void visual_alpha_blend_8 (uint8_t *LV_RESTRICT dest,
const uint8_t *LV_RESTRICT src1,
const uint8_t *LV_RESTRICT src2, visual_size_t size, uint8_t alpha)
21 simd_interpolate_8 (dest, src1, src2, alpha, (
int) size);
24 void visual_alpha_blend_16 (uint8_t *LV_RESTRICT dest,
const uint8_t *LV_RESTRICT src1,
const uint8_t *LV_RESTRICT src2, visual_size_t size, uint8_t alpha)
26 rgb16_t *destr = (rgb16_t *) dest;
27 rgb16_t *src1r = (rgb16_t *) src1;
28 rgb16_t *src2r = (rgb16_t *) src2;
31 for (i = 0; i < size / 2; i++) {
32 destr[i].r = (alpha * (src2r[i].r - src1r[i].r)) / 255 + src1r[i].r;
33 destr[i].g = (alpha * (src2r[i].g - src1r[i].g)) / 255 + src1r[i].g;
34 destr[i].b = (alpha * (src2r[i].b - src1r[i].b)) / 255 + src1r[i].b;
38 void visual_alpha_blend_24 (uint8_t *LV_RESTRICT dest,
const uint8_t *LV_RESTRICT src1,
const uint8_t *LV_RESTRICT src2, visual_size_t size, uint8_t alpha)
40 simd_interpolate_8 (dest, src1, src2, alpha, (
int) size * 3);
43 void visual_alpha_blend_32 (uint8_t *LV_RESTRICT dest,
const uint8_t *LV_RESTRICT src1,
const uint8_t *LV_RESTRICT src2, visual_size_t size, uint8_t alpha)
45 simd_interpolate_8 (dest, src1, src2, alpha, (
int) size * 4);