chore(app-iced): M75 r5 —— 删掉被 count_in 取代的 count_pixels(clippy dead_code)
This commit is contained in:
1 parent
b563c6ac44
commit
4954ba3463
1 file changed
-11
@@ -82,17 +82,6 @@ fn delta_ratio(pixel: [u8; 3], surface: [u8; 3], line: [u8; 3]) -> f32 {
|
|||||||
(dr + dg + db) / 3.0
|
(dr + dg + db) / 3.0
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 图上某个精确色的像素数(带容差)。
|
|
||||||
fn count_pixels(shot: &Shot, color: [u8; 3]) -> usize {
|
|
||||||
(0..shot.height)
|
|
||||||
.map(|y| {
|
|
||||||
(0..shot.width)
|
|
||||||
.filter(|x| matches(shot.at(*x, y), color))
|
|
||||||
.count()
|
|
||||||
})
|
|
||||||
.sum()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// `ULL_GALLERY_SHOT` → 截图路径(相对路径按**工作区根**解释:`cargo test` 的 cwd 是 crate 目录)。
|
/// `ULL_GALLERY_SHOT` → 截图路径(相对路径按**工作区根**解释:`cargo test` 的 cwd 是 crate 目录)。
|
||||||
fn shot_path() -> Option<std::path::PathBuf> {
|
fn shot_path() -> Option<std::path::PathBuf> {
|
||||||
let raw = std::env::var_os("ULL_GALLERY_SHOT")?;
|
let raw = std::env::var_os("ULL_GALLERY_SHOT")?;
|
||||||
|
|||||||
Reference in new issue
Block a user