pub struct Image<'t> { /* private fields */ }kitty-graphics only.Expand description
Opaque reference to a Kitty graphics image.
Obtained via Graphics::image with an image ID. The reference is
borrowed from the storage with lifetime 't and remains valid until
the next mutating terminal call.
Implementations§
Source§impl<'t> Image<'t>
impl<'t> Image<'t>
Sourcepub fn generation(&self) -> Result<u64>
pub fn generation(&self) -> Result<u64>
Generation stamp assigned when this image was added to or replaced in the storage.
A changed generation for a given image ID means the pixel contents may have changed even when the dimensions, format, and data length are identical, for example a retransmission of the same image ID, so texture caches must key staleness on this value rather than on size heuristics.
Stamps are unique and monotonically increasing process-wide and are drawn
from the same sequence as Graphics::generation. Never zero for a
stored image, so zero can be used as an empty sentinel by callers.
Sourcepub fn format(&self) -> Result<ImageFormat>
pub fn format(&self) -> Result<ImageFormat>
Pixel format of the image.
Sourcepub fn compression(&self) -> Result<Compression>
pub fn compression(&self) -> Result<Compression>
Compression of the image.