INNER CODE UNIT · Rust
find_every_color
autopilot-rs/autopilot-rs · src/bitmap.rs:145
pub fn find_every_color(
&self,
needle: Rgba<u8>,
tolerance: Option<f64>,
rect: Option<Rect>,
start_point: Option<Point>,
) -> Vec<Point> {
let mut points: Vec<Point> = Vec::new();
{
let tolerance = tolerance.unwrap_or(0.0);
let mut matched = |point| {
points.push(point);
};
self.find_all(
rect,
start_point,
&(|point| colors_match(needle, self.get_pixel(point), tolerance)),
&mut matched,