Go bindings for libghostty-vt. pkg.go.dev/go.mitchellh.com/libghostty
ghostty

sys: add decode PNG callback binding and built-in implementation master

Bind the GHOSTTY_SYS_OPT_DECODE_PNG option from ghostty_sys_set(), which lets embedders supply a PNG-to-RGBA decoder for Kitty Graphics Protocol support. SysSetDecodePng installs or clears a Go callback. The C trampoline allocates the output pixel buffer through the library allocator via ghostty_alloc so the library can own and free it. The Go callback returns a SysImage struct; pixel data is copied into the library-owned buffer before returning to C. A ready-to-use SysDecodePng function is provided in sys_builtin.go that uses Go standard library image/png. It returns NRGBA pixels directly when the decoded image is already in that format and falls back to a per-pixel conversion for other image types.


Author Mitchell Hashimoto Date Commit c635574c Parent ab4e17b7 Change ID qyzqlqks