Sign in

    crater-terminal-image-cache

    Terminal image cache entry format and raster normalization helpers for crater

    Download zip
    Author
    Version
    0.19.0
    License
    Apache-2.0
    Last updated
    3 months ago
    Downloads
    58

    No dependencies

    mizchi/crater-terminal-image-cache does not have a README file

    ImageCache

    pub struct ImageCache {
    data : Map[String, String]
    order : Array[String]
    total_bytes : Int
    max_bytes : Int
    }

    ImageCache::contains

    fn ImageCache::contains(self : ImageCache, src : String) -> Bool

    ImageCache::get

    fn ImageCache::get(self : ImageCache, src : String) -> String?

    ImageCache::is_empty

    fn ImageCache::is_empty(self : ImageCache) -> Bool

    ImageCache::max_bytes

    fn ImageCache::max_bytes(self : ImageCache) -> Int

    ImageCache::new

    fn ImageCache::new(max_bytes? : Int) -> ImageCache

    ImageCache::put

    fn ImageCache::put(self : ImageCache, src : String, data : String) -> Unit

    ImageCache::set_max_bytes

    fn ImageCache::set_max_bytes(self : ImageCache, max_bytes : Int) -> Unit

    ImageCache::total_bytes

    fn ImageCache::total_bytes(self : ImageCache) -> Int

    RgbaCacheEntry

    pub(all) struct RgbaCacheEntry {
    width : Int
    height : Int
    rgba_base64 : String
    }

    RgbaCacheEntry::decode_rgba_bytes

    fn RgbaCacheEntry::decode_rgba_bytes(self : RgbaCacheEntry) -> Array[Int]?

    RgbaCacheEntry::encode

    fn RgbaCacheEntry::encode(self : RgbaCacheEntry) -> String

    TerminalImageCacheEntry

    pub(all) enum TerminalImageCacheEntry {
    Svg(String)
    PngBase64(String)
    RgbaBase64(RgbaCacheEntry)
    RawBase64(String)
    }

    TerminalImageCacheEntry::encode

    data_image_src_to_kitty_cache

    fn data_image_src_to_kitty_cache(src : String) -> String?

    decode_raster_image_to_rgba_cache_entry

    fn decode_raster_image_to_rgba_cache_entry(image_format : String, b64_data : String) -> RgbaCacheEntry?

    detect_raster_image_format_from_base64

    fn detect_raster_image_format_from_base64(b64_data : String) -> String

    normalize_raster_image_for_kitty

    fn normalize_raster_image_for_kitty(b64_data : String) -> String

    parse_terminal_image_cache_entry

    fn parse_terminal_image_cache_entry(cached_data : String) -> TerminalImageCacheEntry?

    prepare_raster_image_for_kitty_cache

    fn prepare_raster_image_for_kitty_cache(b64_data : String) -> String

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io