fast image operations
Diffstat (limited to 'src/dyn/scale.rs')
| -rw-r--r-- | src/dyn/scale.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dyn/scale.rs b/src/dyn/scale.rs new file mode 100644 index 0000000..f827a1f --- /dev/null +++ b/src/dyn/scale.rs @@ -0,0 +1,10 @@ +use crate::scale::traits::ScalingAlgorithm; + +use super::{e, DynImage}; + +impl<T: AsMut<[u8]> + AsRef<[u8]>> DynImage<T> { + /// Scale this image with a given scaling algorithm. + pub fn scale<A: ScalingAlgorithm>(&mut self, width: u32, height: u32) -> DynImage<Box<[u8]>> { + e!(self => |i| i.scale::<A>(width, height)) + } +} |