← back to roto on ba3a.dev

Package-level declarations

Types

Link copied to clipboard
interface CacheCodec<T : Any>

Stores one kind of stage output in a cache entry folder. write gets an empty folder; read gets a folder an earlier write filled completely, and throws an IOException when its content is not what write leaves, so StageCache can discard the entry and compute it again.

Link copied to clipboard
class CacheException(message: String, cause: Throwable? = null) : IOException

A cache entry whose content is not readable as what its stage wrote.

Link copied to clipboard
class CacheKey

Names one stage output: the stage that produced it and a hash of everything the output depends on — the stage's algorithm version, its parameters and its inputs. The same inputs and parameters always give the same key, on every machine and in every run; change any of them, or bump the version when the algorithm changes, and the key changes, so a stale output is never read back.

Link copied to clipboard

Feeds the inputs and parameters of one stage output into its CacheKey.

Link copied to clipboard
class JsonCacheCodec<T : Any>(serializer: KSerializer<T>) : CacheCodec<T>

A model, as value.json in the same canonical form every Roto JSON file has.

Link copied to clipboard

Label maps — zone or palette indices, one map per frame — stored as opaque gray levels.

Link copied to clipboard

Masks, one per frame, stored as their Mask.toRaster.

Link copied to clipboard
open class RasterBackedSequenceCacheCodec<T : Any>(toRaster: (T) -> Raster, fromRaster: (Raster) -> T) : CacheCodec<List<T>>

A sequence of per-frame values that each convert to and from one Raster, stored through RasterSequenceCacheCodec: masks, label maps.

Link copied to clipboard

One raster, as raster.png.

Link copied to clipboard

A sequence of rasters — a clip's frames, or one mask per frame — as 000000.png, 000001.png, … Frame i is always fileName of i, and the sequence ends at the first number with no file.

Link copied to clipboard
class StageCache(folder: Path)

Stage outputs stored on disk under folder (a profile's cache/), one entry folder per CacheKey at <stage>/<hash>/.

Link copied to clipboard
class StageOutput<T : Any>(val key: CacheKey, produce: () -> T)

One stage's output as the next stage takes it: its key, known up front, and its value, produced on the first get and kept after that.