feat: 屏幕跟随改为多线程执行。
性能没有提升。
This commit is contained in:
@@ -6,10 +6,7 @@ use tokio::sync::Mutex;
|
||||
|
||||
use crate::picker::screen::Screen;
|
||||
|
||||
use super::{
|
||||
led_color::LedColor,
|
||||
screenshot::{Screenshot},
|
||||
};
|
||||
use super::{led_color::LedColor, screenshot::Screenshot};
|
||||
|
||||
pub struct Picker {
|
||||
pub screens: Arc<Mutex<Vec<Screen>>>,
|
||||
|
@@ -53,11 +53,11 @@ impl Screenshot {
|
||||
match bitmap.as_ref() {
|
||||
Some(bitmap) => {
|
||||
let cell_size_x = self.width / self.led_number_of_x;
|
||||
let cell_size_y = self.height / 5;
|
||||
let cell_size_y = self.height / 8;
|
||||
let cell_size = cell_size_x * cell_size_y;
|
||||
let y_range = match position {
|
||||
XPosition::Top => 0..cell_size_y,
|
||||
XPosition::Bottom => self.height - cell_size_y..self.height,
|
||||
XPosition::Top => 20..cell_size_y + 20,
|
||||
XPosition::Bottom => self.height - 20 - cell_size_y..self.height - 20,
|
||||
};
|
||||
|
||||
let mut colors = Vec::new();
|
||||
|
Reference in New Issue
Block a user