pub struct StreamingClip { /* private fields */ }Expand description
A seekable, O(1-frame)-memory cursor over a VoxelClip’s I/P
stream — the streaming alternative to DecodedClip, which
materialises every frame (and which the GPU/CPU flipbook then holds N
volumes for). For a huge clip this keeps one reconstructed frame plus
the compact encoded stream instead of N full frames.
Seeking to a frame replays deltas from the nearest preceding keyframe;
stepping forward from the current frame is incremental. Drive it from
frame_at like the flipbook, then rebuild a single sprite model from
current_frame (+ current_dirs
for the GPU) each time the frame changes — e.g. via
roxlap_core::SpriteDense::from_voxel_frame or
SceneRenderer::refresh_sprite_model.
Implementations§
Source§impl StreamingClip
impl StreamingClip
Sourcepub fn new(clip: &VoxelClip) -> Result<StreamingClip, DecodeError>
pub fn new(clip: &VoxelClip) -> Result<StreamingClip, DecodeError>
Build a streaming cursor over clip and reconstruct frame 0.
§Errors
DecodeError::DeltaBeforeKey if the stream is empty or doesn’t
start with a keyframe; otherwise the same per-frame errors as
VoxelClip::decode (surfaced lazily while seeking).
pub fn frame_count(&self) -> usize
pub fn dims(&self) -> [u32; 3]
pub fn pivot(&self) -> [f32; 3]
pub fn voxel_world_size(&self) -> f32
pub fn loop_mode(&self) -> LoopMode
pub fn durations(&self) -> &[u32]
Sourcepub fn current_index(&self) -> usize
pub fn current_index(&self) -> usize
Frame index currently reconstructed.
Sourcepub fn current_frame(&self) -> &VoxelFrame
pub fn current_frame(&self) -> &VoxelFrame
The currently-reconstructed frame.
Sourcepub fn current_dirs(&self) -> &[u32]
pub fn current_dirs(&self) -> &[u32]
Per-voxel dir LUT indices for the current frame, parallel to
current_frame().colors (for GPU sprite-model upload).
Sourcepub fn seek(&mut self, frame: usize) -> Result<&VoxelFrame, DecodeError>
pub fn seek(&mut self, frame: usize) -> Result<&VoxelFrame, DecodeError>
Seek to frame (clamped to the last frame) and return the
reconstructed VoxelFrame. Forward seeks step incrementally;
backward / random seeks replay from the nearest preceding keyframe.
§Errors
Per-frame DecodeErrors from a malformed stream (out-of-range
delta column, invalid reconstructed frame).
Trait Implementations§
Source§impl Clone for StreamingClip
impl Clone for StreamingClip
Source§fn clone(&self) -> StreamingClip
fn clone(&self) -> StreamingClip
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for StreamingClip
impl RefUnwindSafe for StreamingClip
impl Send for StreamingClip
impl Sync for StreamingClip
impl Unpin for StreamingClip
impl UnsafeUnpin for StreamingClip
impl UnwindSafe for StreamingClip
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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