summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-08-07 16:44:19 +0200
committerPaul B Mahol <onemda@gmail.com>2015-08-07 16:44:19 +0200
commit2bdd026b264ebd8a09399277aefca66715630617 (patch)
treec9ad609ac2d75e051a361abccaf40e7b9e1ab422
parent8015150f43875531f05e31ac5021ea676fb20e40 (diff)
downloadffmpeg-streaming-2bdd026b264ebd8a09399277aefca66715630617.zip
ffmpeg-streaming-2bdd026b264ebd8a09399277aefca66715630617.tar.gz
avfilter/avf_avectorscope: stop making output fully transparent
-rw-r--r--doc/filters.texi8
-rw-r--r--libavfilter/avf_avectorscope.c16
2 files changed, 16 insertions, 8 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index f0b896b..148dce3 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -11696,13 +11696,17 @@ Set the output frame rate. Default value is @code{25}.
@item rc
@item gc
@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]}.
@item rf
@item gf
@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]}.
@item zoom
diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index 3027de3..381752f 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -45,8 +45,8 @@ typedef struct AudioVectorScopeContext {
int w, h;
int hw, hh;
int mode;
- int contrast[3];
- int fade[3];
+ int contrast[4];
+ int fade[4];
double zoom;
AVRational frame_rate;
} AudioVectorScopeContext;
@@ -63,13 +63,15 @@ static const AVOption avectorscope_options[] = {
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="400x400"}, 0, 0, FLAGS },
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="400x400"}, 0, 0, FLAGS },
- { "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 },
- { "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 },
{ "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 },
- { "zoom", "set zoom factor", OFFSET(zoom), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 10, 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 },
{ 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[1] = FFMIN(dst[1] + s->contrast[1], 255);
dst[2] = FFMIN(dst[2] + s->contrast[2], 255);
+ dst[3] = FFMIN(dst[3] + s->contrast[3], 255);
}
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+1] = FFMAX(d[j+1] - s->fade[1], 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;
}
OpenPOWER on IntegriCloud