bhcli

"Strange's fork of n0tr1v's bhcli (onion)"
git clone https://git.dasho.dev/Strange/bhcli.git
Log | Files | Refs | README

commit 72e95eeaca3e5df92cccaa99a3444e0999da0577
parent 347f879d3b7057e280c444e935d2d4d1e77f92c1
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 30 Mar 2023 02:51:53 -0700

cleanup

Diffstat:
Msrc/lechatphp/mod.rs | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/lechatphp/mod.rs b/src/lechatphp/mod.rs @@ -410,22 +410,22 @@ impl From<(u32, u32)> for Point { fn get_contour_red_pixels(top_left_pt: &Point, img: &DynamicImage) -> Vec<Point> { let (img_width, img_height) = img.dimensions(); let mut out = vec![]; - for i in 0..img_width { - if let Some(px_color) = get_pixel_in_bound(img, i, 0) { + for x in 0..img_width { + if let Some(px_color) = get_pixel_in_bound(img, x, 0) { if px_color == *RED_COLOR { - out.push(top_left_pt.add(Point::new(i, 0))); + out.push(top_left_pt.add(Point::new(x, 0))); } } - if let Some(px_color) = get_pixel_in_bound(img, i, img_height-1) { + if let Some(px_color) = get_pixel_in_bound(img, x, img_height-1) { if px_color == *RED_COLOR { - out.push(top_left_pt.add(Point::new(i, img_height-1))); + out.push(top_left_pt.add(Point::new(x, img_height-1))); } } } - for i in 1..img_height-1 { - if let Some(px_color) = get_pixel_in_bound(img, 0, i) { + for y in 1..img_height-1 { + if let Some(px_color) = get_pixel_in_bound(img, 0, y) { if px_color == *RED_COLOR { - out.push(top_left_pt.add(Point::new(0, i))); + out.push(top_left_pt.add(Point::new(0, y))); } } if img_width < img_height { @@ -433,9 +433,9 @@ fn get_contour_red_pixels(top_left_pt: &Point, img: &DynamicImage) -> Vec<Point> continue; } } - if let Some(px_color) = get_pixel_in_bound(img, img_width-1, i) { + if let Some(px_color) = get_pixel_in_bound(img, img_width-1, y) { if px_color == *RED_COLOR { - out.push(top_left_pt.add(Point::new(img_width-1, i))); + out.push(top_left_pt.add(Point::new(img_width-1, y))); } } }