pub fn s_edt_2d(
    grid: &mut [f32],
    grid_width: usize,
    offset_x: usize,
    offset_y: usize,
    width: usize,
    height: usize,
    v: &mut [usize],
    z: &mut [f32],
    f: &mut [f32],
) {
    for x in offset_x..(offset_x + width) {
        s_edt_1d(grid, offset_y * grid_width + x, grid_width, height, v, z, f);
    }
    for y in offset_y..(offset_y + height) {
        s_edt_1d(grid, y * grid_width + offset_x, 1, width, v, z, f);
    }
}
// 2-D squared Euclidean distance transform
2-D squared Euclidean distance transform
2 - D squared Euclidean distance transform
pub fn s_edt_2d(
    grid: &mut [f32],
    grid_width: usize,
    offset_x: usize,
    offset_y: usize,
    width: usize,
    height: usize,
    v: &mut [usize],
    z: &mut [f32],
    f: &mut [f32],
) {
    for x in offset_x..(offset_x + width) {
        s_edt_1d(grid, offset_y * grid_width + x, grid_width, height, v, z, f);
    }
    for y in offset_y..(offset_y + height) {
        s_edt_1d(grid, y * grid_width + offset_x, 1, width, v, z, f);
    }
}
pub fn s_edt_2d ( grid : & mut [ f32 ] , grid_width : usize , offset_x : usize , offset_y : usize , width : usize , height : usize , v : & mut [ usize ] , z : & mut [ f32 ] , f : & mut [ f32 ] , ) { for x in offset_x .. ( offset_x + width ) { s_edt_1d ( grid , offset_y * grid_width + x , grid_width , height , v , z , f ) ; } for y in offset_y .. ( offset_y + height ) { s_edt_1d ( grid , y * grid_width + offset_x , 1 , width , v , z , f ) ; } }
2-D squared Euclidean distance transform
2 - D squared Euclidean distance transform
grid
&mut [f32]
grid_width
usize
offset_x
usize
offset_y
usize
width
usize
height
usize
v
&mut [usize]
z
&mut [f32]
f
&mut [f32]