pub struct StarfieldGenerator {
pub stars: Vec<Star>,
}Expand description
A procedural generator for rendering cosmic starfields and bokeh onto image backgrounds.
Fields§
§stars: Vec<Star>The collection of active star elements.
Implementations§
Source§impl StarfieldGenerator
impl StarfieldGenerator
Sourcepub fn random(monitor: &Monitor) -> WallSwitchResult<Self>
pub fn random(monitor: &Monitor) -> WallSwitchResult<Self>
Generates a randomized field of stars based on the monitor’s physical dimensions.
Reuses new internally to construct the star positions and color properties.
§Errors
Returns WallSwitchError::EmptySlice
if the global neon palette table is empty.
Sourcepub fn new(count: usize, width: u64, height: u64) -> WallSwitchResult<Self>
pub fn new(count: usize, width: u64, height: u64) -> WallSwitchResult<Self>
Generates a randomized field of stars using the centralized high-contrast neon colors.
§Errors
Returns WallSwitchError::EmptySlice
if the global neon palette table is empty.
Trait Implementations§
Source§impl ImageEffect for StarfieldGenerator
impl ImageEffect for StarfieldGenerator
Auto Trait Implementations§
impl Freeze for StarfieldGenerator
impl RefUnwindSafe for StarfieldGenerator
impl Send for StarfieldGenerator
impl Sync for StarfieldGenerator
impl Unpin for StarfieldGenerator
impl UnsafeUnpin for StarfieldGenerator
impl UnwindSafe for StarfieldGenerator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more