Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e9f42c6b
Commit
e9f42c6b
authored
Nov 09, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FreeType: add ARGB support
parent
d9e965aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+47
-0
No files found.
modules/text_renderer/freetype.c
View file @
e9f42c6b
...
...
@@ -365,6 +365,7 @@ static void RGBFromRGB( uint32_t i_argb,
*
pi_g
=
(
i_argb
&
0x0000ff00
)
>>
8
;
*
pi_b
=
(
i_argb
&
0x000000ff
);
}
/*****************************************************************************
* Make any TTF/OTF fonts present in the attachments of the media file
* and store them for later use by the FreeType Engine
...
...
@@ -1005,6 +1006,47 @@ static inline void BlendRGBAPixel( picture_t *p_picture,
}
}
static
void
FillARGBPicture
(
picture_t
*
pic
,
int
a
,
int
r
,
int
g
,
int
b
)
{
for
(
int
dy
=
0
;
dy
<
pic
->
p
->
i_visible_lines
;
dy
++
)
{
for
(
int
dx
=
0
;
dx
<
pic
->
p
->
i_visible_pitch
;
dx
+=
4
)
{
uint8_t
*
rgba
=
&
pic
->
p
->
p_pixels
[
dy
*
pic
->
p
->
i_pitch
+
dx
];
rgba
[
0
]
=
a
;
rgba
[
1
]
=
r
;
rgba
[
2
]
=
g
;
rgba
[
3
]
=
b
;
}
}
}
static
inline
void
BlendARGBPixel
(
picture_t
*
pic
,
int
pic_x
,
int
pic_y
,
int
a
,
int
r
,
int
g
,
int
b
,
int
alpha
)
{
uint8_t
*
rgba
=
&
pic
->
p
->
p_pixels
[
pic_y
*
pic
->
p
->
i_pitch
+
4
*
pic_x
];
int
an
=
a
*
alpha
/
255
;
int
ao
=
rgba
[
3
];
if
(
ao
==
0
)
{
rgba
[
0
]
=
an
;
rgba
[
1
]
=
r
;
rgba
[
2
]
=
g
;
rgba
[
3
]
=
b
;
}
else
{
rgba
[
0
]
=
255
-
(
255
-
rgba
[
0
])
*
(
255
-
an
)
/
255
;
if
(
rgba
[
0
]
!=
0
)
{
rgba
[
1
]
=
(
rgba
[
1
]
*
ao
*
(
255
-
an
)
/
255
+
r
*
an
)
/
rgba
[
0
];
rgba
[
2
]
=
(
rgba
[
2
]
*
ao
*
(
255
-
an
)
/
255
+
g
*
an
)
/
rgba
[
0
];
rgba
[
3
]
=
(
rgba
[
3
]
*
ao
*
(
255
-
an
)
/
255
+
b
*
an
)
/
rgba
[
0
];
}
}
}
static
inline
void
BlendAXYZGlyph
(
picture_t
*
p_picture
,
int
i_picture_x
,
int
i_picture_y
,
int
i_a
,
int
i_x
,
int
i_y
,
int
i_z
,
...
...
@@ -2092,6 +2134,11 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
RGBFromRGB
,
FillRGBAPicture
,
BlendRGBAPixel
);
else
if
(
*
p_chroma
==
VLC_CODEC_ARGB
)
rv
=
RenderAXYZ
(
p_filter
,
p_region_out
,
p_lines
,
&
bbox
,
i_margin
,
*
p_chroma
,
RGBFromRGB
,
FillARGBPicture
,
BlendARGBPixel
);
if
(
!
rv
)
break
;
}
...
...
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