ffmpeg_next/software/resampling/
filter.rs

1use ffi::SwrFilterType::*;
2use ffi::*;
3
4#[derive(Eq, PartialEq, Copy, Clone, Debug)]
5pub enum Filter {
6    Cubic,
7    BlackmanNuttall,
8    Kaiser,
9}
10
11impl From<SwrFilterType> for Filter {
12    fn from(value: SwrFilterType) -> Filter {
13        match value {
14            SWR_FILTER_TYPE_CUBIC => Filter::Cubic,
15            SWR_FILTER_TYPE_BLACKMAN_NUTTALL => Filter::BlackmanNuttall,
16            SWR_FILTER_TYPE_KAISER => Filter::Kaiser,
17        }
18    }
19}
20
21impl From<Filter> for SwrFilterType {
22    fn from(value: Filter) -> SwrFilterType {
23        match value {
24            Filter::Cubic => SWR_FILTER_TYPE_CUBIC,
25            Filter::BlackmanNuttall => SWR_FILTER_TYPE_BLACKMAN_NUTTALL,
26            Filter::Kaiser => SWR_FILTER_TYPE_KAISER,
27        }
28    }
29}