| 1 | #[cfg (feature = "software-scaling" )] |
| 2 | pub mod scaling; |
| 3 | |
| 4 | #[cfg (feature = "software-scaling" )] |
| 5 | #[inline ] |
| 6 | pub fn scaler( |
| 7 | format: ::format::Pixel, |
| 8 | flags: scaling::Flags, |
| 9 | (in_width: u32, in_height: u32): (u32, u32), |
| 10 | (out_width: u32, out_height: u32): (u32, u32), |
| 11 | ) -> Result<scaling::Context, ::Error> { |
| 12 | scaling::Context::get( |
| 13 | format, src_w:in_width, src_h:in_height, format, dst_w:out_width, dst_h:out_height, flags, |
| 14 | ) |
| 15 | } |
| 16 | |
| 17 | #[cfg (feature = "software-scaling" )] |
| 18 | #[inline ] |
| 19 | pub fn converter( |
| 20 | (width: u32, height: u32): (u32, u32), |
| 21 | input: ::format::Pixel, |
| 22 | output: ::format::Pixel, |
| 23 | ) -> Result<scaling::Context, ::Error> { |
| 24 | scaling::Context::get( |
| 25 | src_format:input, |
| 26 | src_w:width, |
| 27 | src_h:height, |
| 28 | dst_format:output, |
| 29 | dst_w:width, |
| 30 | dst_h:height, |
| 31 | flags:scaling::flag::Flags::FAST_BILINEAR, |
| 32 | ) |
| 33 | } |
| 34 | |
| 35 | #[cfg (feature = "software-resampling" )] |
| 36 | pub mod resampling; |
| 37 | |
| 38 | #[cfg (feature = "software-resampling" )] |
| 39 | #[inline ] |
| 40 | pub fn resampler( |
| 41 | (in_format: Sample, in_layout: ChannelLayout, in_rate: u32): (::format::Sample, ::ChannelLayout, u32), |
| 42 | (out_format: Sample, out_layout: ChannelLayout, out_rate: u32): (::format::Sample, ::ChannelLayout, u32), |
| 43 | ) -> Result<resampling::Context, ::Error> { |
| 44 | resampling::Context::get( |
| 45 | src_format:in_format, src_channel_layout:in_layout, src_rate:in_rate, dst_format:out_format, dst_channel_layout:out_layout, dst_rate:out_rate, |
| 46 | ) |
| 47 | } |
| 48 | |