Skip to main content

RevealSession

Struct RevealSession 

Source
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

Source

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.

Source

pub fn estimate(&self) -> f64

Core memory the stage needs before it starts: every canvas and layer, and the decoded frames it holds.

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn step( &mut self, cache: &mut TileCache, now: f64, ) -> Result<Step, RevealError>

Runs the stage until it needs something from the host. now is the host’s clock, stamped on every tile this step writes.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.