pub trait AmpScaleSpec:
Sized
+ Send
+ Sync {
// Required methods
fn apply_from_power<T: Sample>(power: T) -> T;
fn apply_db_in_place<T: Sample>(
x: &mut [T],
floor_db: f64,
) -> SpectrogramResult<()>;
}Expand description
Marker trait so we can specialise behaviour by AmpScale.
Required Methods§
Sourcefn apply_from_power<T: Sample>(power: T) -> T
fn apply_from_power<T: Sample>(power: T) -> T
Sourcefn apply_db_in_place<T: Sample>(
x: &mut [T],
floor_db: f64,
) -> SpectrogramResult<()>
fn apply_db_in_place<T: Sample>( x: &mut [T], floor_db: f64, ) -> SpectrogramResult<()>
Apply dB conversion in-place on a power-domain vector.
This is a no-op for Power and Magnitude scales.
§Arguments
x: power-domain values to convert to dB in-place.floor_db: dB floor value to apply.
§Returns
SpectrogramResult<()>: Ok on success, error on invalid input.
§Errors
- If
floor_dbis not finite.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".