History

avfilter/vf_pseudocolor: add two more presets

Paul B Mahol committed 5 years ago

Commit 0ef53cc1 parent 2859c302 files · +12 −0Browse files

Unified · Split

2 files
  1. doc/filters.texi +2 −0
  2. libavfilter/vf_pseudocolor.c +10 −0
doc/filters.texi+2−0
@@ -16465,6 +16465,8 @@ Available LUTs: · 16464 unmodified lines
1646516465 @item cividis
1646616466 @item range1
1646716467 @item range2
16468+@item shadows
16469+@item highlights
1646816470 @end table
1646916471
1647016472 @item opacity
libavfilter/vf_pseudocolor.c+10−0
@@ -78,6 +78,8 @@ enum Presets { · 77 unmodified lines
7878 PRESET_CIVIDIS,
7979 PRESET_RANGE1,
8080 PRESET_RANGE2,
81+ PRESET_SHADOWS,
82+ PRESET_HIGHLIGHTS,
8183 NB_PRESETS,
8284 };
8385
@@ -103,9 +105,13 @@ typedef struct Preset { · 19 unmodified lines
103105 static const Range full_range = {0, 256};
104106 static const Range spec1_range[] = {{0, 16}, {16, 236}, {236, 256}};
105107 static const Range spec2_range[] = {{0, 16}, {16, 22}, {22, 226}, {226, 236}, {236, 256}};
108+static const Range shadows_range[] = {{0, 32}, {32, 256}};
109+static const Range highlights_range[] = {{0, 214}, {214, 224}, {224, 256}};
106110
107111 static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
108112 static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};
113+static const Fill shadows_fills[] = {{0.8f, 0.4f, .8f}, {-1.f, -1.f, -1.f}};
114+static const Fill highlights_fills[] = {{-1.f, -1.f, -1.f}, {1.f, 0.3f, 0.6f}, {1.f, 0.2f, .5f}};
109115
110116 static const Curve curves[] =
111117 {
@@ -151,6 +157,8 @@ static const Preset presets[] = · 39 unmodified lines
151157 [PRESET_CIVIDIS] = { 1, &full_range, &curves[CIVIDIS], NULL },
152158 [PRESET_RANGE1] = { 3, spec1_range, NULL, spec1_fills },
153159 [PRESET_RANGE2] = { 5, spec2_range, NULL, spec2_fills },
160+ [PRESET_SHADOWS] = { 2, shadows_range, NULL, shadows_fills },
161+ [PRESET_HIGHLIGHTS] = { 3, highlights_range, NULL, highlights_fills },
154162 };
155163
156164 typedef struct PseudoColorContext {
@@ -199,6 +207,8 @@ static const AVOption pseudocolor_options[] = { · 42 unmodified lines
199207 { "cividis", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CIVIDIS}, .flags = FLAGS, "preset" },
200208 { "range1", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_RANGE1}, .flags = FLAGS, "preset" },
201209 { "range2", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_RANGE2}, .flags = FLAGS, "preset" },
210+ { "shadows", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_SHADOWS}, .flags = FLAGS, "preset" },
211+ { "highlights", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_HIGHLIGHTS},.flags=FLAGS, "preset" },
202212 { "opacity", "set pseudocolor opacity",OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, .flags = FLAGS },
203213 { NULL }
204214 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t