46 for( int32_t i = n; 0 < i; --i ) {
50 uint32_t OneMin_aMulA = 65535 - aMulA;
51 dstColor->
r = ( aMulA * srcColor->
r + OneMin_aMulA * dstColor->
r ) >> 16;
52 dstColor->
g = ( aMulA * srcColor->
g + OneMin_aMulA * dstColor->
g ) >> 16;
53 dstColor->
b = ( aMulA * srcColor->
b + OneMin_aMulA * dstColor->
b ) >> 16;
65 for( int32_t i = n; 0 < i; --i ) {
68 uint32_t OneMin_aMulA = 65535 - aMulA;
69 dstColor->
r = ( aMulA * srcColor->
r + OneMin_aMulA * dstColor->
r ) >> 16;
70 dstColor->
g = ( aMulA * srcColor->
g + OneMin_aMulA * dstColor->
g ) >> 16;
71 dstColor->
b = ( aMulA * srcColor->
b + OneMin_aMulA * dstColor->
b ) >> 16;
83 for( int32_t i = n; 0 < i; --i ) {
84 uint32_t aMulA = ( alpha * srcColor->
a ) >> 8;
88 *dstColor = ( ( ( srcColor->
b * aMulA ) +
89 ( ( ( c & 0xF800 ) >> 8 ) * OneMin_aMulA ) ) & 0xF800 ) |
90 ( ( ( ( srcColor->
g * aMulA ) +
91 ( ( ( c & 0x07E0 ) >> 3 ) * OneMin_aMulA ) ) >> 5 ) & 0x07E0 ) |
92 ( ( ( ( srcColor->
r * aMulA ) +
93 ( ( ( c & 0x001F ) << 3 ) * OneMin_aMulA ) ) >> 11 ) & 0x001F );
106 for( int32_t i = n; 0 < i; --i ) {
111 aMulA = ( alpha * aMulA ) / 15;
113 uint32_t OneMin_aMulA = 255 - aMulA;
115 result = ( ( ( ( c2 & 0xF000 ) | 0x0800 ) * aMulA ) + ( ( c1 & 0xF800 ) * OneMin_aMulA ) ) & 0xF80000;
116 result |= ( ( ( ( ( c2 & 0x0F00 ) >> 1 ) | 0x0040 ) * aMulA ) + ( ( c1 & 0x07E0 ) * OneMin_aMulA ) ) & 0x07E000;
117 result |= ( ( ( ( ( c2 & 0x00F0 ) >> 3 ) | 0x0001 ) * aMulA ) + ( ( c1 & 0x001F ) * OneMin_aMulA ) ) & 0x001F00;
119 *dstColor =
static_cast< uint16_t >( result >> 8 );
void SDL_BlendRow_RGBA8_to_RGB8(const uint8_t *src, uint8_t *dst, uint32_t alpha, int32_t n)
Blends one row of n pixels from src with n pixels of dst.
void SDL_BlendRow_RGBA8_to_RGBA8(const uint8_t *src, uint8_t *dst, uint32_t alpha, int32_t n)
Blends one row of n pixels from src with n pixels of dst.
void SDL_BlendRow_RGBA4_to_RGB565(const uint8_t *src, uint8_t *dst, uint32_t alpha, int32_t n)
Blends one row of n pixels from src with n pixels of dst.
void SDL_BlendRow_RGBA8_to_RGB565(const uint8_t *src, uint8_t *dst, uint32_t alpha, int32_t n)
Blends one row of n pixels from src with n pixels of dst.