Linocut.Cache (Linocut v0.1.3)

Copy Markdown View Source

Rasters rendered once and kept on disk, under $XDG_CACHE_HOME/linocut or ~/.cache/linocut.

headings = Linocut.Cache.fetch("ship/headings", "2", fn -> Linocut.headings(points, 64, size: {16, 16}, fill: :white) end)

key may contain slashes; fingerprint is any string that changes when the render should. The render function may return one raster or a list of them; either comes back the same shape, with dense pixel buffers.

Summary

Functions

The stored rasters for key and fingerprint, rendering and storing them when absent.

Where key at fingerprint is stored.

Functions

fetch(key, fingerprint, render)

The stored rasters for key and fingerprint, rendering and storing them when absent.

path(key, fingerprint)

@spec path(String.t(), String.t()) :: Path.t()

Where key at fingerprint is stored.