pub struct CalibrationProfile { /* private fields */ }Expand description
Immutable, checked, fixed-storage configuration. Default has no axis
corrections or radial pairs. Configuration is caller-owned and not serialized.
Implementations§
Source§impl CalibrationProfile
impl CalibrationProfile
Sourcepub fn try_new(
axes: &[(usize, AxisCalibration)],
sticks: &[RadialStick],
) -> Result<CalibrationProfile, CalibrationError>
pub fn try_new( axes: &[(usize, AxisCalibration)], sticks: &[RadialStick], ) -> Result<CalibrationProfile, CalibrationError>
Validate the entire bounded description before returning a profile. Duplicate axis corrections and overlapping stick pairs are rejected. An axis correction may also occur in one radial pair (correction first). See the module recipe for construction, selection and reset.
Sourcepub fn axes(&self) -> &[Option<AxisCalibration>; 16]
pub fn axes(&self) -> &[Option<AxisCalibration>; 16]
Inspect every axis correction; None preserves that normalized channel.
Sourcepub fn sticks(&self) -> &[Option<RadialStick>; 8]
pub fn sticks(&self) -> &[Option<RadialStick>; 8]
Inspect pairs in authored order, followed by unused None entries.
Sourcepub fn apply(&self, raw: PadState) -> Result<PadState, CalibrationError>
pub fn apply(&self, raw: PadState) -> Result<PadState, CalibrationError>
Pure transformation; never feeds the journal or mutates the supplied sample. Validate all connected axes/buttons for finiteness before calculating. Finite axis extremes clamp to [-1, 1]; buttons are copied bit-for-bit and retain the existing platform button clamping at submission. f64 arithmetic avoids overflow/underflow for finite f32 samples and narrow valid ranges. Disconnected samples ignore even invalid stale values and return neutral axes/buttons, retaining only the caller’s epoch. No history or learning.
Trait Implementations§
Source§impl Clone for CalibrationProfile
impl Clone for CalibrationProfile
Source§fn clone(&self) -> CalibrationProfile
fn clone(&self) -> CalibrationProfile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more