aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-22 10:30:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-22 10:30:30 +0000
commit762526485113ea711dcf322063b1f3c6dc3e753e (patch)
tree2575576fa94c4fdfd9025a41dee48ce77ed0f25e /terminal.h
parentsixel: use a struct coord for current sixel position (diff)
sixel: clean up state machine
Use proper state names, and implement the state machine using switch statements.
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/terminal.h b/terminal.h
index 05b9b00b..882abfba 100644
--- a/terminal.h
+++ b/terminal.h
@@ -355,7 +355,12 @@ struct terminal {
} delayed_render_timer;
struct {
- enum { SIXEL_GROUND, SIXEL_REPEAT, SIXEL_RASTER, SIXEL_COLOR, SIXEL_COLOR_SPEC} state;
+ enum {
+ SIXEL_DECSIXEL, /* DECSIXEL body part ", $, -, ? ... ~ */
+ SIXEL_DECGRA, /* DECGRA Set Raster Attributes " Pan; Pad; Ph; Pv */
+ SIXEL_DECGRI, /* DECGRI Graphics Repeat Introducer ! Pn Ch */
+ SIXEL_DECGCI, /* DECGCI Graphics Color Introducer # Pc; Pu; Px; Py; Pz */
+ } state;
struct coord pos; /* Current sixel coordinate */
int color_idx; /* Current palette index */
@@ -368,8 +373,8 @@ struct terminal {
int height; /* Image height, in pixels */
} image;
- unsigned params[4]; /* Collected parmaeters, for RASTER, COLOR_SPEC */
- unsigned int param; /* Currently collecting parameter, for RASTER, COLOR_SPEC and REPEAT */
+ unsigned params[5]; /* Collected parmaeters, for RASTER, COLOR_SPEC */
+ unsigned param; /* Currently collecting parameter, for RASTER, COLOR_SPEC and REPEAT */
unsigned param_idx; /* Parameters seen */
} sixel;