avfilter/vf_pseudocolor: add heat preset
This commit is contained in:
@@ -19707,6 +19707,7 @@ Available LUTs:
|
|||||||
@item total
|
@item total
|
||||||
@item spectral
|
@item spectral
|
||||||
@item cool
|
@item cool
|
||||||
|
@item heat
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item opacity
|
@item opacity
|
||||||
|
@@ -69,6 +69,7 @@ enum Curves {
|
|||||||
SOLAR,
|
SOLAR,
|
||||||
SPECTRAL,
|
SPECTRAL,
|
||||||
COOL,
|
COOL,
|
||||||
|
HEAT,
|
||||||
NB_CURVES,
|
NB_CURVES,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -89,6 +90,7 @@ enum Presets {
|
|||||||
PRESET_TOTAL,
|
PRESET_TOTAL,
|
||||||
PRESET_SPECTRAL,
|
PRESET_SPECTRAL,
|
||||||
PRESET_COOL,
|
PRESET_COOL,
|
||||||
|
PRESET_HEAT,
|
||||||
NB_PRESETS,
|
NB_PRESETS,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -150,6 +152,16 @@ static double coolfunv(double x)
|
|||||||
return 0.25 * sin(2.0 * x * M_PI) + 0.5;
|
return 0.25 * sin(2.0 * x * M_PI) + 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static double heatfunu(double x)
|
||||||
|
{
|
||||||
|
return 0.25 * cos(2.0 * x * M_PI + M_PI) + 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
static double heatfunv(double x)
|
||||||
|
{
|
||||||
|
return 0.25 * sin(2.0 * x * M_PI) + 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
static const Curve curves[] =
|
static const Curve curves[] =
|
||||||
{
|
{
|
||||||
[MAGMA] = {{
|
[MAGMA] = {{
|
||||||
@@ -202,6 +214,14 @@ static const Curve curves[] =
|
|||||||
.offset = { 0., 0., 0 },
|
.offset = { 0., 0., 0 },
|
||||||
.yuv = 1,
|
.yuv = 1,
|
||||||
.fun = { coolfunu, limit, coolfunv }, },
|
.fun = { coolfunu, limit, coolfunv }, },
|
||||||
|
[HEAT] = {{
|
||||||
|
{ 0, 0, 0, 0, 0, 0, 1./256, 0 },
|
||||||
|
{ 0, 0, 0, 0, 0, 0, 1./256, 0 },
|
||||||
|
{ 0, 0, 0, 0, 0, 0, 1./256, 0 },
|
||||||
|
},
|
||||||
|
.offset = { 0., 0., 0 },
|
||||||
|
.yuv = 1,
|
||||||
|
.fun = { heatfunu, limit, heatfunv }, },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const Preset presets[] =
|
static const Preset presets[] =
|
||||||
@@ -222,6 +242,7 @@ static const Preset presets[] =
|
|||||||
[PRESET_SOLAR] = { 1, &full_range, &curves[SOLAR], NULL },
|
[PRESET_SOLAR] = { 1, &full_range, &curves[SOLAR], NULL },
|
||||||
[PRESET_SPECTRAL]= { 1, &full_range, &curves[SPECTRAL],NULL },
|
[PRESET_SPECTRAL]= { 1, &full_range, &curves[SPECTRAL],NULL },
|
||||||
[PRESET_COOL] = { 1, &full_range, &curves[COOL], NULL },
|
[PRESET_COOL] = { 1, &full_range, &curves[COOL], NULL },
|
||||||
|
[PRESET_HEAT]= { 1, &full_range, &curves[HEAT],NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct PseudoColorContext {
|
typedef struct PseudoColorContext {
|
||||||
@@ -278,6 +299,7 @@ static const AVOption pseudocolor_options[] = {
|
|||||||
{ "total", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_TOTAL}, .flags=FLAGS, "preset" },
|
{ "total", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_TOTAL}, .flags=FLAGS, "preset" },
|
||||||
{ "spectral", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_SPECTRAL},.flags = FLAGS, "preset" },
|
{ "spectral", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_SPECTRAL},.flags = FLAGS, "preset" },
|
||||||
{ "cool", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COOL}, .flags = FLAGS, "preset" },
|
{ "cool", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COOL}, .flags = FLAGS, "preset" },
|
||||||
|
{ "heat", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_HEAT}, .flags = FLAGS, "preset" },
|
||||||
{ "opacity", "set pseudocolor opacity",OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, .flags = FLAGS },
|
{ "opacity", "set pseudocolor opacity",OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, .flags = FLAGS },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user