pub struct PolynomialChannel {
pub kind: ChannelKind,
pub scale_exponent: u8,
pub coefficients: Vec<f64>,
}Expand description
Quantized polynomial coefficients for one channel of a time segment.
Fields§
§kind: ChannelKindChannel kind.
scale_exponent: u8Decimal scale exponent used when quantizing coefficients.
coefficients: Vec<f64>Polynomial coefficients in ascending power order, expressed in native channel units.
Implementations§
Source§impl PolynomialChannel
impl PolynomialChannel
Sourcepub fn new(
kind: ChannelKind,
scale_exponent: u8,
coefficients: Vec<f64>,
) -> Self
pub fn new( kind: ChannelKind, scale_exponent: u8, coefficients: Vec<f64>, ) -> Self
Creates a channel from already-normalized polynomial coefficients.
Sourcepub fn linear(
kind: ChannelKind,
scale_exponent: u8,
start: f64,
end: f64,
) -> Self
pub fn linear( kind: ChannelKind, scale_exponent: u8, start: f64, end: f64, ) -> Self
Creates a linear channel from endpoint values over the normalized interval [0, 1].
Sourcepub fn quadratic(
kind: ChannelKind,
scale_exponent: u8,
start: f64,
midpoint: f64,
end: f64,
midpoint_x: f64,
) -> Self
pub fn quadratic( kind: ChannelKind, scale_exponent: u8, start: f64, midpoint: f64, end: f64, midpoint_x: f64, ) -> Self
Creates a quadratic channel that interpolates start, midpoint, and end values
over the normalized interval [0, 1].
Sourcepub fn validate(&self) -> Result<(), CompressionError>
pub fn validate(&self) -> Result<(), CompressionError>
Validates that the channel coefficients are finite before encoding or lookup.
Trait Implementations§
Source§impl Clone for PolynomialChannel
impl Clone for PolynomialChannel
Source§impl Debug for PolynomialChannel
impl Debug for PolynomialChannel
Source§impl<'de> Deserialize<'de> for PolynomialChannel
impl<'de> Deserialize<'de> for PolynomialChannel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PolynomialChannel
impl PartialEq for PolynomialChannel
Source§impl Serialize for PolynomialChannel
impl Serialize for PolynomialChannel
impl StructuralPartialEq for PolynomialChannel
Auto Trait Implementations§
impl Freeze for PolynomialChannel
impl RefUnwindSafe for PolynomialChannel
impl Send for PolynomialChannel
impl Sync for PolynomialChannel
impl Unpin for PolynomialChannel
impl UnsafeUnpin for PolynomialChannel
impl UnwindSafe for PolynomialChannel
Blanket Implementations§
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