function that generates a mask entry from a tile
grid to generate mask from
center position around which to generate mask
rectangular array to populate with generated mask values. must match the size of the grid
auto myGrid = rectGrid([ [ 00, 01, 02, 03, 04 ], [ 10, 11, 12, 13, 14 ], [ 20, 21, 22, 23, 24 ], ]); uint[3][3] mask; myGrid.createMaskAround!(tile => tile > 10)(RowCol(1,1), mask); assert(mask == [ [0, 0, 0], [0, 1, 1], [1, 1, 1], ]); myGrid.createMaskAround!(tile => tile < 24)(RowCol(2,4), mask); assert(mask == [ [1, 1, 0], [1, 0, 0], [0, 0, 0], ]);
Same as createMask, but specify the offset of the mask's center rather than the top-left corner.