rullino
    Preparing search index...

    Interface Renderer

    interface Renderer {
        backend: "gpu" | "cpu";
        gpu?: GpuContext;
        reason?: string;
        apply(
            image: LinearImage | Rgba8Image,
            edit: unknown,
            options?: { scale?: number },
        ): Promise<LinearImage>;
        destroy(): void;
        pixels(
            image: LinearImage | Rgba8Image,
            edit: unknown,
            options?: { scale?: number },
        ): Promise<ImageData>;
        render(input: ImageData | Blob, edit: unknown): Promise<Blob>;
    }
    Index
    backend: "gpu" | "cpu"

    The GPU context, when the backend is 'gpu'.

    reason?: string

    Why 'auto' chose the CPU.

    • Renders an edit document on a linear image (see applyEdit in @rullino/core). scale is the image's size relative to the original the edit was made on, e.g. 0.25 for a quick preview.

      Parameters

      Returns Promise<LinearImage>

    • Releases the GPU device and stops the worker. Pending renders are rejected.

      Returns void

    • Like apply, but answers with 8-bit sRGB pixels ready for a canvas, encoded where the render ran (on the GPU, or in the worker): the fast path for interactive previews.

      Parameters

      Returns Promise<ImageData>

    • Renders an edit document on 8-bit pixels (ImageData) or an image file the browser can decode (a Blob), and encodes the result as the document's output says (PNG by default).

      Parameters

      • input: ImageData | Blob
      • edit: unknown

      Returns Promise<Blob>