summaryrefslogtreecommitdiff
path: root/src/video_out/alphablend.c
diff options
context:
space:
mode:
authorRobin KAY <komadori@users.sourceforge.net>2003-09-21 02:53:19 +0000
committerRobin KAY <komadori@users.sourceforge.net>2003-09-21 02:53:19 +0000
commite7ef01e8a5c5af6efdab4c255b26b6b6666013d4 (patch)
tree093c564543576f5424feb85907ee8d2de5bbe5c6 /src/video_out/alphablend.c
parent890bd7b2fa8f376aa0c832add0d7297b74f639b5 (diff)
downloadxine-lib-e7ef01e8a5c5af6efdab4c255b26b6b6666013d4.tar.gz
xine-lib-e7ef01e8a5c5af6efdab4c255b26b6b6666013d4.tar.bz2
Add support for chroma keyed overlay graphics to video_out_pgx64 and fix various bugs. Fix incorrect colours when blending frame with a big-endian RGB pixel format.
CVS patchset: 5406 CVS date: 2003/09/21 02:53:19
Diffstat (limited to 'src/video_out/alphablend.c')
-rw-r--r--src/video_out/alphablend.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c
index 3eb98adc8..bb10412a7 100644
--- a/src/video_out/alphablend.c
+++ b/src/video_out/alphablend.c
@@ -1,7 +1,3 @@
-/*TOAST_SPU will define ALL spu entries - no matter the tranparency*/
-/*#define TOAST_SPU*/
-/* #define PRIV_CLUT */
-/* Currently only blend_yuv(..) works */
/*
*
* Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
@@ -71,19 +67,6 @@ static void mem_blend24(uint8_t *mem, uint8_t r, uint8_t g, uint8_t b,
}
}
-static void mem_blend24_32(uint8_t *mem, uint8_t r, uint8_t g, uint8_t b,
- uint8_t o, int len) {
- uint8_t *limit = mem + len*4;
- while (mem < limit) {
- *mem = BLEND_BYTE(*mem, r, o);
- mem++;
- *mem = BLEND_BYTE(*mem, g, o);
- mem++;
- *mem = BLEND_BYTE(*mem, b, o);
- mem += 2;
- }
-}
-
static void mem_blend32(uint8_t *mem, uint8_t *src, uint8_t o, int len) {
uint8_t *limit = mem + len*4;
while (mem < limit) {
@@ -98,7 +81,6 @@ static void mem_blend32(uint8_t *mem, uint8_t *src, uint8_t o, int len) {
}
}
-
/*
* Some macros for fixed point arithmetic.
*
@@ -687,9 +669,7 @@ void blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl,
} else if( clip_right < x + rlelen ) {
if( clip_right > x ) {
x2_scaled = SCALED_TO_INT( clip_right * x_scale);
- mem_blend24_32(img_pix + x1_scaled*4, clut[clr].cb,
- clut[clr].cr, clut[clr].y,
- o, x2_scaled-x1_scaled);
+ mem_blend32(img_pix + x1_scaled*4, (uint8_t *)&clut[clr], o, x2_scaled-x1_scaled);
o = 0;
} else {
o = 0;
@@ -699,9 +679,7 @@ void blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl,
x2_scaled = SCALED_TO_INT((x + rlelen) * x_scale);
if (o && mask) {
- mem_blend24_32(img_pix + x1_scaled*4, clut[clr].cb,
- clut[clr].cr, clut[clr].y,
- o, x2_scaled-x1_scaled);
+ mem_blend32(img_pix + x1_scaled*4, (uint8_t *)&clut[clr], o, x2_scaled-x1_scaled);
}
x1_scaled = x2_scaled;