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

    Function writeImageData

    • Writes image data from a source to a target with support for clipping and alpha masking.

      Parameters

      • target: ImageData

        The destination ImageData to write to.

      • source: ImageData

        The source ImageData to read from.

      • x: number

        The x-coordinate in the target where drawing starts.

      • y: number

        The y-coordinate in the target where drawing starts.

      • sx: number = 0

        The x-coordinate in the source to start copying from.

      • sy: number = 0

        The y-coordinate in the source to start copying from.

      • sw: number = source.width

        The width of the rectangle to copy.

      • sh: number = source.height

        The height of the rectangle to copy.

      • mask: Uint8Array<ArrayBufferLike> | null = null

        An optional Uint8Array mask (0-255). 0 is transparent, 255 is opaque.

      • maskType: MaskType = MaskType.BINARY

        type of mask

      Returns void