| @@ -78,6 +78,8 @@ enum Presets { · 77 unmodified lines |
| 78 | 78 | PRESET_CIVIDIS, |
| 79 | 79 | PRESET_RANGE1, |
| 80 | 80 | PRESET_RANGE2, |
| 81 | + PRESET_SHADOWS, |
| 82 | + PRESET_HIGHLIGHTS, |
| 81 | 83 | NB_PRESETS, |
| 82 | 84 | }; |
| 83 | 85 | |
| @@ -103,9 +105,13 @@ typedef struct Preset { · 19 unmodified lines |
| 103 | 105 | static const Range full_range = {0, 256}; |
| 104 | 106 | static const Range spec1_range[] = {{0, 16}, {16, 236}, {236, 256}}; |
| 105 | 107 | 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}}; |
| 106 | 110 | |
| 107 | 111 | static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}}; |
| 108 | 112 | 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}}; |
| 109 | 115 | |
| 110 | 116 | static const Curve curves[] = |
| 111 | 117 | { |
| @@ -151,6 +157,8 @@ static const Preset presets[] = · 39 unmodified lines |
| 151 | 157 | [PRESET_CIVIDIS] = { 1, &full_range, &curves[CIVIDIS], NULL }, |
| 152 | 158 | [PRESET_RANGE1] = { 3, spec1_range, NULL, spec1_fills }, |
| 153 | 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 | |
| 156 | 164 | typedef struct PseudoColorContext { |
| @@ -199,6 +207,8 @@ static const AVOption pseudocolor_options[] = { · 42 unmodified lines |
| 199 | 207 | { "cividis", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CIVIDIS}, .flags = FLAGS, "preset" }, |
| 200 | 208 | { "range1", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_RANGE1}, .flags = FLAGS, "preset" }, |
| 201 | 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 | 212 | { "opacity", "set pseudocolor opacity",OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, .flags = FLAGS }, |
| 203 | 213 | { NULL } |
| 204 | 214 | }; |