avfilter/avf_avectorscope: stop making output fully transparent
This commit is contained in:
parent
8015150f43
commit
2bdd026b26
@ -11696,13 +11696,17 @@ Set the output frame rate. Default value is @code{25}.
|
|||||||
@item rc
|
@item rc
|
||||||
@item gc
|
@item gc
|
||||||
@item bc
|
@item bc
|
||||||
Specify the red, green and blue contrast. Default values are @code{40}, @code{160} and @code{80}.
|
@item ac
|
||||||
|
Specify the red, green, blue and alpha contrast. Default values are @code{40},
|
||||||
|
@code{160}, @code{80} and @code{255}.
|
||||||
Allowed range is @code{[0, 255]}.
|
Allowed range is @code{[0, 255]}.
|
||||||
|
|
||||||
@item rf
|
@item rf
|
||||||
@item gf
|
@item gf
|
||||||
@item bf
|
@item bf
|
||||||
Specify the red, green and blue fade. Default values are @code{15}, @code{10} and @code{5}.
|
@item af
|
||||||
|
Specify the red, green, blue and alpha fade. Default values are @code{15},
|
||||||
|
@code{10}, @code{5} and @code{5}.
|
||||||
Allowed range is @code{[0, 255]}.
|
Allowed range is @code{[0, 255]}.
|
||||||
|
|
||||||
@item zoom
|
@item zoom
|
||||||
|
@ -45,8 +45,8 @@ typedef struct AudioVectorScopeContext {
|
|||||||
int w, h;
|
int w, h;
|
||||||
int hw, hh;
|
int hw, hh;
|
||||||
int mode;
|
int mode;
|
||||||
int contrast[3];
|
int contrast[4];
|
||||||
int fade[3];
|
int fade[4];
|
||||||
double zoom;
|
double zoom;
|
||||||
AVRational frame_rate;
|
AVRational frame_rate;
|
||||||
} AudioVectorScopeContext;
|
} AudioVectorScopeContext;
|
||||||
@ -66,9 +66,11 @@ static const AVOption avectorscope_options[] = {
|
|||||||
{ "rc", "set red contrast", OFFSET(contrast[0]), AV_OPT_TYPE_INT, {.i64=40}, 0, 255, FLAGS },
|
{ "rc", "set red contrast", OFFSET(contrast[0]), AV_OPT_TYPE_INT, {.i64=40}, 0, 255, FLAGS },
|
||||||
{ "gc", "set green contrast", OFFSET(contrast[1]), AV_OPT_TYPE_INT, {.i64=160}, 0, 255, FLAGS },
|
{ "gc", "set green contrast", OFFSET(contrast[1]), AV_OPT_TYPE_INT, {.i64=160}, 0, 255, FLAGS },
|
||||||
{ "bc", "set blue contrast", OFFSET(contrast[2]), AV_OPT_TYPE_INT, {.i64=80}, 0, 255, FLAGS },
|
{ "bc", "set blue contrast", OFFSET(contrast[2]), AV_OPT_TYPE_INT, {.i64=80}, 0, 255, FLAGS },
|
||||||
|
{ "ac", "set alpha contrast", OFFSET(contrast[3]), AV_OPT_TYPE_INT, {.i64=255}, 0, 255, FLAGS },
|
||||||
{ "rf", "set red fade", OFFSET(fade[0]), AV_OPT_TYPE_INT, {.i64=15}, 0, 255, FLAGS },
|
{ "rf", "set red fade", OFFSET(fade[0]), AV_OPT_TYPE_INT, {.i64=15}, 0, 255, FLAGS },
|
||||||
{ "gf", "set green fade", OFFSET(fade[1]), AV_OPT_TYPE_INT, {.i64=10}, 0, 255, FLAGS },
|
{ "gf", "set green fade", OFFSET(fade[1]), AV_OPT_TYPE_INT, {.i64=10}, 0, 255, FLAGS },
|
||||||
{ "bf", "set blue fade", OFFSET(fade[2]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, FLAGS },
|
{ "bf", "set blue fade", OFFSET(fade[2]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, FLAGS },
|
||||||
|
{ "af", "set alpha fade", OFFSET(fade[3]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, FLAGS },
|
||||||
{ "zoom", "set zoom factor", OFFSET(zoom), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 10, FLAGS },
|
{ "zoom", "set zoom factor", OFFSET(zoom), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 10, FLAGS },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
@ -92,6 +94,7 @@ static void draw_dot(AudioVectorScopeContext *s, unsigned x, unsigned y)
|
|||||||
dst[0] = FFMIN(dst[0] + s->contrast[0], 255);
|
dst[0] = FFMIN(dst[0] + s->contrast[0], 255);
|
||||||
dst[1] = FFMIN(dst[1] + s->contrast[1], 255);
|
dst[1] = FFMIN(dst[1] + s->contrast[1], 255);
|
||||||
dst[2] = FFMIN(dst[2] + s->contrast[2], 255);
|
dst[2] = FFMIN(dst[2] + s->contrast[2], 255);
|
||||||
|
dst[3] = FFMIN(dst[3] + s->contrast[3], 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fade(AudioVectorScopeContext *s)
|
static void fade(AudioVectorScopeContext *s)
|
||||||
@ -106,6 +109,7 @@ static void fade(AudioVectorScopeContext *s)
|
|||||||
d[j+0] = FFMAX(d[j+0] - s->fade[0], 0);
|
d[j+0] = FFMAX(d[j+0] - s->fade[0], 0);
|
||||||
d[j+1] = FFMAX(d[j+1] - s->fade[1], 0);
|
d[j+1] = FFMAX(d[j+1] - s->fade[1], 0);
|
||||||
d[j+2] = FFMAX(d[j+2] - s->fade[2], 0);
|
d[j+2] = FFMAX(d[j+2] - s->fade[2], 0);
|
||||||
|
d[j+3] = FFMAX(d[j+3] - s->fade[3], 0);
|
||||||
}
|
}
|
||||||
d += linesize;
|
d += linesize;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user