← back to roto on ba3a.dev

Retime

@Serializable
data class Retime(val speedPercent: Int = FULL_SPEED, val keep: List<Int>? = null)

How a clip's finished art is published: faster or slower, and with only some of its frames. Stored per clip in profile.json; the handoff itself is never changed.

keep is checked in two places, because the frame count lives in the handoff: here and in the clip, only that no index is negative; apply checks the upper bound against the real frames and fails with a PublishException naming the clip and the index.

Constructors

Link copied to clipboard
constructor(speedPercent: Int = FULL_SPEED, keep: List<Int>? = null)

Properties

Link copied to clipboard
val keep: List<Int>?

the handoff frame indexes to publish, in order, repeats allowed; null for every frame

Link copied to clipboard

The first negative index of keep, or null when there is none.

Link copied to clipboard

playback speed from 25 to 400; 100 leaves durations as painted

Functions

Link copied to clipboard
fun apply(frames: List<ArtFrame>, clip: String): List<ArtFrame>

frames, the art of clip, picked by keep and with durations scaled by the speed.

Link copied to clipboard
fun duration(durationMs: Int): Int

The published duration of a frame painted for durationMs: scaled by the speed, half up, at least 1 ms.

Link copied to clipboard
fun durations(paintedMs: List<Int>, clip: String): List<Int>

The published durations of clip, whose handoff frames last paintedMs: picked and scaled as apply does.