We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18c43f6 commit 5c6f9cbCopy full SHA for 5c6f9cb
src/transform/mod.rs
@@ -18,8 +18,11 @@ pub trait TransformExt
18
where
19
Self: Sized,
20
{
21
+ /// Output type for the operation
22
type Output;
23
24
+ /// Transforms an image given the transformation matrix and output size.
25
+ /// Assume nearest-neighbour interpolation
26
fn transform(
27
&self,
28
transform: ArrayView2<f64>,
@@ -200,4 +203,14 @@ mod tests {
200
203
201
204
assert_eq!(upside_down_sideways, src_sideways);
202
205
}
206
+
207
+ #[test]
208
+ fn scale() {
209
+ let src = Image::<u8, Gray>::from_shape_data(4, 4, (0..16).collect());
210
+ let trans = affine::scale(0.5, 2.0);
211
+ let res = src.transform(trans.view(), None).unwrap();
212
213
+ assert_eq!(res.rows(), 8);
214
+ assert_eq!(res.cols(), 2);
215
+ }
216
0 commit comments