Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
0379cfac
Commit
0379cfac
authored
Jun 16, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added background color/opacity options to freetype.
parent
c8c5f20e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
modules/misc/text_renderer/freetype.c
modules/misc/text_renderer/freetype.c
+21
-3
No files found.
modules/misc/text_renderer/freetype.c
View file @
0379cfac
...
...
@@ -119,6 +119,9 @@ static void Destroy( vlc_object_t * );
"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"
)
};
...
...
@@ -163,6 +166,14 @@ vlc_module_begin ()
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
)
...
...
@@ -225,6 +236,9 @@ struct filter_sys_t
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
;
...
...
@@ -808,10 +822,9 @@ static int RenderYUVA( filter_t *p_filter,
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
);
...
...
@@ -2205,6 +2218,11 @@ static int Create( vlc_object_t *p_this )
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
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment