summaryrefslogtreecommitdiff
path: root/libavfilter/vf_vectorscope.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-09-04 18:47:46 +0000
committerPaul B Mahol <onemda@gmail.com>2015-09-04 18:47:46 +0000
commitf011e98cb17b123c18babf49b48e4878e37399a3 (patch)
tree7411ac3c547835c5740a02fa620a6b4d87611c3b /libavfilter/vf_vectorscope.c
parentdb592f3b03a21d5bd5237021c00af3ce0431fc60 (diff)
avfilter/vf_vectorscope: change intensity to float
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_vectorscope.c')
-rw-r--r--libavfilter/vf_vectorscope.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index 60a75ef7aa..42052e6d8f 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -40,6 +40,7 @@ typedef struct VectorscopeContext {
const AVClass *class;
int mode;
int intensity;
+ float fintensity;
const uint8_t *bg_color;
int planewidth[4];
int planeheight[4];
@@ -63,8 +64,8 @@ static const AVOption vectorscope_options[] = {
{ "color4", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR4}, 0, 0, FLAGS, "mode" },
{ "x", "set color component on X axis", OFFSET(x), AV_OPT_TYPE_INT, {.i64=1}, 0, 2, FLAGS},
{ "y", "set color component on Y axis", OFFSET(y), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS},
- { "intensity", "set intensity", OFFSET(intensity), AV_OPT_TYPE_INT, {.i64=1}, 1, 255, FLAGS},
- { "i", "set intensity", OFFSET(intensity), AV_OPT_TYPE_INT, {.i64=1}, 1, 255, FLAGS},
+ { "intensity", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
+ { "i", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
{ "envelope", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
{ "e", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
{ "none", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "envelope" },
@@ -187,7 +188,9 @@ static int config_output(AVFilterLink *outlink)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format);
const int depth = desc->comp[0].depth_minus1 + 1;
+ VectorscopeContext *s = outlink->src->priv;
+ s->intensity = s->fintensity * ((1 << depth) - 1);
outlink->h = outlink->w = 1 << depth;
outlink->sample_aspect_ratio = (AVRational){1,1};
return 0;