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
353812ff
Commit
353812ff
authored
Aug 24, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype: change background rendering
background style was never applied when set to non text mode.
parent
9f43ceac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
16 deletions
+32
-16
modules/codec/cc.c
modules/codec/cc.c
+3
-1
modules/codec/zvbi.c
modules/codec/zvbi.c
+11
-1
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+18
-14
No files found.
modules/codec/cc.c
View file @
353812ff
...
@@ -424,10 +424,12 @@ static subpicture_t *Subtitle( decoder_t *p_dec, text_segment_t *p_segments, mti
...
@@ -424,10 +424,12 @@ static subpicture_t *Subtitle( decoder_t *p_dec, text_segment_t *p_segments, mti
region itself gets aligned, but the text inside it does not */
region itself gets aligned, but the text inside it does not */
p_spu_sys
->
align
=
SUBPICTURE_ALIGN_LEAVETEXT
;
p_spu_sys
->
align
=
SUBPICTURE_ALIGN_LEAVETEXT
;
p_spu_sys
->
p_segments
=
p_segments
;
p_spu_sys
->
p_segments
=
p_segments
;
p_spu_sys
->
noregionbg
=
p_dec
->
p_sys
->
b_opaq
ue
;
p_spu_sys
->
noregionbg
=
tr
ue
;
p_spu_sys
->
gridmode
=
true
;
p_spu_sys
->
gridmode
=
true
;
/* Set style defaults (will be added to segments if none set) */
/* Set style defaults (will be added to segments if none set) */
p_spu_sys
->
p_default_style
->
i_style_flags
|=
STYLE_MONOSPACED
;
p_spu_sys
->
p_default_style
->
i_style_flags
|=
STYLE_MONOSPACED
;
if
(
p_dec
->
p_sys
->
b_opaque
)
p_spu_sys
->
p_default_style
->
i_style_flags
|=
STYLE_BACKGROUND
;
p_spu_sys
->
p_default_style
->
i_font_color
=
rgi_eia608_colors
[
EIA608_COLOR_DEFAULT
];
p_spu_sys
->
p_default_style
->
i_font_color
=
rgi_eia608_colors
[
EIA608_COLOR_DEFAULT
];
p_spu_sys
->
p_default_style
->
f_font_relsize
=
100
/
EIA608_SCREEN_ROWS
*
3
/
4
;
p_spu_sys
->
p_default_style
->
f_font_relsize
=
100
/
EIA608_SCREEN_ROWS
*
3
/
4
;
p_spu_sys
->
p_default_style
->
i_features
|=
(
STYLE_HAS_FONT_COLOR
|
STYLE_HAS_FLAGS
);
p_spu_sys
->
p_default_style
->
i_features
|=
(
STYLE_HAS_FONT_COLOR
|
STYLE_HAS_FLAGS
);
...
...
modules/codec/zvbi.c
View file @
353812ff
...
@@ -442,9 +442,19 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
...
@@ -442,9 +442,19 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
subpicture_updater_sys_t
*
p_spu_sys
=
p_spu
->
updater
.
p_sys
;
subpicture_updater_sys_t
*
p_spu_sys
=
p_spu
->
updater
.
p_sys
;
p_spu_sys
->
p_segments
=
text_segment_New
(
&
p_text
[
offset
]
);
p_spu_sys
->
p_segments
=
text_segment_New
(
&
p_text
[
offset
]
);
if
(
p_spu_sys
->
p_segments
&&
b_opaque
)
{
p_spu_sys
->
p_segments
->
style
=
text_style_Create
(
STYLE_NO_DEFAULTS
);
if
(
p_spu_sys
->
p_segments
->
style
)
{
/* Set text background */
p_spu_sys
->
p_segments
->
style
->
i_style_flags
=
STYLE_BACKGROUND
;
p_spu_sys
->
p_segments
->
style
->
i_features
|=
STYLE_HAS_FLAGS
;
}
}
p_spu_sys
->
align
=
i_align
;
p_spu_sys
->
align
=
i_align
;
p_spu_sys
->
noregionbg
=
b_opaq
ue
;
p_spu_sys
->
noregionbg
=
tr
ue
;
#ifdef ZVBI_DEBUG
#ifdef ZVBI_DEBUG
msg_Info
(
p_dec
,
"page %x-%x(%d)
\n\"
%s
\"
"
,
p_page
.
pgno
,
p_page
.
subno
,
i_total
,
&
p_text
[
offset
]
);
msg_Info
(
p_dec
,
"page %x-%x(%d)
\n\"
%s
\"
"
,
p_page
.
pgno
,
p_page
.
subno
,
i_total
,
&
p_text
[
offset
]
);
...
...
modules/text_renderer/freetype.c
View file @
353812ff
...
@@ -735,21 +735,24 @@ static inline void RenderBackground( subpicture_region_t *p_region,
...
@@ -735,21 +735,24 @@ static inline void RenderBackground( subpicture_region_t *p_region,
p_line
->
p_character
[
i_seg_end
].
p_glyph
->
bitmap
.
width
+
p_line
->
p_character
[
i_seg_end
].
p_glyph
->
bitmap
.
width
+
i_align_left
-
p_bbox
->
xMin
;
i_align_left
-
p_bbox
->
xMin
;
uint8_t
i_x
,
i_y
,
i_z
;
const
line_character_t
*
p_char
=
&
p_line
->
p_character
[
i_char_index
];
const
line_character_t
*
p_char
=
&
p_line
->
p_character
[
i_char_index
];
ExtractComponents
(
p_char
->
b_in_karaoke
?
p_char
->
p_style
->
i_karaoke_background_color
:
if
(
p_char
->
p_style
->
i_style_flags
&
STYLE_BACKGROUND
)
p_char
->
p_style
->
i_background_color
,
&
i_x
,
&
i_y
,
&
i_z
);
const
uint8_t
i_alpha
=
p_char
->
b_in_karaoke
?
p_char
->
p_style
->
i_karaoke_background_alpha
:
p_char
->
p_style
->
i_background_alpha
;
/* Render the actual background */
if
(
i_alpha
!=
STYLE_ALPHA_TRANSPARENT
)
{
{
for
(
int
dy
=
line_top
;
dy
<
line_bottom
;
dy
++
)
uint8_t
i_x
,
i_y
,
i_z
;
ExtractComponents
(
p_char
->
b_in_karaoke
?
p_char
->
p_style
->
i_karaoke_background_color
:
p_char
->
p_style
->
i_background_color
,
&
i_x
,
&
i_y
,
&
i_z
);
const
uint8_t
i_alpha
=
p_char
->
b_in_karaoke
?
p_char
->
p_style
->
i_karaoke_background_alpha
:
p_char
->
p_style
->
i_background_alpha
;
/* Render the actual background */
if
(
i_alpha
!=
STYLE_ALPHA_TRANSPARENT
)
{
{
for
(
int
dx
=
line_start
;
dx
<
line_end
;
dx
++
)
for
(
int
dy
=
line_top
;
dy
<
line_bottom
;
dy
++
)
BlendPixel
(
p_picture
,
dx
,
dy
,
i_alpha
,
i_x
,
i_y
,
i_z
,
0xff
);
{
for
(
int
dx
=
line_start
;
dx
<
line_end
;
dx
++
)
BlendPixel
(
p_picture
,
dx
,
dy
,
i_alpha
,
i_x
,
i_y
,
i_z
,
0xff
);
}
}
}
}
}
...
@@ -796,8 +799,6 @@ static inline int RenderAXYZ( filter_t *p_filter,
...
@@ -796,8 +799,6 @@ static inline int RenderAXYZ( filter_t *p_filter,
if
(
p_region
->
b_noregionbg
)
{
if
(
p_region
->
b_noregionbg
)
{
/* Render the background just under the text */
/* Render the background just under the text */
FillPicture
(
p_picture
,
STYLE_ALPHA_TRANSPARENT
,
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
{
}
else
{
/* Render background under entire subpicture block */
/* Render background under entire subpicture block */
int
i_background_color
=
var_InheritInteger
(
p_filter
,
"freetype-background-color"
);
int
i_background_color
=
var_InheritInteger
(
p_filter
,
"freetype-background-color"
);
...
@@ -805,6 +806,9 @@ static inline int RenderAXYZ( filter_t *p_filter,
...
@@ -805,6 +806,9 @@ static inline int RenderAXYZ( filter_t *p_filter,
ExtractComponents
(
i_background_color
,
&
i_x
,
&
i_y
,
&
i_z
);
ExtractComponents
(
i_background_color
,
&
i_x
,
&
i_y
,
&
i_z
);
FillPicture
(
p_picture
,
i_a
,
i_x
,
i_y
,
i_z
);
FillPicture
(
p_picture
,
i_a
,
i_x
,
i_y
,
i_z
);
}
}
/* Render text's background (from decoder) if any */
RenderBackground
(
p_region
,
p_line_head
,
p_bbox
,
i_margin
,
p_picture
,
i_text_width
,
ExtractComponents
,
BlendPixel
);
/* Render shadow then outline and then normal glyphs */
/* Render shadow then outline and then normal glyphs */
for
(
int
g
=
0
;
g
<
3
;
g
++
)
for
(
int
g
=
0
;
g
<
3
;
g
++
)
...
...
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