Interface AlphaSource

Structural shape of an RGBA pixel source. Browser ImageData (and the happy-dom equivalent used in tests) satisfy this contract directly. Keeping the type structural means the Phaser layer can pass any source that exposes RGBA pixels — e.g. an ImageData extracted from a DynamicTexture — without core taking a DOM dependency.

interface AlphaSource {
    data: Uint8ClampedArray;
    height: number;
    width: number;
}

Properties

Properties

data: Uint8ClampedArray

RGBA bytes, row-major, 4 bytes per pixel. Length = width * height * 4.

height: number
width: number