1 | use ffi::SwrFilterType::*; |
2 | use ffi::*; |
3 | |
4 | #[derive (Eq, PartialEq, Copy, Clone, Debug)] |
5 | pub enum Filter { |
6 | Cubic, |
7 | BlackmanNuttall, |
8 | Kaiser, |
9 | } |
10 | |
11 | impl 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 | |
21 | impl 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 | } |
30 | |