Skip to content

Commit

Permalink
rm unsue
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyem committed May 15, 2024
1 parent c33fd06 commit f32d31d
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src-tauri/src/plugins/tary_manage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ fn find_max_dimensions(dimensions: &[(usize, usize)]) -> (usize, usize) {
}
(max_w, max_h)
}
fn resize_image(
image: &ImageBuffer<Rgba<u8>, Vec<u8>>,
scale: f32,
) -> ImageBuffer<Rgba<u8>, Vec<u8>> {
// 计算新的尺寸
let (width, height) = image.dimensions();
let new_width = (width as f32 * scale).round() as u32;
let new_height = (height as f32 * scale).round() as u32;
imageops::resize(image, new_width, new_height, imageops::Nearest)
}

pub struct DTaryState {
pub running: Arc<AtomicBool>,
Expand All @@ -65,17 +55,6 @@ impl DTaryState {
}
}

pub fn from_raw(data: Vec<u8>) -> Self {
Self {
running: Arc::new(AtomicBool::new(false)),
tary_item: Arc::new(Mutex::new(TaryItem {
speed: Duration::from_millis(cpu_usage()),
data: GifData::Raw(data),
})),
join_handle: None,
}
}

pub fn run(&mut self, app: AppHandle) {
self.running.store(true, Ordering::SeqCst);
let canlcel = Arc::clone(&self.running);
Expand Down

0 comments on commit f32d31d

Please sign in to comment.