INNER CODE UNIT · Rust

find_bitmap

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

    fn find_bitmap(
        &self,
        needle: &Bitmap,
        tolerance: Option<f64>,
        rect: Option<((f64, f64), (f64, f64))>,
        start_point: Option<(f64, f64)>,
    ) -> PyResult<Option<(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));
        if let Some(point) = self
            .bitmap
            .find_bitmap(&needle.bitmap, tolerance, rect, start_point)
        {
            Ok(Some((point.x, point.y)))
        } else {
            Ok(None)
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…