API reference
Preparing search index…

Native-owned RGBA8 pixels with asynchronous file and codec operations.

Source & inheritance
Member directory17

Constructors

Properties

Accessors

Methods

Constructors

Accessors

  • get pixels(): Uint8Array

    Writable extension; old views retain old images after resize or load.

    Returns

    Uint8Array
    Source & inheritance

Methods

  • Flips pixels horizontally in place.

    Returns

    void
    Source & inheritance
  • Empty images have no pixel pointer. Constness is enforced by TypeScript.

    Returns


        | undefined
        | Readonly<
            Pick<
                Uint8Array,
                | number
                | typeof iterator
                | "length"
                | "slice"
                | "entries"
                | "keys"
                | "values"
                | "byteLength"
                | "byteOffset",
            >,
        >
    Source & inheritance
  • Reads and decodes an image file asynchronously, replacing pixel storage on success; returns whether it succeeded.

    Parameters

    filename
    string

    Returns

    Promise<boolean>
    Source & inheritance
  • Decodes encoded image bytes such as PNG/JPEG asynchronously and returns whether it succeeded.

    Parameters

    data
    Uint8Array

    Returns

    Promise<boolean>
    Source & inheritance
  • Decodes an image asynchronously from a seekable input stream; stream errors reject the Promise.

    Parameters

    Returns

    Promise<boolean>
    Source & inheritance
  • Encodes and saves an image asynchronously using the file extension; returns whether it succeeded.

    Parameters

    filename
    string

    Returns

    Promise<boolean>
    Source & inheritance
  • Encodes asynchronously to format (such as png) and returns bytes; returns undefined if encoding fails.

    Parameters

    format
    string

    Returns

    Promise<undefined | Uint8Array>
    Source & inheritance

Symbol members

"[graphicsNative]": NativeGraphicsHandle<"image">
Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0