aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-21 20:53:23 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-21 20:53:23 +0000
commit9e3bfb1eab2c7b1c7a1ec6021331fddc57e8a266 (patch)
tree35d03f0099762cb82ca23e584d4bd4464d548332 /render.c
parentkeymap: tab: handle all modifiers (diff)
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
Diffstat (limited to 'render.c')
-rw-r--r--render.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/render.c b/render.c
index bb229288..a88aba17 100644
--- a/render.c
+++ b/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 */