fn draw_finder_pattern(&mut self, x: i32, y: i32) {
        for dy in -4..=4 {
            for dx in -4..=4 {
                let xx: i32 = x + dx;
                let yy: i32 = y + dy;
                if (0..self.size).contains(&xx) && (0..self.size).contains(&yy) {
                    let dist: i32 = std::cmp::max(dx.abs(), dy.abs()); // Chebyshev/infinity norm
                    self.set_function_module(xx, yy, dist != 2 && dist != 4);
                }
            }
        }
    }
// Draws a 9*9 finder pattern including the border separator,
// with the center module at (x, y). Modules can be out of bounds.
Draws a 9*9 finder pattern including the border separator,
with the center module at (x, y). Modules can be out of bounds.
Draws a 9 * 9 finder pattern including the border separator with the center module at ( x y ) . Modules can be out of bounds .
fn draw_finder_pattern(&mut self, x: i32, y: i32) {
        for dy in -4..=4 {
            for dx in -4..=4 {
                let xx: i32 = x + dx;
                let yy: i32 = y + dy;
                if (0..self.size).contains(&xx) && (0..self.size).contains(&yy) {
                    let dist: i32 = std::cmp::max(dx.abs(), dy.abs()); // Chebyshev/infinity norm
                    self.set_function_module(xx, yy, dist != 2 && dist != 4);
                }
            }
        }
    }
fn draw_finder_pattern ( & mut self , x : i32 , y : i32 ) { for dy in - 4 ..= 4 { for dx in - 4 ..= 4 { let xx : i32 = x + dx ; let yy : i32 = y + dy ; if ( 0 .. self . size ) . contains ( & xx ) && ( 0 .. self . size ) . contains ( & yy ) { let dist : i32 = std :: cmp :: max ( dx . abs ( ) , dy . abs ( ) ) ; // Chebyshev/infinity norm self . set_function_module ( xx , yy , dist != 2 && dist != 4 ) ; } } } }
Draws a 9*9 finder pattern including the border separator,
with the center module at (x, y).
Draws a 9 * 9 finder pattern including the border separator with the center module at ( x y ) .
&mut self
x
i32
y
i32