EffectResolver

fun interface EffectResolver(source)

Realizes an EffectSpec as something the current platform can render.

Return null to decline a spec and the next resolver is asked. Return EffectResolution.Unsupported to claim a spec and refuse it, which ends the chain so a later resolver cannot substitute a different rendering.

Registered on dev.jordond.filmstrip.FilmstripBuilder through dev.jordond.filmstrip.FilmstripBuilder.addEffectResolver and asked newest registration first: the first resolver to return a non-null result wins. Export engines are the same shape, registered through dev.jordond.filmstrip.FilmstripBuilder.addExportEngineFactory. A third-party render backend is written the same way filmstrip's own are: an extension function on FilmstripBuilder that registers a resolver, an export engine factory, or both. The four built-in export engines are ordinary instances of that pattern, so registering one after them makes it win.

Implementations are called once per pipeline and must return a fresh platform object each time. Share the spec, not the platform object it resolves to.

Functions

Link copied to clipboard
open suspend fun prepare(composition: EditComposition)

Gets ready to resolve the effects in composition, before any of them is asked for.

Link copied to clipboard
abstract fun resolve(spec: EffectSpec, capabilities: RenderCapabilities, attributes: Attributes): EffectResolution?

Realises spec, or declines it.