pub struct Mark {
pub name: &'static str,
pub shape: Shape,
pub specks: Specks,
pub fill: f32,
pub lattice: (usize, usize),
pub seed: u32,
}Expand description
One mark: a shape, the lattice it is annealed on, and the seed.
Fields§
§name: &'static strAppears in the manifest and in test failures; kebab-case.
shape: ShapeWhat the field aims at.
specks: SpecksThe three pinned specks, or Specks::None.
fill: f32How much of the lattice the mark fills, as a fraction of the
binding axis — its diameter, for a Shape::Disc. Lower for
round marks, which have to clear a circle.
lattice: (usize, usize)Lattice size in sites. This is the grain of the noise: an icon painted a block a site reads as the same material as the landing page, whatever the tile it ends up in, because the blocks are the page’s own — bigger on screen, never resampled.
seed: u32The RNG seed: which run of the anneal this is. Always one of the
twelve anneal.rs’s crystallisation property test measures, so
the run behind a shipped image is one the test suite has actually
seen — and, for everything but the wordmark, the one of those
twelve that came out cleanest, since a seed is a free choice and
there is no reason to ship a worse frame than the schedule can
give. WORDMARK keeps the landing page’s own seed instead
(site/src/config/anim.ts), because a logo that is not the frame
the page ends on would be a different picture wearing the same
name; BANNER cannot be that frame anyway — its lattice is a
different shape — so it is free to take the cleanest run too.
Implementations§
Source§impl Mark
impl Mark
Sourcepub fn mask(&self) -> Vec<bool>
pub fn mask(&self) -> Vec<bool>
The shape the field pulls towards, as a bitmap on this mark’s lattice, specks included.
Sourcefn disc(&self, fill: f32) -> Vec<bool>
fn disc(&self, fill: f32) -> Vec<bool>
A disc of fill of the tile, centred — the ground a Shape::Disc
is and a Shape::Knockout cuts into.
Sourcepub fn speck_sites(&self) -> Vec<(usize, usize)>
pub fn speck_sites(&self) -> Vec<(usize, usize)>
The sites this mark pins up-spin: its specks’ centres, and nothing
else. Empty for Specks::None.
Sourcepub fn crystallise(&self) -> Lattice
pub fn crystallise(&self) -> Lattice
Runs the shipped anneal to its end and returns the lattice it
froze into: true where the spin is up (lit).
This is the snap. It is the same schedule
([AnnealSchedule::default]), the same sweep count
([DEFAULT_TOTAL_SWEEPS]) and the same dynamics the landing page
scrolls through, stopped at the end of the schedule — so a brand
image is the last frame of the page’s own animation rather than a
drawing of one.