INNER CODE UNIT · Rust
bitmap_eq
autopilot-rs/autopilot-rs · src/bitmap.rs:115
pub fn bitmap_eq(&self, needle: &Bitmap, tolerance: Option<f64>) -> bool {
self.size == needle.size
&& self.scale == needle.scale
&& self.is_needle_at(Point::ZERO, needle, tolerance)
}
/// Attempts to find `color` inside `rect` in `bmp` from the given
/// `start_point`. Returns coordinates if found, or `None` if not. If
/// `rect` is `None`, `bmp.bounds()` is used instead. If `start_point` is
/// `None`, the origin of `rect` is used.
///
/// Tolerance is defined as a float in the range from 0 to 1, where 0 is
/// an exact match and 1 matches anything.
pub fn find_color(
&self,
needle: Rgba<u8>,
tolerance: Option<f64>,
rect: Option<Rect>,