pub struct IncrementalRenderer {
pub config: RenderConfig,
pub frame_rate: Rational,
/* private fields */
}Expand description
Tracks dirty frame ranges and drives incremental re-renders.
Overlapping or adjacent dirty regions are automatically coalesced on every
mark_dirty call to keep the list compact.
Fields§
§config: RenderConfigRender configuration used when rendering is triggered.
frame_rate: RationalFrame rate of the associated timeline.
Implementations§
Source§impl IncrementalRenderer
impl IncrementalRenderer
Sourcepub fn new(config: RenderConfig, frame_rate: Rational) -> Self
pub fn new(config: RenderConfig, frame_rate: Rational) -> Self
Create a new incremental renderer.
Sourcepub fn mark_dirty(&mut self, start_frame: u64, end_frame: u64)
pub fn mark_dirty(&mut self, start_frame: u64, end_frame: u64)
Mark the range [start_frame, end_frame) as dirty.
The new region is inserted and then the list is coalesced so that it always consists of non-overlapping, sorted regions.
Sourcepub fn mark_all_dirty(&mut self, total_frames: u64)
pub fn mark_all_dirty(&mut self, total_frames: u64)
Mark every frame in [0, total_frames) as dirty.
Sourcepub fn is_dirty(&self, frame: u64) -> bool
pub fn is_dirty(&self, frame: u64) -> bool
Returns true if frame falls inside any dirty region.
Sourcepub fn get_dirty_regions(&self) -> &[DirtyRegion]
pub fn get_dirty_regions(&self) -> &[DirtyRegion]
Returns a slice of the current dirty regions (sorted, non-overlapping).
Sourcepub fn dirty_frame_count(&self) -> u64
pub fn dirty_frame_count(&self) -> u64
Total number of dirty frames across all regions.
Sourcepub fn clear_dirty(&mut self)
pub fn clear_dirty(&mut self)
Clear all dirty regions.
Sourcepub fn render_incremental(
&mut self,
_timeline: &Arc<Timeline>,
) -> EditResult<usize>
pub fn render_incremental( &mut self, _timeline: &Arc<Timeline>, ) -> EditResult<usize>
Returns the number of dirty frames that need rendering, then clears the dirty list (signalling that rendering has been requested).
The caller is expected to iterate get_dirty_regions before calling
this method in order to render the correct frames.
The _timeline parameter is accepted for API consistency and future use.
Auto Trait Implementations§
impl Freeze for IncrementalRenderer
impl RefUnwindSafe for IncrementalRenderer
impl Send for IncrementalRenderer
impl Sync for IncrementalRenderer
impl Unpin for IncrementalRenderer
impl UnsafeUnpin for IncrementalRenderer
impl UnwindSafe for IncrementalRenderer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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