INNER CODE UNIT · Rust
Some
autopilot-rs/autopy · src/bitmap.rs:189
if let Some(point) = self.bitmap.find_color(rgb, tolerance, rect, start_point) {
Ok(Some((point.x, point.y)))
} else {
Ok(None)
}
}
/// Returns list of all `(x, y)` coordinates inside `rect` in `bmp`
/// matching `color` from the given `start_point`. If `rect` is `None`,
/// `bmp.bounds` is used instead. If `start_point` is `None`, the origin of
/// `rect` is used.
#[pyo3(signature = (color, tolerance=None, rect=None, start_point=None))]
fn find_every_color(
&self,
color: u32,
tolerance: Option<f64>,
rect: Option<((f64, f64), (f64, f64))>,
start_point: Option<(f64, f64)>,