pub struct RevealSession { /* private fields */ }Expand description
One reveal run, driven by the host step by step (see the module documentation).
Implementations§
Source§impl RevealSession
impl RevealSession
Sourcepub fn new(
width: usize,
height: usize,
noise: f64,
tile_size: usize,
frames: u32,
layers: Vec<RevealLayer>,
canvases: Vec<RevealCanvas>,
) -> Result<RevealSession, RevealError>
pub fn new( width: usize, height: usize, noise: f64, tile_size: usize, frames: u32, layers: Vec<RevealLayer>, canvases: Vec<RevealCanvas>, ) -> Result<RevealSession, RevealError>
A reveal over frames decoded frames of width × height with the source’s decode noise, for the moving
layers and canvases (in the order the host lists them), on tile_size-pixel tiles.
Sourcepub fn estimate(&self) -> f64
pub fn estimate(&self) -> f64
Core memory the stage needs before it starts: every canvas and layer, and the decoded frames it holds.
Sourcepub fn memory(&mut self, fits: bool, core_bytes: f64) -> Result<(), RevealError>
pub fn memory(&mut self, fits: bool, core_bytes: f64) -> Result<(), RevealError>
The answer to Step::NeedMemory: whether the bytes fit, and the core’s current size in bytes (reported in
REVEAL_SKIPPED when they do not).
Sourcepub fn observation(
&mut self,
frame: u32,
decisions: &[ObservedDecision],
) -> Result<(), RevealError>
pub fn observation( &mut self, frame: u32, decisions: &[ObservedDecision], ) -> Result<(), RevealError>
One stored observation/ row (frame and decisions), after Step::NeedObservations. Decisions on a canvas
or layer the stage does not cover are left out, and so is a blind decision whose placement is not a skip.
Sourcepub fn frame_buffer(&mut self) -> Result<&mut [u8], RevealError>
pub fn frame_buffer(&mut self) -> Result<&mut [u8], RevealError>
The buffer the next decoded frame’s RGBA (width × height × 4 bytes) goes into, during Step::Decode and
only for a frame wanted marks. Asking again before RevealSession::push_frame returns the same buffer.
Sourcepub fn push_frame(
&mut self,
index: u32,
labels: Option<&[u8]>,
) -> Result<(), RevealError>
pub fn push_frame( &mut self, index: u32, labels: Option<&[u8]>, ) -> Result<(), RevealError>
Frame index was decoded: the frame written into RevealSession::frame_buffer since the last push, or no
pixels when it was not wanted. labels is the atlas label plane. Step until Step::NextFrame afterwards.
Sourcepub fn end_pass(&mut self, labels: Option<&[u8]>) -> Result<(), RevealError>
pub fn end_pass(&mut self, labels: Option<&[u8]>) -> Result<(), RevealError>
The decode for this pass is over: runs still open vote with the last frame. Step until Step::PassDone.
Auto Trait Implementations§
impl Freeze for RevealSession
impl RefUnwindSafe for RevealSession
impl Send for RevealSession
impl Sync for RevealSession
impl Unpin for RevealSession
impl UnsafeUnpin for RevealSession
impl UnwindSafe for RevealSession
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> 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