From 9e3bfb1eab2c7b1c7a1ec6021331fddc57e8a266 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 21 Feb 2020 21:53:23 +0100 Subject: sixel: initial support This implements basic parsing of sixel data. Lots of limitations and temporary solutions as this is still work-in-progress: * Maximum image size hardcoded to 800x800 * No HLS color format support * Image is always rendered at 0x0 in the terminal --- terminal.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index d9727b32..756b0554 100644 --- a/terminal.h +++ b/terminal.h @@ -131,6 +131,7 @@ struct vt { uint8_t *data; size_t size; size_t idx; + void (*put_handler)(struct terminal *term, uint8_t c); void (*unhook_handler)(struct terminal *term); } dcs; struct attributes attrs; @@ -344,6 +345,22 @@ struct terminal { int upper_fd; } delayed_render_timer; + struct { + enum { SIXEL_SIXEL, SIXEL_REPEAT, SIXEL_RASTER, SIXEL_COLOR, SIXEL_COLOR_SPEC} state; + int row; + int col; + int color_idx; + int max_col; + unsigned params[4]; + uint32_t *palette; + uint32_t *image; + + unsigned int param; + unsigned param_idx; + + pixman_image_t *pix; + } sixel; + bool hold_at_exit; bool is_shutting_down; void (*shutdown_cb)(void *data, int exit_code); -- cgit v1.3