avfilter/avf_showspectrum: add fiery color map

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2016-01-01 23:22:00 +01:00
parent 72280d1c6c
commit 9b06e7befa
2 changed files with 17 additions and 1 deletions

View File

@ -14623,6 +14623,8 @@ each channel is displayed using the moreland color scheme
each channel is displayed using the nebulae color scheme each channel is displayed using the nebulae color scheme
@item fire @item fire
each channel is displayed using the fire color scheme each channel is displayed using the fire color scheme
@item fiery
each channel is displayed using the fiery color scheme
@end table @end table
Default value is @samp{channel}. Default value is @samp{channel}.
@ -14746,6 +14748,8 @@ each channel is displayed using the moreland color scheme
each channel is displayed using the nebulae color scheme each channel is displayed using the nebulae color scheme
@item fire @item fire
each channel is displayed using the fire color scheme each channel is displayed using the fire color scheme
@item fiery
each channel is displayed using the fiery color scheme
@end table @end table
Default value is @samp{intensity}. Default value is @samp{intensity}.

View File

@ -41,7 +41,7 @@
enum DisplayMode { COMBINED, SEPARATE, NB_MODES }; enum DisplayMode { COMBINED, SEPARATE, NB_MODES };
enum DisplayScale { LINEAR, SQRT, CBRT, LOG, NB_SCALES }; enum DisplayScale { LINEAR, SQRT, CBRT, LOG, NB_SCALES };
enum ColorMode { CHANNEL, INTENSITY, RAINBOW, MORELAND, NEBULAE, FIRE, NB_CLMODES }; enum ColorMode { CHANNEL, INTENSITY, RAINBOW, MORELAND, NEBULAE, FIRE, FIERY, NB_CLMODES };
enum SlideMode { REPLACE, SCROLL, FULLFRAME, RSCROLL, NB_SLIDES }; enum SlideMode { REPLACE, SCROLL, FULLFRAME, RSCROLL, NB_SLIDES };
enum Orientation { VERTICAL, HORIZONTAL, NB_ORIENTATIONS }; enum Orientation { VERTICAL, HORIZONTAL, NB_ORIENTATIONS };
@ -96,6 +96,7 @@ static const AVOption showspectrum_options[] = {
{ "moreland", "moreland based coloring", 0, AV_OPT_TYPE_CONST, {.i64=MORELAND}, 0, 0, FLAGS, "color" }, { "moreland", "moreland based coloring", 0, AV_OPT_TYPE_CONST, {.i64=MORELAND}, 0, 0, FLAGS, "color" },
{ "nebulae", "nebulae based coloring", 0, AV_OPT_TYPE_CONST, {.i64=NEBULAE}, 0, 0, FLAGS, "color" }, { "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" }, { "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" },
{ "scale", "set display scale", OFFSET(scale), AV_OPT_TYPE_INT, {.i64=SQRT}, LINEAR, NB_SCALES-1, FLAGS, "scale" }, { "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" }, { "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" }, { "cbrt", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64=CBRT}, 0, 0, FLAGS, "scale" },
@ -175,6 +176,15 @@ static const struct ColorTable {
{ 0.77, 126/256., (74-128)/256., (172-128)/256. }, { 0.77, 126/256., (74-128)/256., (172-128)/256. },
{ 0.87, 164/256., (73-128)/256., (162-128)/256. }, { 0.87, 164/256., (73-128)/256., (162-128)/256. },
{ 1, 1, 0, 0 }}, { 1, 1, 0, 0 }},
[FIERY] = {
{ 0, 0, 0, 0 },
{ 0.23, 36/256., (116-128)/256., (163-128)/256. },
{ 0.45, 52/256., (102-128)/256., (200-128)/256. },
{ 0.57, 116/256., (84-128)/256., (196-128)/256. },
{ 0.67, 157/256., (67-128)/256., (181-128)/256. },
{ 0.77, 193/256., (40-128)/256., (155-128)/256. },
{ 0.87, 221/256., (101-128)/256., (134-128)/256. },
{ 1, 1, 0, 0 }},
}; };
static av_cold void uninit(AVFilterContext *ctx) static av_cold void uninit(AVFilterContext *ctx)
@ -456,6 +466,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
case MORELAND: case MORELAND:
case NEBULAE: case NEBULAE:
case FIRE: case FIRE:
case FIERY:
case INTENSITY: case INTENSITY:
uf = yf; uf = yf;
vf = yf; vf = yf;
@ -753,6 +764,7 @@ static const AVOption showspectrumpic_options[] = {
{ "moreland", "moreland based coloring", 0, AV_OPT_TYPE_CONST, {.i64=MORELAND}, 0, 0, FLAGS, "color" }, { "moreland", "moreland based coloring", 0, AV_OPT_TYPE_CONST, {.i64=MORELAND}, 0, 0, FLAGS, "color" },
{ "nebulae", "nebulae based coloring", 0, AV_OPT_TYPE_CONST, {.i64=NEBULAE}, 0, 0, FLAGS, "color" }, { "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" }, { "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" },
{ "scale", "set display scale", OFFSET(scale), AV_OPT_TYPE_INT, {.i64=LOG}, 0, NB_SCALES-1, FLAGS, "scale" }, { "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" }, { "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" }, { "cbrt", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64=CBRT}, 0, 0, FLAGS, "scale" },