INNER CODE UNIT · Rust

find_every_bitmap

autopilot-rs/autopy · src/bitmap.rs:277

    fn find_every_bitmap(
        &self,
        needle: &Bitmap,
        tolerance: Option<f64>,
        rect: Option<((f64, f64), (f64, f64))>,
        start_point: Option<(f64, f64)>,
    ) -> PyResult<Vec<(f64, f64)>> {
        let rect: Option<Rect> =
            rect.map(|r| Rect::new(Point::new((r.0).0, (r.0).1), Size::new((r.1).0, (r.1).1)));
        let start_point: Option<Point> = start_point.map(|p| Point::new(p.0, p.1));
        let points = self
            .bitmap
            .find_every_bitmap(&needle.bitmap, tolerance, rect, start_point)
            .iter()
            .map(|p| (p.x, p.y))
            .collect();
        Ok(points)
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…