summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/alphablend.c
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/alphablend.c') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/alphablend.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/alphablend.c b/noncore/multimedia/opieplayer2/alphablend.c
index 57f6013..cdd7b28 100644
--- a/noncore/multimedia/opieplayer2/alphablend.c
+++ b/noncore/multimedia/opieplayer2/alphablend.c
@@ -16,48 +16,50 @@
16 * This program is distributed in the hope that it will be useful, 16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details. 19 * GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 * 24 *
25 * The author may be reached as <dent@linuxvideo.org> 25 * The author may be reached as <dent@linuxvideo.org>
26 * 26 *
27 *------------------------------------------------------------ 27 *------------------------------------------------------------
28 * 28 *
29 */ 29 */
30 30
31/* 31/*
32#define LOG_BLEND_YUV 32#define LOG_BLEND_YUV
33*/ 33*/
34 34
35#include <string.h> 35#include <string.h>
36#include <stdlib.h> 36#include <stdlib.h>
37#include <stdio.h> 37#include <stdio.h>
38#include <inttypes.h> 38#include <inttypes.h>
39 39
40#include <xine.h>
41#include <xine/xine_internal.h>
40#include <xine/video_out.h> 42#include <xine/video_out.h>
41#include "alphablend.h" 43#include "alphablend.h"
42 44
43 45
44#define BLEND_COLOR(dst, src, mask, o) ((((src&mask)*o + ((dst&mask)*(0x0f-o)))/0xf) & mask) 46#define BLEND_COLOR(dst, src, mask, o) ((((src&mask)*o + ((dst&mask)*(0x0f-o)))/0xf) & mask)
45 47
46#define BLEND_BYTE(dst, src, o) (((src)*o + ((dst)*(0xf-o)))/0xf) 48#define BLEND_BYTE(dst, src, o) (((src)*o + ((dst)*(0xf-o)))/0xf)
47 49
48static void mem_blend16(uint16_t *mem, uint16_t clr, uint8_t o, int len) { 50static void mem_blend16(uint16_t *mem, uint16_t clr, uint8_t o, int len) {
49 uint16_t *limit = mem + len; 51 uint16_t *limit = mem + len;
50 while (mem < limit) { 52 while (mem < limit) {
51 *mem = 53 *mem =
52 BLEND_COLOR(*mem, clr, 0xf800, o) | 54 BLEND_COLOR(*mem, clr, 0xf800, o) |
53 BLEND_COLOR(*mem, clr, 0x07e0, o) | 55 BLEND_COLOR(*mem, clr, 0x07e0, o) |
54 BLEND_COLOR(*mem, clr, 0x001f, o); 56 BLEND_COLOR(*mem, clr, 0x001f, o);
55 mem++; 57 mem++;
56 } 58 }
57} 59}
58 60
59static void mem_blend24(uint8_t *mem, uint8_t r, uint8_t g, uint8_t b, 61static void mem_blend24(uint8_t *mem, uint8_t r, uint8_t g, uint8_t b,
60 uint8_t o, int len) { 62 uint8_t o, int len) {
61 uint8_t *limit = mem + len*3; 63 uint8_t *limit = mem + len*3;
62 while (mem < limit) { 64 while (mem < limit) {
63 *mem = BLEND_BYTE(*mem, r, o); 65 *mem = BLEND_BYTE(*mem, r, o);