mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-18 05:34:02 -04:00
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:
parent
e8197d22f7
commit
9e3bfb1eab
6 changed files with 350 additions and 3 deletions
17
terminal.h
17
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue