Skip to main content

Module tc_compare

Module tc_compare 

Source
Expand description

Timecode comparison and distance utilities.

Provides utilities for comparing timecodes, computing distances, sorting, and checking various temporal relationships between timecodes.

Structs§

TcSpan
A timecode span defined by an in-point and an out-point.

Enums§

TcRelation
The result of comparing two timecodes.

Functions§

compare
Compares two timecodes by total frame count.
distance_frames
Returns the absolute distance in frames between two timecodes.
distance_seconds
Returns the distance between two timecodes in seconds (approximate for non-integer rates).
earliest
Returns the earliest timecode from a non-empty slice.
is_ascending
Checks if a sequence of timecodes is strictly ascending (no duplicates).
is_contiguous
Checks if a sequence of timecodes is contiguous (each consecutive pair differs by exactly 1 frame).
is_within_range
Checks whether timecode tc falls within the range [start, end] (inclusive).
latest
Returns the latest timecode from a non-empty slice.
midpoint
Returns the midpoint timecode between two timecodes.
sort_timecodes
Sorts a slice of timecodes by frame count (ascending).