Skip to main content

MilkElement

Struct MilkElement 

Source
pub struct MilkElement {
    pub init: EelProgram,
    pub per_frame: EelProgram,
    pub per_point: EelProgram,
    pub count: u32,
    pub instances: u32,
    pub kind: ElementKind,
    pub use_dots: bool,
    pub thick: bool,
    pub additive: bool,
}
Expand description

One custom wave or shape: its three programs and the structural numbers that size its geometry.

The look numbers — position, colour, radius, alpha — are not here: they are outputs the element’s own per-frame program leaves in named registers, seeded from the file’s initial conditions by a prologue the converter emits. That is the same shape the main bundle takes, and it is what keeps this struct from being forty fields of .milk key.

Fields§

§init: EelProgram

Run once, at preset load.

§per_frame: EelProgram

Run once per frame — and once per instance for a shape, with instance bound.

§per_point: EelProgram

Run once per point. Empty for a shape.

§count: u32

Points (a wave) or sides (a shape).

§instances: u32

How many copies a shape draws. Always 1 for a wave.

§kind: ElementKind

Which it is.

§use_dots: bool

Past 0.5, a wave draws dots rather than a line.

§thick: bool

Past 0.5, a wave’s line or a shape’s outline is drawn thick.

§additive: bool

Past 0.5, a wave adds rather than blends. See ElementSpec::additive for why a shape’s flag is not here.

Trait Implementations§

Source§

impl Clone for MilkElement

Source§

fn clone(&self) -> MilkElement

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 Debug for MilkElement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MilkElement

Source§

fn eq(&self, other: &MilkElement) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MilkElement

Auto Trait Implementations§

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> 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.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,