Extracts a rectangular region from a 1D Uint8Array mask. This utility calculates the necessary offsets based on the maskWidth to slice out a specific area.
maskWidth
The target mask.
A rect defining the region to extract.
A new mask containing the extracted region.
The starting horizontal coordinate.
The starting vertical coordinate.
The width of the region to extract.
The height of the region to extract.
A new Uint8Array containing the extracted region.
Extracts a rectangular region from a 1D Uint8Array mask. This utility calculates the necessary offsets based on the
maskWidthto slice out a specific area.