diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-12-28 11:08:22 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-12-28 12:32:43 +0100 |
commit | 1669c970b11f324aab744eb361e0f93ba8c00cb1 (patch) | |
tree | 622a06b0259c9c8666f7487bdc38ea810cf579a1 /libavfilter/vf_vectorscope.c | |
parent | 5c0d1f78968ce088b6750a0bfdc2a9c1ddc3692d (diff) | |
download | ffmpeg-1669c970b11f324aab744eb361e0f93ba8c00cb1.tar.gz |
avfilter/vf_vectorscope: use enum for graticule items
Diffstat (limited to 'libavfilter/vf_vectorscope.c')
-rw-r--r-- | libavfilter/vf_vectorscope.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c index e3e00797d0..c782414ffe 100644 --- a/libavfilter/vf_vectorscope.c +++ b/libavfilter/vf_vectorscope.c @@ -29,6 +29,13 @@ #include "internal.h" #include "video.h" +enum GraticuleType { + GRAT_NONE, + GRAT_GREEN, + GRAT_COLOR, + NB_GRATICULES +}; + enum VectorscopeMode { GRAY, COLOR, @@ -95,11 +102,11 @@ static const AVOption vectorscope_options[] = { { "instant", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "envelope" }, { "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "envelope" }, { "peak+instant", 0, 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "envelope" }, - { "graticule", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, FLAGS, "graticule"}, - { "g", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, FLAGS, "graticule"}, - { "none", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "graticule" }, - { "green", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "graticule" }, - { "color", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "graticule" }, + { "graticule", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=GRAT_NONE}, 0, NB_GRATICULES-1, FLAGS, "graticule"}, + { "g", "set graticule", OFFSET(graticule), AV_OPT_TYPE_INT, {.i64=GRAT_NONE}, 0, NB_GRATICULES-1, FLAGS, "graticule"}, + { "none", 0, 0, AV_OPT_TYPE_CONST, {.i64=GRAT_NONE}, 0, 0, FLAGS, "graticule" }, + { "green", 0, 0, AV_OPT_TYPE_CONST, {.i64=GRAT_GREEN}, 0, 0, FLAGS, "graticule" }, + { "color", 0, 0, AV_OPT_TYPE_CONST, {.i64=GRAT_COLOR}, 0, 0, FLAGS, "graticule" }, { "opacity", "set graticule opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 1, FLAGS}, { "o", "set graticule opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 1, FLAGS}, { "flags", "set graticule flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=4}, 0, 7, FLAGS, "flags"}, @@ -1281,14 +1288,14 @@ static int config_input(AVFilterLink *inlink) s->graticulef = none_graticule; if (s->is_yuv && s->size == 256) { - if (s->graticule == 1) + if (s->graticule == GRAT_GREEN) s->graticulef = green_graticule; - else if (s->graticule == 2) + else if (s->graticule == GRAT_COLOR) s->graticulef = color_graticule; } else if (s->is_yuv) { - if (s->graticule == 1) + if (s->graticule == GRAT_GREEN) s->graticulef = green_graticule16; - else if (s->graticule == 2) + else if (s->graticule == GRAT_COLOR) s->graticulef = color_graticule16; } |