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
This commit is contained in:
Daniel Eklöf 2020-02-21 21:53:23 +01:00
parent e8197d22f7
commit 9e3bfb1eab
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 350 additions and 3 deletions

View file

@ -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);