Use a slider for temperature in the SDL GUI

This commit is contained in:
Lior Halphon 2021-01-31 19:17:48 +02:00
parent 2d76698279
commit 6798b1f11a
3 changed files with 72 additions and 22 deletions

View File

@ -1053,6 +1053,72 @@ uint8_t font[] = {
X, _, _, _, X, _, X, _, _, _, X, _,
X, _, _, _, X, _, X, _, _, _, X, _,
X, X, X, X, X, _, X, X, X, X, X, _,
/* Slider */
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, X, X, X, X,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
X, X, X, X, X, X,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
X, X, X, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
/* Slider, selected */
_, X, X, X, _, _,
_, X, X, X, _, _,
_, X, X, X, _, _,
_, X, X, X, X, X,
_, X, X, X, _, _,
_, X, X, X, _, _,
_, _, X, _, _, _,
_, _, _, _, _, _,
_, X, X, X, _, _,
_, X, X, X, _, _,
_, X, X, X, _, _,
X, X, X, X, X, X,
_, X, X, X, _, _,
_, X, X, X, _, _,
_, _, X, _, _, _,
_, _, _, _, _, _,
_, X, X, X, _, _,
_, X, X, X, _, _,
_, X, X, X, _, _,
X, X, X, X, _, _,
_, X, X, X, _, _,
_, X, X, X, _, _,
_, _, X, _, _, _,
_, _, _, _, _, _,
/* Slider, tick*/
_, _, _, _, _, _,
_, _, X, _, _, _,
_, _, X, _, _, _,
X, X, X, X, X, X,
_, _, X, _, _, _,
_, _, X, _, _, _,
_, _, _, _, _, _,
_, _, _, _, _, _,
}; };
const uint8_t font_max = sizeof(font) / GLYPH_HEIGHT / GLYPH_WIDTH + ' '; const uint8_t font_max = sizeof(font) / GLYPH_HEIGHT / GLYPH_WIDTH + ' ';

View File

@ -14,5 +14,7 @@ extern const uint8_t font_max;
#define CMD_STRING "\x84\x85" #define CMD_STRING "\x84\x85"
#define ELLIPSIS_STRING "\x87" #define ELLIPSIS_STRING "\x87"
#define MOJIBAKE_STRING "\x88" #define MOJIBAKE_STRING "\x88"
#define SLIDER_STRING "\x89\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8F\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8A\x8B"
#define SELECTED_SLIDER_STRING "\x8C\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8D\x8E"
#endif /* font_h */ #endif /* font_h */

View File

@ -519,28 +519,10 @@ const char *current_color_correction_mode(unsigned index)
const char *current_color_temperature(unsigned index) const char *current_color_temperature(unsigned index)
{ {
return (const char *[]){"12000K", static char ret[22];
"11450K", strcpy(ret, SLIDER_STRING);
"10900K", ret[configuration.color_temperature] = SELECTED_SLIDER_STRING[configuration.color_temperature];
"10350K", return ret;
"9800K",
"9250K",
"8700K",
"8150K",
"7600K",
"7050K",
"6500K (White)",
"5950K",
"5400K",
"4850K",
"4300K",
"3750K",
"3200K",
"2650K",
"2100K",
"1550K",
"1000K"}
[configuration.color_temperature];
} }