Generate a mask from a region of tiles based on a condition.
For each tile in the grid, sets the corresponding element of mask to the result of fn(tile).
If a coordinate is out of bounds (e.g. if you are generating a mask from a slice that extends
over the map border) the mask value is the init value of the mask's element type.
Generate a mask from a region of tiles based on a condition.
For each tile in the grid, sets the corresponding element of mask to the result of fn(tile). If a coordinate is out of bounds (e.g. if you are generating a mask from a slice that extends over the map border) the mask value is the init value of the mask's element type.