sixel: application configurable palette size (color count)

This implements the CSI escapes for retrieving and (re)setting the
palette size.
This commit is contained in:
Daniel Eklöf 2020-02-22 14:02:00 +01:00
parent 5e65db3b07
commit 8e37a18083
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 73 additions and 6 deletions

25
csi.c
View file

@ -15,6 +15,7 @@
#include "grid.h"
#include "vt.h"
#include "selection.h"
#include "sixel.h"
#define min(x, y) ((x) < (y) ? (x) : (y))
@ -1227,6 +1228,30 @@ csi_dispatch(struct terminal *term, uint8_t final)
}
break;
case 'S': {
unsigned target = vt_param_get(term, 0, 0);
unsigned operation = vt_param_get(term, 1, 0);
switch (target) {
case 1:
switch (operation) {
case 1: sixel_colors_report_current(term); break;
case 2: sixel_colors_reset(term); break;
case 3: sixel_colors_set(term, vt_param_get(term, 2, 0)); break;
case 4: sixel_colors_report_max(term);
}
break;
case 2:
break;
case 3:
break;
}
break;
}
default:
UNHANDLED();
break;