Struct Spd
#[repr(C)]pub struct Spd {
pub samples: [f32; 41],
}Expand description
Spectral Power Distribution: radiant power at 41 wavelength samples (380–780 nm, 10 nm steps). POD, zero-heap, stack-allocated.
Manual Pod/Zeroable: bytemuck only auto-implements [f32; N] for N ≤ 32.
Fields§
§samples: [f32; 41]Power values at 380, 390, …, 780 nm.
Implementations§
§impl Spd
impl Spd
pub fn from_samples(samples: [f32; 41]) -> Spd
pub fn from_samples(samples: [f32; 41]) -> Spd
Create an SPD from a raw sample array.
pub fn delta(lambda_nm: f32) -> Spd
pub fn delta(lambda_nm: f32) -> Spd
Create a single-wavelength delta SPD: all power at the sample
closest to lambda_nm, zero elsewhere.
pub fn gaussian_peak(lambda_nm: f32, width_nm: f32, amplitude: f32) -> Spd
pub fn gaussian_peak(lambda_nm: f32, width_nm: f32, amplitude: f32) -> Spd
Create a Gaussian-peaked SPD centred at lambda_nm with width width_nm,
scaled by amplitude.
pub fn total_power(&self) -> f32
pub fn total_power(&self) -> f32
Total power (sum of all samples).
Trait Implementations§
impl Copy for Spd
impl Pod for Spd
impl StructuralPartialEq for Spd
Auto Trait Implementations§
impl Freeze for Spd
impl RefUnwindSafe for Spd
impl Send for Spd
impl Sync for Spd
impl Unpin for Spd
impl UnsafeUnpin for Spd
impl UnwindSafe for Spd
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Interleave for Twhere
T: Pod,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreimpl<T> NoUninit for Twhere
T: Pod,
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.