← back to roto on ba3a.dev

Trim

class Trim(info: VideoInfo)

The rules of trimming one video, whatever draws the handles: they land on frame starts, the range never leaves the video, and it always holds at least one frame, so the start cannot pass the end.

Constructors

Link copied to clipboard
constructor(info: VideoInfo)

Properties

Link copied to clipboard

The whole video, where a new clip's handles start.

Functions

Link copied to clipboard
fun frameCount(range: TimeRange): Int

How many frames range holds at the video's frame rate.

Link copied to clipboard
fun lastFrame(range: TimeRange): Long

When the last frame of range starts: the range's end is exclusive, so not at the end itself.

Link copied to clipboard
fun snap(ms: Long): Long

The frame start nearest ms, inside the video.

Link copied to clipboard
fun withEnd(range: TimeRange, ms: Long): TimeRange

range with its end moved as near ms as these rules allow.

Link copied to clipboard
fun withStart(range: TimeRange, ms: Long): TimeRange

range with its start moved as near ms as these rules allow.