Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
bbc7cfbf
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bbc7cfbf
编写于
7月 20, 2017
作者:
N
Nicolas George
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lavfi/testsrc2: fix completely transparent alpha.
上级
4a654be3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
3 deletion
+14
-3
doc/filters.texi
doc/filters.texi
+5
-0
libavfilter/vsrc_testsrc.c
libavfilter/vsrc_testsrc.c
+9
-3
未找到文件。
doc/filters.texi
浏览文件 @
bbc7cfbf
...
...
@@ -16394,6 +16394,11 @@ The sources accept the following parameters:
@table @option
@item alpha
Specify the alpha (opacity) of the background, only available in the
@code{testsrc2} source. The value must be between 0 (fully transparent) and
255 (fully opaque, the default).
@item color, c
Specify the color of the source, only available in the @code{color}
source. For the syntax of this option, check the "Color" section in the
...
...
libavfilter/vsrc_testsrc.c
浏览文件 @
bbc7cfbf
...
...
@@ -66,6 +66,9 @@ typedef struct TestSourceContext {
/* only used by testsrc */
int
nb_decimals
;
/* only used by testsrc2 */
int
alpha
;
/* only used by color */
FFDrawContext
draw
;
FFDrawColor
color
;
...
...
@@ -685,6 +688,7 @@ AVFilter ff_vsrc_testsrc = {
static
const
AVOption
testsrc2_options
[]
=
{
COMMON_OPTIONS
{
"alpha"
,
"set global alpha (opacity)"
,
OFFSET
(
alpha
),
AV_OPT_TYPE_INT
,
{.
i64
=
255
},
0
,
255
,
FLAGS
},
{
NULL
}
};
...
...
@@ -735,6 +739,7 @@ static void test2_fill_picture(AVFilterContext *ctx, AVFrame *frame)
{
TestSourceContext
*
s
=
ctx
->
priv
;
FFDrawColor
color
;
unsigned
alpha
=
(
uint32_t
)
s
->
alpha
<<
24
;
/* colored background */
{
...
...
@@ -746,7 +751,8 @@ static void test2_fill_picture(AVFilterContext *ctx, AVFrame *frame)
x2
=
ff_draw_round_to_sub
(
&
s
->
draw
,
0
,
0
,
x2
);
set_color
(
s
,
&
color
,
((
i
&
1
)
?
0xFF0000
:
0
)
|
((
i
&
2
)
?
0x00FF00
:
0
)
|
((
i
&
4
)
?
0x0000FF
:
0
));
((
i
&
4
)
?
0x0000FF
:
0
)
|
alpha
);
ff_fill_rectangle
(
&
s
->
draw
,
&
color
,
frame
->
data
,
frame
->
linesize
,
x
,
0
,
x2
-
x
,
frame
->
height
);
x
=
x2
;
...
...
@@ -763,7 +769,7 @@ static void test2_fill_picture(AVFilterContext *ctx, AVFrame *frame)
g0
=
av_rescale_q
(
s
->
pts
,
s
->
time_base
,
av_make_q
(
1
,
128
));
for
(
x
=
0
;
x
<
s
->
w
;
x
+=
dx
)
{
g
=
(
av_rescale
(
x
,
6
*
256
,
s
->
w
)
+
g0
)
%
(
6
*
256
);
set_color
(
s
,
&
color
,
color_gradient
(
g
));
set_color
(
s
,
&
color
,
color_gradient
(
g
)
|
alpha
);
y
=
y0
+
av_rescale
(
x
,
s
->
h
/
2
,
s
->
w
);
y
%=
2
*
(
s
->
h
-
16
);
if
(
y
>
s
->
h
-
16
)
...
...
@@ -785,7 +791,7 @@ static void test2_fill_picture(AVFilterContext *ctx, AVFrame *frame)
int
c
,
i
;
for
(
c
=
0
;
c
<
3
;
c
++
)
{
set_color
(
s
,
&
color
,
0xBBBBBB
^
(
0xFF
<<
(
c
<<
3
))
);
set_color
(
s
,
&
color
,
(
0xBBBBBB
^
(
0xFF
<<
(
c
<<
3
)))
|
alpha
);
pos
=
av_rescale_q
(
s
->
pts
,
s
->
time_base
,
av_make_q
(
64
>>
(
c
<<
1
),
cycle
))
%
cycle
;
xh
=
pos
<
1
*
l
?
pos
:
pos
<
2
*
l
?
l
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录