Skip to main content

Mark

Struct Mark 

Source
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 str

Appears in the manifest and in test failures; kebab-case.

§shape: Shape

What the field aims at.

§specks: Specks

The three pinned specks, or Specks::None.

§fill: f32

How 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: u32

The 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

Source

pub fn mask(&self) -> Vec<bool>

The shape the field pulls towards, as a bitmap on this mark’s lattice, specks included.

Source

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.

Source

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.

Source

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.

Source

pub fn agreement(&self) -> f32

The fraction of sites that came out agreeing with the mask — the same measure anneal.rs’s crystallisation property test applies to the landing page, applied here to a mark that is not the wordmark and a lattice that is not 220x160.

Trait Implementations§

Source§

impl Clone for Mark

Source§

fn clone(&self) -> Mark

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Mark

Auto Trait Implementations§

§

impl Freeze for Mark

§

impl RefUnwindSafe for Mark

§

impl Send for Mark

§

impl Sync for Mark

§

impl Unpin for Mark

§

impl UnsafeUnpin for Mark

§

impl UnwindSafe for Mark

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.