mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-22 01:40:17 -05:00
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:
parent
5e65db3b07
commit
8e37a18083
5 changed files with 73 additions and 6 deletions
25
csi.c
25
csi.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue