pub struct WasmDemoConfig {
pub width: u32,
pub height: u32,
pub fill_probability: f32,
pub target_coverage: f32,
pub seed: u64,
pub palette: DemoPalette,
}Expand description
Configuration for the WASM pixel demo
Fields§
§width: u32Screen width in pixels (default: 1920)
height: u32Screen height in pixels (default: 1080)
fill_probability: f32Probability of filling a pixel per frame (default: 0.01)
target_coverage: f32Target coverage percentage (default: 0.99)
seed: u64RNG seed for determinism
palette: DemoPaletteColor palette for rendering
Implementations§
Source§impl WasmDemoConfig
impl WasmDemoConfig
Sourcepub fn test_small() -> Self
pub fn test_small() -> Self
Create small test configuration
Sourcepub fn with_fill_probability(self, prob: f32) -> Self
pub fn with_fill_probability(self, prob: f32) -> Self
Set fill probability
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate configuration
Trait Implementations§
Source§impl Clone for WasmDemoConfig
impl Clone for WasmDemoConfig
Source§fn clone(&self) -> WasmDemoConfig
fn clone(&self) -> WasmDemoConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WasmDemoConfig
impl Debug for WasmDemoConfig
Auto Trait Implementations§
impl Freeze for WasmDemoConfig
impl RefUnwindSafe for WasmDemoConfig
impl Send for WasmDemoConfig
impl Sync for WasmDemoConfig
impl Unpin for WasmDemoConfig
impl UnsafeUnpin for WasmDemoConfig
impl UnwindSafe for WasmDemoConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().