Documentation
    Preparing search index...

    Interface PixelReader

    A renderer that can read a target's pixels back — the structural capability (§61, §92).

    Written as its own interface, and as an optional member of Renderer, for the reasons statistics.ts gives for RenderStatisticsReporter: adding a required member to a published interface breaks every implementor, and a backend with no readable pixels (the null tier, §62's SVG tier) should be able to say so by omission rather than by fabricating bytes.

    interface PixelReader {
        readPixels(
            target: RenderTarget,
            region?: Rectangle2,
        ): Promise<ArrayBuffer>;
    }
    Index
    • Reads target's colour attachment — or region of it — back as tightly packed RGBA8 bytes, rows bottom-to-top. See Renderer.readPixels for the full contract; the promise shape, row order, and rejection rules are identical on every backend.

      Parameters

      Returns Promise<ArrayBuffer>