kitty images: support pngs with greyscale/alpha (bpp=2)

Fixes #1355
This commit is contained in:
Mitchell Hashimoto
2024-01-22 14:29:44 -08:00
parent 19fec4d151
commit 7c8b156960
6 changed files with 144 additions and 2 deletions

View File

@@ -853,6 +853,7 @@ fn prepKittyGraphics(
};
const new_image: Image = switch (image.format) {
.grey_alpha => .{ .pending_grey_alpha = pending },
.rgb => .{ .pending_rgb = pending },
.rgba => .{ .pending_rgba = pending },
.png => unreachable, // should be decoded by now
@@ -1802,8 +1803,10 @@ pub fn drawFrame(self: *OpenGL, surface: *apprt.Surface) !void {
switch (kv.value_ptr.image) {
.ready => {},
.pending_grey_alpha,
.pending_rgb,
.pending_rgba,
.replace_grey_alpha,
.replace_rgb,
.replace_rgba,
=> try kv.value_ptr.image.upload(self.alloc),