我使用image crate来裁剪图像并调整其大小,而不复制整个图像。
let img: DynamicImage = image.open("image.jpg").unwrap();
let square: SubImage<&DynamicImage> = image.view(0, 0, 100, 100);
let small_square = square.thumbnail(25, 25); <-- no method named `thumbnail` for type SubImage
如何直接在DynamicImage上使用SubImage的方法?