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
3e04746e
Commit
3e04746e
authored
Jun 02, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_blend: add hardmix mode
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
20cea0c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
filters.texi
doc/filters.texi
+1
-0
vf_blend.c
libavfilter/vf_blend.c
+4
-0
No files found.
doc/filters.texi
View file @
3e04746e
...
@@ -2749,6 +2749,7 @@ Available values for component modes are:
...
@@ -2749,6 +2749,7 @@ Available values for component modes are:
@item dodge
@item dodge
@item exclusion
@item exclusion
@item hardlight
@item hardlight
@item hardmix
@item lighten
@item lighten
@item multiply
@item multiply
@item negation
@item negation
...
...
libavfilter/vf_blend.c
View file @
3e04746e
...
@@ -59,6 +59,7 @@ enum BlendMode {
...
@@ -59,6 +59,7 @@ enum BlendMode {
BLEND_SUBTRACT
,
BLEND_SUBTRACT
,
BLEND_VIVIDLIGHT
,
BLEND_VIVIDLIGHT
,
BLEND_XOR
,
BLEND_XOR
,
BLEND_HARDMIX
,
BLEND_NB
BLEND_NB
};
};
...
@@ -117,6 +118,7 @@ typedef struct {
...
@@ -117,6 +118,7 @@ typedef struct {
{ "dodge", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_DODGE}, 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" },\
{ "exclusion", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_EXCLUSION}, 0, 0, FLAGS, "mode" },\
{ "hardlight", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARDLIGHT}, 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" },\
{ "lighten", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_LIGHTEN}, 0, 0, FLAGS, "mode" },\
{ "multiply", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_MULTIPLY}, 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" },\
{ "negation", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_NEGATION}, 0, 0, FLAGS, "mode" },\
...
@@ -201,6 +203,7 @@ DEFINE_BLEND(difference128, av_clip_uint8(128 + A - B))
...
@@ -201,6 +203,7 @@ DEFINE_BLEND(difference128, av_clip_uint8(128 + A - B))
DEFINE_BLEND
(
screen
,
SCREEN
(
1
,
A
,
B
))
DEFINE_BLEND
(
screen
,
SCREEN
(
1
,
A
,
B
))
DEFINE_BLEND
(
overlay
,
(
A
<
128
)
?
MULTIPLY
(
2
,
A
,
B
)
:
SCREEN
(
2
,
A
,
B
))
DEFINE_BLEND
(
overlay
,
(
A
<
128
)
?
MULTIPLY
(
2
,
A
,
B
)
:
SCREEN
(
2
,
A
,
B
))
DEFINE_BLEND
(
hardlight
,
(
B
<
128
)
?
MULTIPLY
(
2
,
B
,
A
)
:
SCREEN
(
2
,
B
,
A
))
DEFINE_BLEND
(
hardlight
,
(
B
<
128
)
?
MULTIPLY
(
2
,
B
,
A
)
:
SCREEN
(
2
,
B
,
A
))
DEFINE_BLEND
(
hardmix
,
(
A
<
(
255
-
B
))
?
0
:
255
)
DEFINE_BLEND
(
darken
,
FFMIN
(
A
,
B
))
DEFINE_BLEND
(
darken
,
FFMIN
(
A
,
B
))
DEFINE_BLEND
(
lighten
,
FFMAX
(
A
,
B
))
DEFINE_BLEND
(
lighten
,
FFMAX
(
A
,
B
))
DEFINE_BLEND
(
divide
,
av_clip_uint8
(((
float
)
A
/
((
float
)
B
)
*
255
)))
DEFINE_BLEND
(
divide
,
av_clip_uint8
(((
float
)
A
/
((
float
)
B
)
*
255
)))
...
@@ -326,6 +329,7 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -326,6 +329,7 @@ static av_cold int init(AVFilterContext *ctx)
case
BLEND_DODGE
:
param
->
blend
=
blend_dodge
;
break
;
case
BLEND_DODGE
:
param
->
blend
=
blend_dodge
;
break
;
case
BLEND_EXCLUSION
:
param
->
blend
=
blend_exclusion
;
break
;
case
BLEND_EXCLUSION
:
param
->
blend
=
blend_exclusion
;
break
;
case
BLEND_HARDLIGHT
:
param
->
blend
=
blend_hardlight
;
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_LIGHTEN
:
param
->
blend
=
blend_lighten
;
break
;
case
BLEND_MULTIPLY
:
param
->
blend
=
blend_multiply
;
break
;
case
BLEND_MULTIPLY
:
param
->
blend
=
blend_multiply
;
break
;
case
BLEND_NEGATION
:
param
->
blend
=
blend_negation
;
break
;
case
BLEND_NEGATION
:
param
->
blend
=
blend_negation
;
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