diff --git a/src/main.rs b/src/main.rs index c594164..03a26d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,16 +77,14 @@ fn main() { println!("L8 Frame Draw use time: {:?}", duration); }) .unwrap(); - crossbeam::scope(|_| { - let fltk_l_image = - RgbImage::new(l_data.as_raw(), w, h, ColorDepth::L8).unwrap(); - camera_frame.set_image(Some(fltk_l_image)); - color_frame.set_size(w, h); - camera_frame.redraw(); - let duration = start.elapsed(); - println!("RGB8 Frame Draw use time: {:?}", duration); - }) - .unwrap(); + // 尝试将部分功能移出线程 + let fltk_l_image = + RgbImage::new(l_data.as_raw(), w, h, ColorDepth::L8).unwrap(); + camera_frame.set_image(Some(fltk_l_image)); + color_frame.set_size(w, h); + camera_frame.redraw(); + let duration = start.elapsed(); + println!("RGB8 Frame Draw use time: {:?}", duration); } Err(e) => { eprintln!("捕获错误: {}", e);