mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-17 22:05:22 -05: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
21
render.c
21
render.c
|
|
@ -816,6 +816,27 @@ grid_render(struct terminal *term)
|
|||
cols_updated * term->cell_width, term->cell_height);
|
||||
}
|
||||
|
||||
if (term->sixel.pix != NULL) {
|
||||
pixman_image_composite(
|
||||
PIXMAN_OP_SRC,
|
||||
term->sixel.pix,
|
||||
NULL,
|
||||
pix,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
term->sixel.max_col,
|
||||
term->sixel.row * 6);
|
||||
wl_surface_damage_buffer(
|
||||
term->window->surface,
|
||||
0, 0, term->sixel.max_col, term->sixel.row * 6);
|
||||
|
||||
pixman_image_unref(term->sixel.pix);
|
||||
free(term->sixel.image);
|
||||
term->sixel.pix = NULL;
|
||||
term->sixel.image = NULL;
|
||||
}
|
||||
|
||||
if (term->flash.active) {
|
||||
/* Note: alpha is pre-computed in each color component */
|
||||
/* TODO: dim while searching */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue