Merge image_merge into 4902-image-support

Replace SIXEL retention and the per-client cache with the global indexed-image cache from image_merge. Adapt its backend callbacks for Kitty and test palette quantization through both input protocols.
This commit is contained in:
Nicholas Marriott
2026-10-14 15:39:59 +01:00
8 changed files with 364 additions and 554 deletions

17
image.c
View File

@@ -60,7 +60,6 @@ struct image {
size_t stride;
size_t size;
u_char *pixels;
struct sixel_image *sixel;
RB_ENTRY(image) entry;
};
@@ -255,8 +254,6 @@ image_free(struct image *im)
free(im->pixels);
if (im->parent != NULL)
image_free(im->parent);
if (im->sixel != NULL)
sixel_free(im->sixel);
free(im);
}
}
@@ -362,20 +359,6 @@ image_has_no_cursor(struct image *im)
return (!!(im->flags & IMAGE_FLAG_NO_CURSOR));
}
/* Return an image's original SIXEL data. */
struct sixel_image *
image_get_sixel(struct image *im)
{
return (im->sixel);
}
/* Associate original SIXEL data with an image. */
void
image_set_sixel(struct image *im, struct sixel_image *si)
{
im->sixel = si;
}
/* Return the original source image ID. */
u_int
image_get_source_id(struct image *im)