← back to roto on ba3a.dev

KeyFrames

class KeyFrames(val boundaries: List<Int>)

A clip's key frames as boundaries: frame indices in rising order, each but the last a key frame that lasts until the next. For a looping clip the last boundary is where the cycle starts over — the frame showing the first key frame's pose again, not drawn itself — so moving it changes the length of the loop. Marker spacing is frame duration, nothing else.

Constructors

Link copied to clipboard
constructor(boundaries: List<Int>)

Types

Link copied to clipboard
object Companion

Even proposals.

Properties

Link copied to clipboard

frame indices in rising order; at least two

Link copied to clipboard

Whether a boundary can go: at least one key frame must stay.

Link copied to clipboard

The frames drawn: every boundary but the last.

Functions

Link copied to clipboard
fun added(frame: Int, frameCount: Int): KeyFrames

These key frames with a boundary at frame too; one already there changes nothing.

Link copied to clipboard
fun durationsMs(frameRate: FrameRate): List<Long>

How long each key frame shows, in whole milliseconds at frameRate; exact, without drift.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Equal when the boundaries are.

Link copied to clipboard
open override fun hashCode(): Int

Consistent with equals.

Link copied to clipboard
fun keyFrameAt(frame: Int): Int?

Which key frame is showing at frame, or null outside them all.

Link copied to clipboard
fun moved(index: Int, frame: Int, frameCount: Int): KeyFrames

These key frames with boundary index moved as near frame as the rules allow: it stays between its neighbours, and inside a clip of frameCount frames. The last boundary may reach frameCount itself, since it is where the last key frame ends, not a frame drawn.

Link copied to clipboard
fun removed(index: Int): KeyFrames

These key frames without boundary index: the key frame before it lasts until the next one.

Link copied to clipboard
open override fun toString(): String

The boundaries, for messages and tests.