kitty graphics support
This commit is contained in:
25
README.md
25
README.md
@@ -145,6 +145,31 @@ try (Terminal terminal = Ghostty.open(TerminalOptions.of(80, 24))) {
|
||||
}
|
||||
```
|
||||
|
||||
## Kitty Graphics
|
||||
|
||||
Kitty graphics storage can be enabled and inspected:
|
||||
|
||||
```java
|
||||
try (Terminal terminal = Ghostty.open(TerminalOptions.of(80, 24))) {
|
||||
terminal.setKittyImageStorageLimit(64 * 1024 * 1024);
|
||||
terminal.setKittyImageMediumFile(true);
|
||||
terminal.setKittyImageMediumTemporaryFile(true);
|
||||
terminal.setKittyImageMediumSharedMemory(true);
|
||||
|
||||
terminal.write(kittyGraphicsSequenceBytes);
|
||||
|
||||
for (KittyPlacement placement : terminal.kittyGraphics().orElseThrow().placements()) {
|
||||
placement.image().ifPresent(image -> {
|
||||
// Hand image.data() and placement.renderInfo() to your renderer.
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The Kitty handles returned by `libghostty-vt` are borrowed from the terminal and are invalidated by mutating terminal calls. The Java API returns snapshots for images and placements to make renderer handoff simpler.
|
||||
|
||||
PNG decode callbacks from `ghostty_sys_set(GHOSTTY_SYS_OPT_DECODE_PNG, ...)` are not exposed yet. Raw Kitty image formats can be inspected; PNG image ingestion will need a Java callback bridge or a small native helper that allocates decoded RGBA data through Ghostty's allocator.
|
||||
|
||||
## Development Shell
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user