pub struct ScenePackage {
pub recipe: SceneRecipe,
pub width: u32,
pub height: u32,
pub generator_version: u32,
/* private fields */
}Expand description
A frozen scene: plays without the generator.
Fields§
§recipe: SceneRecipe§width: u32§height: u32§generator_version: u32The generator that made it (for information; playback ignores it).
Implementations§
Source§impl ScenePackage
impl ScenePackage
Sourcepub fn capture(
recipe: &SceneRecipe,
width: u32,
height: u32,
) -> Result<Self, BuildError>
pub fn capture( recipe: &SceneRecipe, width: u32, height: u32, ) -> Result<Self, BuildError>
Builds the scene in every theme it supports and freezes the result.
Sourcepub fn frame(
&self,
theme: Theme,
buddy: bool,
t_ms: u64,
clock: Clock,
) -> Option<(IndexedImage, &IndexedPalette)>
pub fn frame( &self, theme: Theme, buddy: bool, t_ms: u64, clock: Clock, ) -> Option<(IndexedImage, &IndexedPalette)>
One frame, or None if the scene has no such theme.
Sourcepub fn incremental(&self, theme: Theme) -> Option<IncrementalFrame>
pub fn incremental(&self, theme: Theme) -> Option<IncrementalFrame>
A frame to play the scene live, starting from the bare background;
move it with ScenePackage::advance.
Sourcepub fn advance(
&self,
frame: &mut IncrementalFrame,
theme: Theme,
buddy: bool,
t_ms: u64,
clock: Clock,
) -> Option<Vec<PixelRect>>
pub fn advance( &self, frame: &mut IncrementalFrame, theme: Theme, buddy: bool, t_ms: u64, clock: Clock, ) -> Option<Vec<PixelRect>>
Moves a live frame to t_ms and returns the rectangles that changed;
the frame then equals ScenePackage::frame at that time.
Sourcepub fn still(
&self,
theme: Theme,
buddy: bool,
) -> Option<(IndexedImage, &IndexedPalette)>
pub fn still( &self, theme: Theme, buddy: bool, ) -> Option<(IndexedImage, &IndexedPalette)>
The still (hero) frame in a theme.
Sourcepub fn palette(&self, theme: Theme) -> Option<&IndexedPalette>
pub fn palette(&self, theme: Theme) -> Option<&IndexedPalette>
The palette in a theme.
Sourcepub fn graph(&self, theme: Theme) -> Option<&SceneGraph>
pub fn graph(&self, theme: Theme) -> Option<&SceneGraph>
The scene graph in a theme (layout, emitters, loop length).
Sourcepub fn save(&self, dir: &Path) -> Result<(), PackageError>
pub fn save(&self, dir: &Path) -> Result<(), PackageError>
Writes the package into dir (created if needed).
Sourcepub fn load(dir: &Path) -> Result<Self, PackageError>
pub fn load(dir: &Path) -> Result<Self, PackageError>
Reads a package written by this or an older version.
Trait Implementations§
Source§impl Clone for ScenePackage
impl Clone for ScenePackage
Auto Trait Implementations§
impl Forget for ScenePackage
impl Freeze for ScenePackage
impl Move for ScenePackage
impl RefUnwindSafe for ScenePackage
impl Send for ScenePackage
impl Sync for ScenePackage
impl Unpin for ScenePackage
impl UnsafeUnpin for ScenePackage
impl UnwindSafe for ScenePackage
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
Mutably borrows from an owned value. Read more