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
b6a0aa1c
Commit
b6a0aa1c
authored
Feb 24, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_blend: add freeze and heat modes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
2ef37691
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
filters.texi
doc/filters.texi
+2
-0
blend.h
libavfilter/blend.h
+2
-0
vf_blend.c
libavfilter/vf_blend.c
+8
-0
No files found.
doc/filters.texi
View file @
b6a0aa1c
...
...
@@ -4240,10 +4240,12 @@ Available values for component modes are:
@item difference128
@item divide
@item dodge
@item freeze
@item exclusion
@item glow
@item hardlight
@item hardmix
@item heat
@item lighten
@item linearlight
@item multiply
...
...
libavfilter/blend.h
View file @
b6a0aa1c
...
...
@@ -56,6 +56,8 @@ enum BlendMode {
BLEND_GLOW
,
BLEND_ADDITION128
,
BLEND_MULTIPLY128
,
BLEND_HEAT
,
BLEND_FREEZE
,
BLEND_NB
};
...
...
libavfilter/vf_blend.c
View file @
b6a0aa1c
...
...
@@ -76,9 +76,11 @@ typedef struct ThreadData {
{ "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" },\
{ "freeze", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_FREEZE}, 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" },\
{ "heat", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HEAT}, 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" },\
...
...
@@ -245,6 +247,8 @@ DEFINE_BLEND8(screen, SCREEN(1, A, B))
DEFINE_BLEND8
(
overlay
,
(
A
<
128
)
?
MULTIPLY
(
2
,
A
,
B
)
:
SCREEN
(
2
,
A
,
B
))
DEFINE_BLEND8
(
hardlight
,
(
B
<
128
)
?
MULTIPLY
(
2
,
B
,
A
)
:
SCREEN
(
2
,
B
,
A
))
DEFINE_BLEND8
(
hardmix
,
(
A
<
(
255
-
B
))
?
0
:
255
)
DEFINE_BLEND8
(
heat
,
(
A
==
0
)
?
0
:
255
-
FFMIN
(((
255
-
B
)
*
(
255
-
B
))
/
A
,
255
))
DEFINE_BLEND8
(
freeze
,
(
B
==
0
)
?
0
:
255
-
FFMIN
(((
255
-
A
)
*
(
255
-
A
))
/
B
,
255
))
DEFINE_BLEND8
(
darken
,
FFMIN
(
A
,
B
))
DEFINE_BLEND8
(
lighten
,
FFMAX
(
A
,
B
))
DEFINE_BLEND8
(
divide
,
av_clip_uint8
(
B
==
0
?
255
:
255
*
A
/
B
))
...
...
@@ -285,6 +289,8 @@ DEFINE_BLEND16(screen, SCREEN(1, A, B))
DEFINE_BLEND16
(
overlay
,
(
A
<
32768
)
?
MULTIPLY
(
2
,
A
,
B
)
:
SCREEN
(
2
,
A
,
B
))
DEFINE_BLEND16
(
hardlight
,
(
B
<
32768
)
?
MULTIPLY
(
2
,
B
,
A
)
:
SCREEN
(
2
,
B
,
A
))
DEFINE_BLEND16
(
hardmix
,
(
A
<
(
65535
-
B
))
?
0
:
65535
)
DEFINE_BLEND16
(
heat
,
(
A
==
0
)
?
0
:
65535
-
FFMIN
(((
65535
-
B
)
*
(
65535
-
B
))
/
A
,
65535
))
DEFINE_BLEND16
(
freeze
,
(
B
==
0
)
?
0
:
65535
-
FFMIN
(((
65535
-
A
)
*
(
65535
-
A
))
/
B
,
65535
))
DEFINE_BLEND16
(
darken
,
FFMIN
(
A
,
B
))
DEFINE_BLEND16
(
lighten
,
FFMAX
(
A
,
B
))
DEFINE_BLEND16
(
divide
,
av_clip_uint16
(
B
==
0
?
65535
:
65535
*
A
/
B
))
...
...
@@ -451,9 +457,11 @@ void ff_blend_init(FilterParams *param, int is_16bit)
case
BLEND_DIVIDE
:
param
->
blend
=
is_16bit
?
blend_divide_16bit
:
blend_divide_8bit
;
break
;
case
BLEND_DODGE
:
param
->
blend
=
is_16bit
?
blend_dodge_16bit
:
blend_dodge_8bit
;
break
;
case
BLEND_EXCLUSION
:
param
->
blend
=
is_16bit
?
blend_exclusion_16bit
:
blend_exclusion_8bit
;
break
;
case
BLEND_FREEZE
:
param
->
blend
=
is_16bit
?
blend_freeze_16bit
:
blend_freeze_8bit
;
break
;
case
BLEND_GLOW
:
param
->
blend
=
is_16bit
?
blend_glow_16bit
:
blend_glow_8bit
;
break
;
case
BLEND_HARDLIGHT
:
param
->
blend
=
is_16bit
?
blend_hardlight_16bit
:
blend_hardlight_8bit
;
break
;
case
BLEND_HARDMIX
:
param
->
blend
=
is_16bit
?
blend_hardmix_16bit
:
blend_hardmix_8bit
;
break
;
case
BLEND_HEAT
:
param
->
blend
=
is_16bit
?
blend_heat_16bit
:
blend_heat_8bit
;
break
;
case
BLEND_LIGHTEN
:
param
->
blend
=
is_16bit
?
blend_lighten_16bit
:
blend_lighten_8bit
;
break
;
case
BLEND_LINEARLIGHT
:
param
->
blend
=
is_16bit
?
blend_linearlight_16bit
:
blend_linearlight_8bit
;
break
;
case
BLEND_MULTIPLY
:
param
->
blend
=
is_16bit
?
blend_multiply_16bit
:
blend_multiply_8bit
;
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