History

avfilter/vf_blend: add harmonic mode

Paul B Mahol committed 5 years ago

Commit df163481 parent 8ebcff94 files · +5 −0Browse files

Unified · Split

4 files
  1. doc/filters.texi +1 −0
  2. libavfilter/blend.h +1 −0
  3. libavfilter/blend_modes.c +1 −0
  4. libavfilter/vf_blend.c +2 −0
doc/filters.texi+1−0
@@ -7547,6 +7547,7 @@ Available values for component modes are: · 7546 unmodified lines
7547@item glow7547@item glow
7548@item hardlight7548@item hardlight
7549@item hardmix7549@item hardmix
7550@item harmonic
7550@item heat7551@item heat
7551@item lighten7552@item lighten
7552@item linearlight7553@item linearlight
libavfilter/blend.h+1−0
@@ -61,6 +61,7 @@ enum BlendMode { · 60 unmodified lines
61 BLEND_EXTREMITY,61 BLEND_EXTREMITY,
62 BLEND_SOFTDIFFERENCE,62 BLEND_SOFTDIFFERENCE,
63 BLEND_GEOMETRIC,63 BLEND_GEOMETRIC,
64 BLEND_HARMONIC,
64 BLEND_NB65 BLEND_NB
65};66};
66 67
libavfilter/blend_modes.c+1−0
@@ -144,3 +144,4 @@ fn(vividlight, (A < HALF) ? BURN(2 * A, B) : DODGE(2 * (A - HALF), B)) · 143 unmodified lines
144fn(linearlight,CLIP((B < HALF) ? B + 2 * A - MAX : B + 2 * (A - HALF)))144fn(linearlight,CLIP((B < HALF) ? B + 2 * A - MAX : B + 2 * (A - HALF)))
145fn(softdifference,CLIP((A > B) ? (B == MAX) ? 0 : (A - B) * MAX / (MAX - B) : (B == 0) ? 0 : (B - A) * MAX / B))145fn(softdifference,CLIP((A > B) ? (B == MAX) ? 0 : (A - B) * MAX / (MAX - B) : (B == 0) ? 0 : (B - A) * MAX / B))
146fn(geometric, GEOMETRIC(A, B))146fn(geometric, GEOMETRIC(A, B))
147fn(harmonic, A == 0 && B == 0 ? 0 : 2LL * A * B / (A + B))
libavfilter/vf_blend.c+2−0
@@ -133,6 +133,7 @@ static const AVOption blend_options[] = { · 132 unmodified lines
133 { "xor", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_XOR}, 0, 0, FLAGS, "mode" },133 { "xor", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_XOR}, 0, 0, FLAGS, "mode" },
134 { "softdifference","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_SOFTDIFFERENCE}, 0, 0, FLAGS, "mode" },134 { "softdifference","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_SOFTDIFFERENCE}, 0, 0, FLAGS, "mode" },
135 { "geometric", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GEOMETRIC}, 0, 0, FLAGS, "mode" },135 { "geometric", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GEOMETRIC}, 0, 0, FLAGS, "mode" },
136 { "harmonic", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARMONIC}, 0, 0, FLAGS, "mode" },
136 { "c0_expr", "set color component #0 expression", OFFSET(params[0].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },137 { "c0_expr", "set color component #0 expression", OFFSET(params[0].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
137 { "c1_expr", "set color component #1 expression", OFFSET(params[1].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },138 { "c1_expr", "set color component #1 expression", OFFSET(params[1].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
138 { "c2_expr", "set color component #2 expression", OFFSET(params[2].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },139 { "c2_expr", "set color component #2 expression", OFFSET(params[2].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
@@ -398,6 +399,7 @@ static av_cold void init_blend_func_##depth##_##nbits##bit(FilterParams *param) · 259 unmodified lines
398 case BLEND_XOR: param->blend = blend_xor_##depth##bit; break; \399 case BLEND_XOR: param->blend = blend_xor_##depth##bit; break; \
399 case BLEND_SOFTDIFFERENCE:param->blend = blend_softdifference_##depth##bit; break;\400 case BLEND_SOFTDIFFERENCE:param->blend = blend_softdifference_##depth##bit; break;\
400 case BLEND_GEOMETRIC: param->blend = blend_geometric_##depth##bit; break; \401 case BLEND_GEOMETRIC: param->blend = blend_geometric_##depth##bit; break; \
402 case BLEND_HARMONIC: param->blend = blend_harmonic_##depth##bit; break; \
401 } \403 } \
402}404}
403DEFINE_INIT_BLEND_FUNC(8, 8)405DEFINE_INIT_BLEND_FUNC(8, 8)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t