History

avfilter/vf_pseudocolor: add two more presets

Paul B Mahol committed 5 years ago

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

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/vf_pseudocolor.c+10−0
@@ -78,6 +78,8 @@ enum Presets { · 77 unmodified lines
78 PRESET_CIVIDIS,78 PRESET_CIVIDIS,
79 PRESET_RANGE1,79 PRESET_RANGE1,
80 PRESET_RANGE2,80 PRESET_RANGE2,
81 PRESET_SHADOWS,
82 PRESET_HIGHLIGHTS,
81 NB_PRESETS,83 NB_PRESETS,
82};84};
83 85
@@ -103,9 +105,13 @@ typedef struct Preset { · 19 unmodified lines
103static const Range full_range = {0, 256};105static const Range full_range = {0, 256};
104static const Range spec1_range[] = {{0, 16}, {16, 236}, {236, 256}};106static const Range spec1_range[] = {{0, 16}, {16, 236}, {236, 256}};
105static const Range spec2_range[] = {{0, 16}, {16, 22}, {22, 226}, {226, 236}, {236, 256}};107static const Range spec2_range[] = {{0, 16}, {16, 22}, {22, 226}, {226, 236}, {236, 256}};
108static const Range shadows_range[] = {{0, 32}, {32, 256}};
109static const Range highlights_range[] = {{0, 214}, {214, 224}, {224, 256}};
106 110
107static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};111static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};
108static 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}};112static 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}};
113static const Fill shadows_fills[] = {{0.8f, 0.4f, .8f}, {-1.f, -1.f, -1.f}};
114static const Fill highlights_fills[] = {{-1.f, -1.f, -1.f}, {1.f, 0.3f, 0.6f}, {1.f, 0.2f, .5f}};
109 115
110static const Curve curves[] =116static const Curve curves[] =
111{117{
@@ -151,6 +157,8 @@ static const Preset presets[] = · 39 unmodified lines
151 [PRESET_CIVIDIS] = { 1, &full_range, &curves[CIVIDIS], NULL },157 [PRESET_CIVIDIS] = { 1, &full_range, &curves[CIVIDIS], NULL },
152 [PRESET_RANGE1] = { 3, spec1_range, NULL, spec1_fills },158 [PRESET_RANGE1] = { 3, spec1_range, NULL, spec1_fills },
153 [PRESET_RANGE2] = { 5, spec2_range, NULL, spec2_fills },159 [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 },
154};162};
155 163
156typedef struct PseudoColorContext {164typedef struct PseudoColorContext {
@@ -199,6 +207,8 @@ static const AVOption pseudocolor_options[] = { · 42 unmodified lines
199 { "cividis", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CIVIDIS}, .flags = FLAGS, "preset" },207 { "cividis", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CIVIDIS}, .flags = FLAGS, "preset" },
200 { "range1", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_RANGE1}, .flags = FLAGS, "preset" },208 { "range1", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_RANGE1}, .flags = FLAGS, "preset" },
201 { "range2", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_RANGE2}, .flags = FLAGS, "preset" },209 { "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" },
202 { "opacity", "set pseudocolor opacity",OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, .flags = FLAGS },212 { "opacity", "set pseudocolor opacity",OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, .flags = FLAGS },
203 { NULL }213 { NULL }
204};214};

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