summaryrefslogtreecommitdiffstats
path: root/libavfilter/avf_showspectrum.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-01-04 17:13:00 +0100
committerPaul B Mahol <onemda@gmail.com>2016-01-05 10:07:58 +0100
commit0d3b31ae898f7bb8fbadd339ceda72cab1d75900 (patch)
tree0621bd94ee927b60edc1359a6f72067acf489458 /libavfilter/avf_showspectrum.c
parent68eb20801d6929974feb41219290cb4c207cdf59 (diff)
downloadffmpeg-streaming-0d3b31ae898f7bb8fbadd339ceda72cab1d75900.zip
ffmpeg-streaming-0d3b31ae898f7bb8fbadd339ceda72cab1d75900.tar.gz
avfilter/avf_showspectrum: add yet another color map
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/avf_showspectrum.c')
-rw-r--r--libavfilter/avf_showspectrum.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index accd8c7..02f6fad 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -41,7 +41,7 @@
enum DisplayMode { COMBINED, SEPARATE, NB_MODES };
enum DisplayScale { LINEAR, SQRT, CBRT, LOG, FOURTHRT, FIFTHRT, NB_SCALES };
-enum ColorMode { CHANNEL, INTENSITY, RAINBOW, MORELAND, NEBULAE, FIRE, FIERY, NB_CLMODES };
+enum ColorMode { CHANNEL, INTENSITY, RAINBOW, MORELAND, NEBULAE, FIRE, FIERY, FRUIT, NB_CLMODES };
enum SlideMode { REPLACE, SCROLL, FULLFRAME, RSCROLL, NB_SLIDES };
enum Orientation { VERTICAL, HORIZONTAL, NB_ORIENTATIONS };
@@ -98,6 +98,7 @@ static const AVOption showspectrum_options[] = {
{ "nebulae", "nebulae based coloring", 0, AV_OPT_TYPE_CONST, {.i64=NEBULAE}, 0, 0, FLAGS, "color" },
{ "fire", "fire based coloring", 0, AV_OPT_TYPE_CONST, {.i64=FIRE}, 0, 0, FLAGS, "color" },
{ "fiery", "fiery based coloring", 0, AV_OPT_TYPE_CONST, {.i64=FIERY}, 0, 0, FLAGS, "color" },
+ { "fruit", "fruit based coloring", 0, AV_OPT_TYPE_CONST, {.i64=FRUIT}, 0, 0, FLAGS, "color" },
{ "scale", "set display scale", OFFSET(scale), AV_OPT_TYPE_INT, {.i64=SQRT}, LINEAR, NB_SCALES-1, FLAGS, "scale" },
{ "sqrt", "square root", 0, AV_OPT_TYPE_CONST, {.i64=SQRT}, 0, 0, FLAGS, "scale" },
{ "cbrt", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64=CBRT}, 0, 0, FLAGS, "scale" },
@@ -189,6 +190,15 @@ static const struct ColorTable {
{ 0.77, 193/256., (40-128)/256., (155-128)/256. },
{ 0.87, 221/256., (101-128)/256., (134-128)/256. },
{ 1, 1, 0, 0 }},
+ [FRUIT] = {
+ { 0, 0, 0, 0 },
+ { 0.20, 29/256., (136-128)/256., (119-128)/256. },
+ { 0.30, 60/256., (119-128)/256., (90-128)/256. },
+ { 0.40, 85/256., (91-128)/256., (85-128)/256. },
+ { 0.50, 116/256., (70-128)/256., (105-128)/256. },
+ { 0.60, 151/256., (50-128)/256., (146-128)/256. },
+ { 0.70, 191/256., (63-128)/256., (178-128)/256. },
+ { 1, 98/256., (80-128)/256., (221-128)/256. }},
};
static av_cold void uninit(AVFilterContext *ctx)
@@ -523,6 +533,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
case NEBULAE:
case FIRE:
case FIERY:
+ case FRUIT:
case INTENSITY:
uf = yf;
vf = yf;
@@ -790,6 +801,7 @@ static const AVOption showspectrumpic_options[] = {
{ "nebulae", "nebulae based coloring", 0, AV_OPT_TYPE_CONST, {.i64=NEBULAE}, 0, 0, FLAGS, "color" },
{ "fire", "fire based coloring", 0, AV_OPT_TYPE_CONST, {.i64=FIRE}, 0, 0, FLAGS, "color" },
{ "fiery", "fiery based coloring", 0, AV_OPT_TYPE_CONST, {.i64=FIERY}, 0, 0, FLAGS, "color" },
+ { "fruit", "fruit based coloring", 0, AV_OPT_TYPE_CONST, {.i64=FRUIT}, 0, 0, FLAGS, "color" },
{ "scale", "set display scale", OFFSET(scale), AV_OPT_TYPE_INT, {.i64=LOG}, 0, NB_SCALES-1, FLAGS, "scale" },
{ "sqrt", "square root", 0, AV_OPT_TYPE_CONST, {.i64=SQRT}, 0, 0, FLAGS, "scale" },
{ "cbrt", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64=CBRT}, 0, 0, FLAGS, "scale" },
OpenPOWER on IntegriCloud