Commit bb9834b5 authored by Francois Cartegnie's avatar Francois Cartegnie

text_style: fix alpha values

parent a222da2d
......@@ -50,36 +50,29 @@ typedef struct
int i_font_size; /**< The font size in pixels */
int i_font_color; /**< The color of the text 0xRRGGBB
(native endianness) */
uint8_t i_font_alpha; /**< The transparency of the text.
0x00 is fully opaque,
0xFF fully transparent */
uint8_t i_font_alpha; /**< The transparency of the text.*/
int i_spacing; /**< The spaceing between glyphs in pixels */
/* Outline */
int i_outline_color; /**< The color of the outline 0xRRGGBB */
uint8_t i_outline_alpha; /**< The transparency of the outline.
0x00 is fully opaque,
0xFF fully transparent */
uint8_t i_outline_alpha; /**< The transparency of the outline */
int i_outline_width; /**< The width of the outline in pixels */
/* Shadow */
int i_shadow_color; /**< The color of the shadow 0xRRGGBB */
uint8_t i_shadow_alpha; /**< The transparency of the shadow.
0x00 is fully opaque,
0xFF fully transparent */
uint8_t i_shadow_alpha; /**< The transparency of the shadow. */
int i_shadow_width; /**< The width of the shadow in pixels */
/* Background (and karaoke) */
int i_background_color;/**< The color of the background 0xRRGGBB */
uint8_t i_background_alpha;/**< The transparency of the background.
0x00 is fully opaque,
0xFF fully transparent */
uint8_t i_background_alpha;/**< The transparency of the background */
int i_karaoke_background_color;/**< Background color for karaoke 0xRRGGBB */
uint8_t i_karaoke_background_alpha;/**< The transparency of the karaoke bg.
0x00 is fully opaque,
0xFF fully transparent */
uint8_t i_karaoke_background_alpha;/**< The transparency of the karaoke bg */
} text_style_t;
#define STYLE_ALPHA_OPAQUE 0xFF
#define STYLE_ALPHA_TRANSPARENT 0x00
/* Features flags for \ref i_features */
#define STYLE_NO_DEFAULTS 0x0
#define STYLE_FULLY_SET 0xFFFF
......
......@@ -792,7 +792,7 @@ static inline int RenderAXYZ( filter_t *p_filter,
if (p_region->b_renderbg) {
/* Render the background just under the text */
FillPicture( p_picture, 0x00, 0x00, 0x00, 0x00 );
FillPicture( p_picture, STYLE_ALPHA_TRANSPARENT, 0x00, 0x00, 0x00 );
RenderBackground(p_region, p_line_head, p_bbox, i_margin, p_picture, i_text_width,
ExtractComponents, BlendPixel);
} else {
......
......@@ -853,7 +853,7 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
p_bitmaps->p_outline = 0;
}
if( p_filter->p_sys->p_style->i_shadow_alpha > 0 )
if( p_filter->p_sys->p_style->i_shadow_alpha != STYLE_ALPHA_TRANSPARENT )
p_bitmaps->p_shadow = p_bitmaps->p_outline ?
p_bitmaps->p_outline : p_bitmaps->p_glyph;
......
......@@ -51,15 +51,15 @@ text_style_t *text_style_Create( int i_defaults )
p_style->f_font_relsize = STYLE_DEFAULT_REL_FONT_SIZE;
p_style->i_font_size = STYLE_DEFAULT_FONT_SIZE;
p_style->i_font_color = 0xffffff;
p_style->i_font_alpha = 0xff;
p_style->i_font_alpha = STYLE_ALPHA_OPAQUE;
p_style->i_outline_color = 0x000000;
p_style->i_outline_alpha = 0xff;
p_style->i_outline_alpha = STYLE_ALPHA_OPAQUE;
p_style->i_shadow_color = 0x808080;
p_style->i_shadow_alpha = 0xff;
p_style->i_shadow_alpha = STYLE_ALPHA_OPAQUE;
p_style->i_background_color = 0x000000;
p_style->i_background_alpha = 0xff;
p_style->i_background_alpha = STYLE_ALPHA_OPAQUE;
p_style->i_karaoke_background_color = 0xffffff;
p_style->i_karaoke_background_alpha = 0xff;
p_style->i_karaoke_background_alpha = STYLE_ALPHA_OPAQUE;
p_style->i_outline_width = 1;
p_style->i_shadow_width = 0;
p_style->i_spacing = -1;
......
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