pub struct Graphics<'t> { /* private fields */ }kitty-graphics only.Expand description
Opaque reference to a Kitty graphics image storage.
Obtained via Terminal::kitty_graphics. The reference is borrowed from
the terminal with lifetime 't and remains valid until the next mutating
terminal call (e.g. Terminal::vt_write or Terminal::reset).
Implementations§
Source§impl<'t> Graphics<'t>
impl<'t> Graphics<'t>
Sourcepub fn image(&self, id: u32) -> Option<Image<'t>>
pub fn image(&self, id: u32) -> Option<Image<'t>>
Look up a Kitty graphics image by its image ID.
Returns None if no image with the given ID exists.
Sourcepub fn generation(&self) -> Result<u64>
pub fn generation(&self) -> Result<u64>
Generation stamp of the last content mutation to this storage.
Content mutations are any image transmit or replace, placement add, or delete. Zero means the storage has never been mutated and is therefore empty.
If the generation is unchanged since a previous query, the set of placements and all image data are identical, so placement iteration and image staleness checks can be skipped entirely. Note that placement geometry may still have changed, since scrolling and resizing move placements without changing the storage contents, so rendering geometry must still be recomputed for frames marked dirty.
Stamps are unique and monotonically increasing process-wide: a value observed from any storage never recurs for different content, even across screen switches or terminal resets. It is therefore safe to key caches on this value alone.