summaryrefslogtreecommitdiff
path: root/libavfilter/vf_vectorscope.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-08-23 11:54:16 +0000
committerPaul B Mahol <onemda@gmail.com>2015-08-24 14:19:30 +0000
commitc34c050303b11e3f88fa1be7b43fe9439765e0af (patch)
tree16e8e19613b16942333c7a73cedcb4dae5239ede /libavfilter/vf_vectorscope.c
parentee155c18a2c50b339ba5f6f223fbb6dc343fd471 (diff)
avfilter/vf_vectorscope: make intensity user configurable
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_vectorscope.c')
-rw-r--r--libavfilter/vf_vectorscope.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index dd26aa6cdb..7f875a4503 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -38,6 +38,7 @@ enum VectorscopeMode {
typedef struct VectorscopeContext {
const AVClass *class;
int mode;
+ int intensity;
const uint8_t *bg_color;
int planewidth[4];
int planeheight[4];
@@ -56,6 +57,7 @@ static const AVOption vectorscope_options[] = {
{ "color3", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR3}, 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},
{ NULL }
};
@@ -182,6 +184,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const int slinesizex = in->linesize[s->x];
const int slinesizey = in->linesize[s->y];
const int dlinesize = out->linesize[0];
+ const int intensity = s->intensity;
int i, j, px = s->x, py = s->y;
const int h = s->planeheight[py];
const int w = s->planewidth[px];
@@ -204,7 +207,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const int y = spy[iwy + j];
const int pos = y * dlinesize + x;
- dpd[pos] = FFMIN(dpd[pos] + 1, 255);
+ dpd[pos] = FFMIN(dpd[pos] + intensity, 255);
if (dst[3])
dst[3][pos] = 255;
}
@@ -218,9 +221,9 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const int y = spy[iwy + j];
const int pos = y * dlinesize + x;
- dst[0][pos] = FFMIN(dst[0][pos] + 1, 255);
- dst[1][pos] = FFMIN(dst[1][pos] + 1, 255);
- dst[2][pos] = FFMIN(dst[2][pos] + 1, 255);
+ dst[0][pos] = FFMIN(dst[0][pos] + intensity, 255);
+ dst[1][pos] = FFMIN(dst[1][pos] + intensity, 255);
+ dst[2][pos] = FFMIN(dst[2][pos] + intensity, 255);
if (dst[3])
dst[3][pos] = 255;
}
@@ -283,7 +286,7 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const int y = spy[iw2 + j];
const int pos = y * dlinesize + x;
- dpd[pos] = FFMIN(255, dpd[pos] + 1);
+ dpd[pos] = FFMIN(255, dpd[pos] + intensity);
dpx[pos] = x;
dpy[pos] = y;
if (dst[3])