Skip to content

Interface: SealpixelWasm ​

Defined in: packages/wasm/dist/types.d.ts:38

Typed surface over the WASM exports. Every call copies its input into WASM memory and copies the result out, so callers never hold views into the WASM heap.

Methods ​

assetClear() ​

assetClear(): void

Defined in: packages/wasm/dist/types.d.ts:80

Returns ​

void


assetHas() ​

assetHas(id): boolean

Defined in: packages/wasm/dist/types.d.ts:79

Parameters ​

id ​

string

Returns ​

boolean


assetPut() ​

assetPut(id, bytes): void

Defined in: packages/wasm/dist/types.d.ts:78

Stores a font or image for kernels that reference it by id. Verify the hash first.

Parameters ​

id ​

string

bytes ​

Uint8Array

Returns ​

void


decode() ​

decode(bytes): DecodedImage

Defined in: packages/wasm/dist/types.d.ts:51

Decodes PNG (and, in later milestones, JPEG and WebP).

Parameters ​

bytes ​

Uint8Array

Returns ​

DecodedImage


encode() ​

encode(image, optionsJson, icc?): Uint8Array<ArrayBuffer>

Defined in: packages/wasm/dist/types.d.ts:56

Encodes pixels using OutputOptions JSON, e.g. {"format":"png"}. icc is written into the output unchanged, whatever the format.

Parameters ​

image ​

RgbaBuffer

optionsJson ​

string

icc? ​

Uint8Array<ArrayBufferLike>

Returns ​

Uint8Array<ArrayBuffer>


identity() ​

identity(): RendererIdentity

Defined in: packages/wasm/dist/types.d.ts:49

This build, as a render manifest names it.

Returns ​

RendererIdentity


manifestDefinition() ​

manifestDefinition(planJson, inputJson): string

Defined in: packages/wasm/dist/types.d.ts:74

The C2PA manifest definition of a plan, as JSON: its actions in the C2PA vocabulary, for the host's signer. inputJson is the core's DefinitionInput.

Parameters ​

planJson ​

string

inputJson ​

string

Returns ​

string


pixelHash() ​

pixelHash(image): string

Defined in: packages/wasm/dist/types.d.ts:47

The pixel hash of a buffer: sha256 over its width and height as big-endian u32 and its pixels. A render manifest records it.

Parameters ​

image ​

RgbaBuffer

Returns ​

string


renderRgba() ​

renderRgba(image, planJson, options?): RgbaBuffer & object

Defined in: packages/wasm/dist/types.d.ts:62

Executes a RenderPlan JSON on the pixels. With pixelHash, the result carries the pixel hash, computed while the pixels were still in wasm memory, so no buffer travels back for it.

Parameters ​

image ​

RgbaBuffer

planJson ​

string

options? ​
pixelHash? ​

boolean

Returns ​

RgbaBuffer & object


resizeWorkingCopy() ​

resizeWorkingCopy(image, maxSide): RgbaBuffer

Defined in: packages/wasm/dist/types.d.ts:76

Deterministic downscale so the longer side is at most maxSide. Never upscales.

Parameters ​

image ​

RgbaBuffer

maxSide ​

number

Returns ​

RgbaBuffer


resolveGeometry() ​

resolveGeometry(planJson, width, height): string

Defined in: packages/wasm/dist/types.d.ts:68

Stage geometry (JSON) for a plan executed on a buffer of the given size.

Parameters ​

planJson ​

string

width ​

number

height ​

number

Returns ​

string


sha256Hex() ​

sha256Hex(bytes): string

Defined in: packages/wasm/dist/types.d.ts:42

SHA-256 of bytes, lowercase hex.

Parameters ​

bytes ​

Uint8Array

Returns ​

string


version() ​

version(): string

Defined in: packages/wasm/dist/types.d.ts:40

Version of the Rust core compiled into this binary.

Returns ​

string