Commit a1126564 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

zvbi: Fix transparent background when background != black

parent 2f6a7117
...@@ -571,26 +571,27 @@ static int OpaquePage( picture_t *p_src, const vbi_page p_page, ...@@ -571,26 +571,27 @@ static int OpaquePage( picture_t *p_src, const vbi_page p_page,
for( x = 0; x < fmt.i_width; x++ ) for( x = 0; x < fmt.i_width; x++ )
{ {
const vbi_opacity opacity = p_page.text[ y/10 * p_page.columns + x/12 ].opacity; 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]; uint32_t *p_pixel = (uint32_t*)&p_src->p->p_pixels[y * p_src->p->i_pitch + 4*x];
switch( opacity ) switch( opacity )
{ {
/* Show video instead of this character */ /* Show video instead of this character */
case VBI_TRANSPARENT_SPACE: case VBI_TRANSPARENT_SPACE:
*p_pixel = 0; *p_pixel = 0;
break; break;
/* Display foreground and background color */
/* To make the boxed text "closed captioning" transparent /* To make the boxed text "closed captioning" transparent
* change true to false. * change true to false.
*/ */
case VBI_OPAQUE: case VBI_OPAQUE:
/* alpha blend video into background color */
case VBI_SEMI_TRANSPARENT:
if( b_opaque ) if( b_opaque )
break; break;
/* Full text transparency. only foreground color is show */ /* Full text transparency. only foreground color is show */
case VBI_TRANSPARENT_FULL: case VBI_TRANSPARENT_FULL:
*p_pixel = 0; if( (*p_pixel) == (0xff000000 | p_page.color_map[background] ) )
break;
/* Transparency for boxed text */
case VBI_SEMI_TRANSPARENT:
if( (*p_pixel) == 0xff000000 && 0 ) /* Disabled until someone implement borders */
*p_pixel = 0; *p_pixel = 0;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment