@kayahr/wastelib
    Preparing search index...

    Interface CanvasContext2DLike

    Minimal interface for a 2D canvas rendering context.

    interface CanvasContext2DLike {
        createImageData(width: number, height: number): ImageDataLike;
        getImageData(
            x: number,
            y: number,
            width: number,
            height: number,
        ): ImageDataLike;
        putImageData(imageData: ImageDataLike, x: number, y: number): void;
    }
    Index

    Methods

    • Creates an empty image data container with the given size.

      Parameters

      • width: number

        The width in pixels.

      • height: number

        The height in pixels.

      Returns ImageDataLike

      The created image data container.

    • Returns image data at the given position.

      Parameters

      • x: number

        The horizontal position of the image data to return.

      • y: number

        The vertical position of the image data to return.

      • width: number

        The width of the image data to return.

      • height: number

        The height of the image data to return.

      Returns ImageDataLike

      The read image data.

    • Draws the given image data to the given position.

      Parameters

      • imageData: ImageDataLike

        The image data to draw.

      • x: number

        The horizontal position where to draw the image data.

      • y: number

        The vertical position where to draw the image data.

      Returns void