pub struct PixelGridConfig {
pub colors: Vec<String>,
pub size: f32,
pub spacing: f32,
pub density: f32,
pub density_ramp: PixelDensityRamp,
pub radius: f32,
pub seed: u32,
pub motion: PixelGridMotion,
}Expand description
Config for the pixel_grid preset: a lattice of square cells.
Covers two looks with one shape. density: 1.0 with two colours gives a
true checkerboard (cells alternate by (row + col) parity); a density
below 1 with one colour gives the sparse tile field the reference piece
uses — squares on a ground, some cells simply absent.
Fields§
§colors: Vec<String>Cell colours. One colour fills every drawn cell; several alternate by
(row + col), which is what makes a checkerboard rather than a field.
size: f32Edge of a cell in px.
spacing: f32Lattice pitch in px — the distance between two cell origins. Clamped to
at least size, so cells never overlap; spacing - size is the gap.
density: f32Fraction of cells drawn, 0..1. Which cells is decided by a hash of the cell’s coordinates, so the pattern is stable from frame to frame — a per-frame random would boil.
density_ramp: PixelDensityRampWhere the field is densest. The reference piece ramps its density across the frame rather than scattering uniformly, which is what stops the texture reading as noise.
radius: f32Corner radius of a cell in px. 0 for hard pixels.
seed: u32Stable pattern selector: two backgrounds with the same seed and geometry are identical, different seeds are different scatters.
motion: PixelGridMotionHow the field moves. speed on the background scales it.
Trait Implementations§
Source§impl Clone for PixelGridConfig
impl Clone for PixelGridConfig
Source§fn clone(&self) -> PixelGridConfig
fn clone(&self) -> PixelGridConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PixelGridConfig
impl Debug for PixelGridConfig
Source§impl<'de> Deserialize<'de> for PixelGridConfig
impl<'de> Deserialize<'de> for PixelGridConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for PixelGridConfig
impl JsonSchema for PixelGridConfig
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for PixelGridConfig
impl RefUnwindSafe for PixelGridConfig
impl Send for PixelGridConfig
impl Sync for PixelGridConfig
impl Unpin for PixelGridConfig
impl UnsafeUnpin for PixelGridConfig
impl UnwindSafe for PixelGridConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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