Pixel Data JS - v0.28.0
    Preparing search index...

    Function extractMask

    • 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.

      Type Parameters

      Parameters

      • mask: T

        The target mask.

      • rect: Rect

        A rect defining the region to extract.

      Returns T

      A new mask containing the extracted region.

    • Type Parameters

      Parameters

      • mask: T

        The target mask.

      • x: number

        The starting horizontal coordinate.

      • y: number

        The starting vertical coordinate.

      • w: number

        The width of the region to extract.

      • h: number

        The height of the region to extract.

      Returns T

      A new Uint8Array containing the extracted region.