INNER CODE UNIT · Rust

count_of_bitmap

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

    fn count_of_bitmap(
        &self,
        needle: &Bitmap,
        tolerance: Option<f64>,
        rect: Option<((f64, f64), (f64, f64))>,
        start_point: Option<(f64, f64)>,
    ) -> PyResult<u64> {
        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 count = self
            .bitmap
            .count_of_bitmap(&needle.bitmap, tolerance, rect, start_point);
        Ok(count)
    }

    /// Returns new bitmap object created from a portion of another.
    ///

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…