[vlc-devel] commit: zvbi: Fix transparent background when background != black ( Derk-Jan Hartman )
git version control
git at videolan.org
Fri Sep 12 02:49:10 CEST 2008
vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Fri Sep 12 01:56:50 2008 +0200| [a112656431a233a3bf58591cd32a7bb589418206] | committer: Derk-Jan Hartman
zvbi: Fix transparent background when background != black
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a112656431a233a3bf58591cd32a7bb589418206
---
modules/codec/zvbi.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index b271fc0..fecac21 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -571,26 +571,27 @@ static int OpaquePage( picture_t *p_src, const vbi_page p_page,
for( x = 0; x < fmt.i_width; x++ )
{
const vbi_opacity opacity = p_page.text[ y/10 * p_page.columns + x/12 ].opacity;
+ const int background = p_page.text[ y/10 * p_page.columns + x/12 ].background;
uint32_t *p_pixel = (uint32_t*)&p_src->p->p_pixels[y * p_src->p->i_pitch + 4*x];
+
switch( opacity )
{
/* Show video instead of this character */
case VBI_TRANSPARENT_SPACE:
*p_pixel = 0;
break;
+ /* Display foreground and background color */
/* To make the boxed text "closed captioning" transparent
* change true to false.
*/
case VBI_OPAQUE:
+ /* alpha blend video into background color */
+ case VBI_SEMI_TRANSPARENT:
if( b_opaque )
break;
/* Full text transparency. only foreground color is show */
case VBI_TRANSPARENT_FULL:
- *p_pixel = 0;
- break;
- /* Transparency for boxed text */
- case VBI_SEMI_TRANSPARENT:
- if( (*p_pixel) == 0xff000000 && 0 ) /* Disabled until someone implement borders */
+ if( (*p_pixel) == (0xff000000 | p_page.color_map[background] ) )
*p_pixel = 0;
break;
}
More information about the vlc-devel
mailing list