use num_traits::{Float, FloatConst, NumAssign};
use crate::SpectrogramResult;
use crate::fft_backend::{C2cPlan, C2rPlan, C2rPlan2d, R2cPlan, R2cPlan2d};
mod sealed {
pub trait Sealed {}
impl Sealed for f32 {}
impl Sealed for f64 {}
}
pub trait Sample:
sealed::Sealed
+ Float
+ FloatConst
+ NumAssign
+ Copy
+ Send
+ Sync
+ 'static
+ core::fmt::Debug
+ Default
{
type R2cPlan: R2cPlan<Self>;
type C2rPlan: C2rPlan<Self>;
type C2cPlan: C2cPlan<Self>;
type R2cPlan2d: R2cPlan2d<Self>;
type C2rPlan2d: C2rPlan2d<Self>;
fn plan_r2c(n_fft: usize) -> SpectrogramResult<Self::R2cPlan>;
fn plan_c2r(n_fft: usize) -> SpectrogramResult<Self::C2rPlan>;
fn plan_c2c(n_fft: usize) -> SpectrogramResult<Self::C2cPlan>;
fn plan_r2c_2d(nrows: usize, ncols: usize) -> SpectrogramResult<Self::R2cPlan2d>;
fn plan_c2r_2d(nrows: usize, ncols: usize) -> SpectrogramResult<Self::C2rPlan2d>;
fn from_f64(x: f64) -> Self;
fn from_usize(n: usize) -> Self;
}