Skip to main content

ModeOpts

Struct ModeOpts 

Source
#[non_exhaustive]
pub struct ModeOpts {
Show 39 fields pub lat_rings: Option<f32>, pub lon_density: Option<f32>, pub rings: Option<f32>, pub r_base: Option<f32>, pub r_depth: Option<f32>, pub r_boost: Option<f32>, pub r_active: Option<f32>, pub ink_far: Option<f32>, pub ink_span: Option<f32>, pub rs_pow: Option<f32>, pub r_min: Option<f32>, pub move_count: Option<f32>, pub scan_mul: Option<f32>, pub dim_base: Option<f32>, pub orbit_n: Option<f32>, pub ghost_n: Option<f32>, pub ghost_r: Option<f32>, pub ghost_a: Option<f32>, pub particles: Option<f32>, pub part_r: Option<f32>, pub part_r_depth: Option<f32>, pub node_n: Option<f32>, pub thr: Option<f32>, pub signals: Option<f32>, pub node_r: Option<f32>, pub node_r_depth: Option<f32>, pub line_w: Option<f32>, pub strand_n: Option<f32>, pub turns: Option<f32>, pub lanes: Option<f32>, pub segs: Option<f32>, pub face_on: Option<f32>, pub spin: Option<f32>, pub band_mul: Option<f32>, pub wob_mul: Option<f32>, pub r_dot: Option<f32>, pub icon_d: Option<f32>, pub spread: Option<f32>, pub r_size_mul: Option<f32>,
}
Expand description

Free-form numeric knobs for mode painters (mirrors upstream ModeOpts).

Power-user / advanced API. The normal path is crate::orbs::Orb / crate::orbs::resolve_preset, which only ever pass hand-tuned finite values.

If you build a ModeOpts yourself and pass it to crate::orbs::engine::draw_mode / crate::orbs::engine::draw_mode_into, every count-like field is clamped by sanitize_mode_opts before geometry runs:

Field familyRange after sanitize
lattice rings / density1…128 / 1…256
orbit_n, ghost_n, particles0…64 / 0…512 / 0…16
node_n, signals0…128 / 0…64
strand_n, lanes, segs0…256 / 1…32 / 1…512
move_count0…64
icon_d0.02…8

Non-finite values fall back to the field default used by the painter. New fields may be added without a major version bump.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§lat_rings: Option<f32>§lon_density: Option<f32>§rings: Option<f32>§r_base: Option<f32>§r_depth: Option<f32>§r_boost: Option<f32>§r_active: Option<f32>§ink_far: Option<f32>§ink_span: Option<f32>§rs_pow: Option<f32>§r_min: Option<f32>§move_count: Option<f32>§scan_mul: Option<f32>§dim_base: Option<f32>§orbit_n: Option<f32>§ghost_n: Option<f32>§ghost_r: Option<f32>§ghost_a: Option<f32>§particles: Option<f32>§part_r: Option<f32>§part_r_depth: Option<f32>§node_n: Option<f32>§thr: Option<f32>§signals: Option<f32>§node_r: Option<f32>§node_r_depth: Option<f32>§line_w: Option<f32>§strand_n: Option<f32>§turns: Option<f32>§lanes: Option<f32>§segs: Option<f32>§face_on: Option<f32>§spin: Option<f32>§band_mul: Option<f32>§wob_mul: Option<f32>§r_dot: Option<f32>§icon_d: Option<f32>§spread: Option<f32>§r_size_mul: Option<f32>

Implementations§

Source§

impl ModeOpts

Source

pub fn fill(mode: ModeKey, f: impl FnOnce(&mut Self)) -> Self

The base profile for mode, then hand the mutable options over for the power-user tweaks a preset cannot express. The struct is #[non_exhaustive], so this is the only way to build one outside the crate.

Trait Implementations§

Source§

impl Clone for ModeOpts

Source§

fn clone(&self) -> ModeOpts

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 ModeOpts

Source§

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

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

impl Default for ModeOpts

Source§

fn default() -> ModeOpts

Returns the “default value” for a type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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 = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more