pub struct PatternLayout<'a> {
pub kind: &'a str,
pub bounds_w: f64,
pub bounds_h: f64,
pub spacing: Option<f64>,
pub count: Option<i64>,
pub seed: i64,
pub jitter: f64,
}Expand description
Parameters for a single pattern layout computation.
All fields carry their already-resolved values. The caller is responsible
for applying defaults (seed → 0, jitter → 0.0) before constructing
this struct.
Fields§
§kind: &'a strLayout kind: "grid" or "scatter". Any other value yields an empty
result (validation has already flagged it).
bounds_w: f64Width of the bounds box in px.
bounds_h: f64Height of the bounds box in px.
spacing: Option<f64>Cell spacing in px (grid only). Required to be > 0; ignored for
scatter.
count: Option<i64>Number of scatter instances (scatter only). Required to be > 0;
ignored for grid.
seed: i64Seed passed to the bit-mixing hash for both jitter and scatter.
jitter: f64Fraction of spacing applied as positional noise (grid only). 0.0
disables jitter entirely.
Trait Implementations§
Source§impl<'a> Clone for PatternLayout<'a>
impl<'a> Clone for PatternLayout<'a>
Source§fn clone(&self) -> PatternLayout<'a>
fn clone(&self) -> PatternLayout<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for PatternLayout<'a>
Auto Trait Implementations§
impl<'a> Freeze for PatternLayout<'a>
impl<'a> RefUnwindSafe for PatternLayout<'a>
impl<'a> Send for PatternLayout<'a>
impl<'a> Sync for PatternLayout<'a>
impl<'a> Unpin for PatternLayout<'a>
impl<'a> UnsafeUnpin for PatternLayout<'a>
impl<'a> UnwindSafe for PatternLayout<'a>
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