Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b8c0cf78
Commit
b8c0cf78
authored
Jun 03, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_blend: add linearlight and glow mode
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
ce1761db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
filters.texi
doc/filters.texi
+2
-0
vf_blend.c
libavfilter/vf_blend.c
+8
-0
No files found.
doc/filters.texi
View file @
b8c0cf78
...
...
@@ -2748,9 +2748,11 @@ Available values for component modes are:
@item divide
@item dodge
@item exclusion
@item glow
@item hardlight
@item hardmix
@item lighten
@item linearlight
@item multiply
@item negation
@item normal
...
...
libavfilter/vf_blend.c
View file @
b8c0cf78
...
...
@@ -60,6 +60,8 @@ enum BlendMode {
BLEND_VIVIDLIGHT
,
BLEND_XOR
,
BLEND_HARDMIX
,
BLEND_LINEARLIGHT
,
BLEND_GLOW
,
BLEND_NB
};
...
...
@@ -117,9 +119,11 @@ typedef struct {
{ "divide", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_DIVIDE}, 0, 0, FLAGS, "mode" },\
{ "dodge", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_DODGE}, 0, 0, FLAGS, "mode" },\
{ "exclusion", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_EXCLUSION}, 0, 0, FLAGS, "mode" },\
{ "glow", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GLOW}, 0, 0, FLAGS, "mode" },\
{ "hardlight", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARDLIGHT}, 0, 0, FLAGS, "mode" },\
{ "hardmix", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARDMIX}, 0, 0, FLAGS, "mode" },\
{ "lighten", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_LIGHTEN}, 0, 0, FLAGS, "mode" },\
{ "linearlight","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_LINEARLIGHT},0, 0, FLAGS, "mode" },\
{ "multiply", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_MULTIPLY}, 0, 0, FLAGS, "mode" },\
{ "negation", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_NEGATION}, 0, 0, FLAGS, "mode" },\
{ "normal", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_NORMAL}, 0, 0, FLAGS, "mode" },\
...
...
@@ -214,10 +218,12 @@ DEFINE_BLEND(exclusion, A + B - 2 * A * B / 255)
DEFINE_BLEND
(
pinlight
,
(
B
<
128
)
?
FFMIN
(
A
,
2
*
B
)
:
FFMAX
(
A
,
2
*
(
B
-
128
)))
DEFINE_BLEND
(
phoenix
,
FFMIN
(
A
,
B
)
-
FFMAX
(
A
,
B
)
+
255
)
DEFINE_BLEND
(
reflect
,
(
B
==
255
)
?
B
:
FFMIN
(
255
,
(
A
*
A
/
(
255
-
B
))))
DEFINE_BLEND
(
glow
,
(
A
==
255
)
?
A
:
FFMIN
(
255
,
(
B
*
B
/
(
255
-
A
))))
DEFINE_BLEND
(
and
,
A
&
B
)
DEFINE_BLEND
(
or
,
A
|
B
)
DEFINE_BLEND
(
xor
,
A
^
B
)
DEFINE_BLEND
(
vividlight
,
(
A
<
128
)
?
BURN
(
2
*
A
,
B
)
:
DODGE
(
2
*
(
A
-
128
),
B
))
DEFINE_BLEND
(
linearlight
,
av_clip_uint8
((
B
<
128
)
?
B
+
2
*
A
-
255
:
B
+
2
*
(
A
-
128
)))
static
void
blend_expr
(
const
uint8_t
*
top
,
int
top_linesize
,
const
uint8_t
*
bottom
,
int
bottom_linesize
,
...
...
@@ -328,9 +334,11 @@ static av_cold int init(AVFilterContext *ctx)
case
BLEND_DIVIDE
:
param
->
blend
=
blend_divide
;
break
;
case
BLEND_DODGE
:
param
->
blend
=
blend_dodge
;
break
;
case
BLEND_EXCLUSION
:
param
->
blend
=
blend_exclusion
;
break
;
case
BLEND_GLOW
:
param
->
blend
=
blend_glow
;
break
;
case
BLEND_HARDLIGHT
:
param
->
blend
=
blend_hardlight
;
break
;
case
BLEND_HARDMIX
:
param
->
blend
=
blend_hardmix
;
break
;
case
BLEND_LIGHTEN
:
param
->
blend
=
blend_lighten
;
break
;
case
BLEND_LINEARLIGHT
:
param
->
blend
=
blend_linearlight
;
break
;
case
BLEND_MULTIPLY
:
param
->
blend
=
blend_multiply
;
break
;
case
BLEND_NEGATION
:
param
->
blend
=
blend_negation
;
break
;
case
BLEND_NORMAL
:
param
->
blend
=
blend_normal
;
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