You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/src/main.rs
+6-9Lines changed: 6 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,12 @@
28
28
*/
29
29
mod image_wrapper;
30
30
31
-
use image::{
32
-
imageops,EncodableLayout,GenericImageView,
33
-
ImageReader,
34
-
};
31
+
use fast_image_resize::images::Image;
32
+
use fast_image_resize::{CpuExtensions,FilterType,PixelType,ResizeAlg,ResizeOptions,Resizer};
33
+
use image::{imageops,EncodableLayout,GenericImageView,ImageReader};
35
34
use pic_scale_safe::{resize_rgb8, resize_rgba8,ImageSize,ResamplingFunction};
36
35
use std::ops::{BitXor,Shr};
37
36
use std::time::Instant;
38
-
use fast_image_resize::images::Image;
39
-
use fast_image_resize::{CpuExtensions,FilterType,PixelType,ResizeAlg,ResizeOptions,Resizer};
40
37
41
38
fnmain(){
42
39
let img = ImageReader::open("./assets/test_alpha.JPG")
@@ -50,7 +47,7 @@ fn main() {
50
47
51
48
let src_size = ImageSize::new(dimensions.0asusize, dimensions.1asusize);
52
49
// let dst_size = ImageSize::new(dimensions.0 as usize / 4, dimensions.1 as usize / 4);
53
-
let dst_size = ImageSize::new(src_size.width / 6, src_size.height /6);
50
+
let dst_size = ImageSize::new(3240,2160);
54
51
55
52
// let start_mul = Instant::now();
56
53
//
@@ -64,7 +61,7 @@ fn main() {
64
61
&working_store,
65
62
src_size,
66
63
dst_size,
67
-
ResamplingFunction::Lanczos3,
64
+
ResamplingFunction::CatmullRom,
68
65
)
69
66
.unwrap();
70
67
@@ -113,7 +110,7 @@ fn main() {
113
110
// .unwrap();
114
111
//
115
112
// println!("Working time {:?}", start.elapsed());
116
-
113
+
117
114
// let img = u8_to_u16(dst_image.buffer());
118
115
//
119
116
// let rgba_image = DynamicImage::ImageRgb8(RgbImage::from_raw(dst_image.width() as u32, dst_image.height() as u32, dst_image.buffer().to_vec()).unwrap());
0 commit comments