mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-19 05:55:07 +00:00
avfilter/vf_blend: add harmonic mode
This commit is contained in:
parent
8ebcff9111
commit
df163487d0
@ -7547,6 +7547,7 @@ Available values for component modes are:
|
||||
@item glow
|
||||
@item hardlight
|
||||
@item hardmix
|
||||
@item harmonic
|
||||
@item heat
|
||||
@item lighten
|
||||
@item linearlight
|
||||
|
@ -61,6 +61,7 @@ enum BlendMode {
|
||||
BLEND_EXTREMITY,
|
||||
BLEND_SOFTDIFFERENCE,
|
||||
BLEND_GEOMETRIC,
|
||||
BLEND_HARMONIC,
|
||||
BLEND_NB
|
||||
};
|
||||
|
||||
|
@ -144,3 +144,4 @@ fn(vividlight, (A < HALF) ? BURN(2 * A, B) : DODGE(2 * (A - HALF), B))
|
||||
fn(linearlight,CLIP((B < HALF) ? B + 2 * A - MAX : B + 2 * (A - HALF)))
|
||||
fn(softdifference,CLIP((A > B) ? (B == MAX) ? 0 : (A - B) * MAX / (MAX - B) : (B == 0) ? 0 : (B - A) * MAX / B))
|
||||
fn(geometric, GEOMETRIC(A, B))
|
||||
fn(harmonic, A == 0 && B == 0 ? 0 : 2LL * A * B / (A + B))
|
||||
|
@ -133,6 +133,7 @@ static const AVOption blend_options[] = {
|
||||
{ "xor", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_XOR}, 0, 0, FLAGS, "mode" },
|
||||
{ "softdifference","", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_SOFTDIFFERENCE}, 0, 0, FLAGS, "mode" },
|
||||
{ "geometric", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_GEOMETRIC}, 0, 0, FLAGS, "mode" },
|
||||
{ "harmonic", "", 0, AV_OPT_TYPE_CONST, {.i64=BLEND_HARMONIC}, 0, 0, FLAGS, "mode" },
|
||||
{ "c0_expr", "set color component #0 expression", OFFSET(params[0].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
|
||||
{ "c1_expr", "set color component #1 expression", OFFSET(params[1].expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
|
||||
{ "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)
|
||||
case BLEND_XOR: param->blend = blend_xor_##depth##bit; break; \
|
||||
case BLEND_SOFTDIFFERENCE:param->blend = blend_softdifference_##depth##bit; break;\
|
||||
case BLEND_GEOMETRIC: param->blend = blend_geometric_##depth##bit; break; \
|
||||
case BLEND_HARMONIC: param->blend = blend_harmonic_##depth##bit; break; \
|
||||
} \
|
||||
}
|
||||
DEFINE_INIT_BLEND_FUNC(8, 8)
|
||||
|
Loading…
Reference in New Issue
Block a user