"fonts that will be rendered on the video. If absolute font size is set, "\
"relative size will be overridden." )
+#define BG_OPACITY_TEXT N_("Background opacity")
+#define BG_COLOR_TEXT N_("Background color")
+
static const int pi_sizes[] = { 20, 18, 16, 12, 6 };
static const char *const ppsz_sizes_text[] = {
N_("Smaller"), N_("Small"), N_("Normal"), N_("Large"), N_("Larger") };
change_integer_list( pi_color_values, ppsz_color_descriptions )
change_safe()
+ add_integer_with_range( "freetype-background-opacity", 0, 0, 255,
+ BG_OPACITY_TEXT, "", false )
+ change_safe()
+ add_integer( "freetype-background-color", 0x00000000, BG_COLOR_TEXT,
+ "", false )
+ change_integer_list( pi_color_values, ppsz_color_descriptions )
+ change_safe()
+
add_integer( "freetype-rel-fontsize", 16, FONTSIZER_TEXT,
FONTSIZER_LONGTEXT, false )
change_integer_list( pi_sizes, ppsz_sizes_text )
int i_font_color;
int i_font_size;
+ uint8_t i_background_opacity;
+ int i_background_color;
+
int i_default_font_size;
int i_display_height;
char* psz_fontfamily;
p_region->fmt = fmt;
/* Initialize the picture background */
- uint32_t i_background = 0 ? 0x80000000 : 0xff000000;
- uint8_t i_a = 0xff - ((i_background >> 24) & 0xff);
+ uint8_t i_a = p_sys->i_background_opacity;
uint8_t i_y, i_u, i_v;
- YUVFromRGB( i_background, &i_y, &i_u, &i_v );
+ YUVFromRGB( p_sys->i_background_color, &i_y, &i_u, &i_v );
memset( p_picture->p[0].p_pixels, i_y,
p_picture->p[0].i_pitch * p_picture->p[0].i_lines );
p_sys->i_font_color = var_InheritInteger( p_filter, "freetype-color" );
p_sys->i_font_color = __MAX( __MIN( p_sys->i_font_color , 0xFFFFFF ), 0 );
+ p_sys->i_background_opacity = var_InheritInteger( p_filter,"freetype-background-opacity" );;
+ p_sys->i_background_opacity = __MAX( __MIN( p_sys->i_background_opacity, 255 ), 0 );
+ p_sys->i_background_color = var_InheritInteger( p_filter, "freetype-background-color" );
+ p_sys->i_background_color = __MAX( __MIN( p_sys->i_background_color, 0xFFFFFF ), 0 );
+
#ifdef WIN32
/* Get Windows Font folder */
wchar_t wdir[MAX_PATH];