pub struct SegmentSelector<'a> { /* private fields */ }Expand description
A selector over a subset of segments, supporting filtering and operations.
Created via methods on Analysis like pauses(), motion(), etc.
Filters can be chained, and terminal operations produce SegmentOps.
Implementations§
Source§impl<'a> SegmentSelector<'a>
impl<'a> SegmentSelector<'a>
Sourcepub fn total_duration_ms(&self) -> u64
pub fn total_duration_ms(&self) -> u64
Get total duration of selected segments in milliseconds.
Sourcepub fn total_frames(&self) -> usize
pub fn total_frames(&self) -> usize
Get total frame count of selected segments.
Sourcepub fn longer_than(self, ms: u32) -> Self
pub fn longer_than(self, ms: u32) -> Self
Filter to segments longer than the specified duration.
Sourcepub fn shorter_than(self, ms: u32) -> Self
pub fn shorter_than(self, ms: u32) -> Self
Filter to segments shorter than the specified duration.
Sourcepub fn duration_between(self, min_ms: u32, max_ms: u32) -> Self
pub fn duration_between(self, min_ms: u32, max_ms: u32) -> Self
Filter to segments with duration in the specified range (inclusive).
Sourcepub fn cap(&self, max_ms: u32) -> SegmentOps
pub fn cap(&self, max_ms: u32) -> SegmentOps
Cap duration to a maximum value.
Segments longer than max_ms are collapsed to a single frame
with that duration. Shorter segments are unchanged.
Sourcepub fn collapse(&self, duration_ms: u32) -> SegmentOps
pub fn collapse(&self, duration_ms: u32) -> SegmentOps
Collapse each segment to a single frame with the specified duration.
Sourcepub fn remove(&self) -> SegmentOps
pub fn remove(&self) -> SegmentOps
Remove all selected segments entirely.
Sourcepub fn speed_up(&self, factor: f64) -> SegmentOps
pub fn speed_up(&self, factor: f64) -> SegmentOps
Speed up selected segments by a factor.
A factor of 2.0 makes segments play 2x faster (half duration).
Sourcepub fn slow_down(&self, factor: f64) -> SegmentOps
pub fn slow_down(&self, factor: f64) -> SegmentOps
Slow down selected segments by a factor.
A factor of 2.0 makes segments play 2x slower (double duration).
Sourcepub fn set_duration(&self, ms: u32) -> SegmentOps
pub fn set_duration(&self, ms: u32) -> SegmentOps
Set the total duration for each selected segment.
The duration is distributed evenly across all frames in the segment.
Sourcepub fn set_frame_delay(&self, ms: u32) -> SegmentOps
pub fn set_frame_delay(&self, ms: u32) -> SegmentOps
Set a fixed delay for each frame in the selected segments.
Sourcepub fn keep(&self) -> SegmentOps
pub fn keep(&self) -> SegmentOps
Explicitly keep selected segments unchanged.
This is useful when merging with other operations to ensure certain segments are not modified.
Sourcepub fn scale(&self, factor: f64) -> SegmentOps
pub fn scale(&self, factor: f64) -> SegmentOps
Scale timing by a raw factor.
Factor < 1.0 speeds up, factor > 1.0 slows down.
Trait Implementations§
Source§impl<'a> Clone for SegmentSelector<'a>
impl<'a> Clone for SegmentSelector<'a>
Source§fn clone(&self) -> SegmentSelector<'a>
fn clone(&self) -> SegmentSelector<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for SegmentSelector<'a>
impl<'a> RefUnwindSafe for SegmentSelector<'a>
impl<'a> Send for SegmentSelector<'a>
impl<'a> Sync for SegmentSelector<'a>
impl<'a> Unpin for SegmentSelector<'a>
impl<'a> UnsafeUnpin for SegmentSelector<'a>
impl<'a> UnwindSafe for SegmentSelector<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more