mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-24 08:01:45 +00:00
terminal/c: image data returns the current animation frame
This commit is contained in:
@@ -399,6 +399,12 @@ typedef enum GHOSTTY_ENUM_TYPED {
|
||||
* time, before the image is stored. Consumers can upload this
|
||||
* directly to the GPU without any decode step.
|
||||
*
|
||||
* For an animated image (Kitty graphics animation, actions a=f/a=a)
|
||||
* this is the pixel data of the current animation frame. The
|
||||
* image's GHOSTTY_KITTY_IMAGE_DATA_GENERATION changes whenever the
|
||||
* current frame changes, so generation-keyed caches remain
|
||||
* coherent.
|
||||
*
|
||||
* Output type: const uint8_t **
|
||||
*/
|
||||
GHOSTTY_KITTY_IMAGE_DATA_DATA_PTR = 7,
|
||||
|
||||
@@ -262,8 +262,11 @@ fn imageGetTyped(
|
||||
.height => out.* = image.height,
|
||||
.format => out.* = image.format,
|
||||
.compression => out.* = image.compression,
|
||||
.data_ptr => out.* = (image.data.bytes() orelse return .no_value).ptr,
|
||||
.data_len => out.* = image.data.len(),
|
||||
// For animated images this is the current animation frame's
|
||||
// data; the image generation changes whenever the current
|
||||
// frame does, so generation-keyed caches stay coherent.
|
||||
.data_ptr => out.* = (image.renderData().bytes() orelse return .no_value).ptr,
|
||||
.data_len => out.* = image.renderData().len(),
|
||||
.generation => out.* = image.generation,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user