| @@ -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 |
| 103 | static const Range full_range = {0, 256}; | 105 | static const Range full_range = {0, 256}; |
| 104 | static const Range spec1_range[] = {{0, 16}, {16, 236}, {236, 256}}; | 106 | static const Range spec1_range[] = {{0, 16}, {16, 236}, {236, 256}}; |
| 105 | static const Range spec2_range[] = {{0, 16}, {16, 22}, {22, 226}, {226, 236}, {236, 256}}; | 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 | static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}}; | 111 | static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}}; |
| 108 | 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}}; | 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 | static const Curve curves[] = | 116 | static 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 | |
| 156 | typedef struct PseudoColorContext { | 164 | typedef 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 | }; |