Skip to content

TypeScript helpers

All modules / typescript

createGraphAPIhelper

TypeScript conveniences for the native CPU graph API and Python's graph factories.

createOpenCVhelper

Load an isolated CPU OpenCV WebAssembly instance in a browser, worker or Node.js.

createStreamAPIhelper

Create file and iterable source factories for one isolated OpenCV instance.

createValueAPIhelper

Value factories use this instance's native algorithms for geometric operations.

CV_MAKETYPEhelper

Construct an OpenCV 5 matrix type code with a supported depth and 1 to 128 channels.

decodeImagehelper

Decode encoded bytes with native codecs on the initialized shared engine, in browsers or Node.

encodeImagehelper

Encode a shared-engine matrix to independent image bytes; no DOM is required.

GraphDescriptorstype

Only matrix ports need a layout. Other ports have null metadata.

GraphNodestype

Native graph nodes in the order declared by a custom operation.

GraphPortstype

A nonempty tuple of graph port names, inferred from a literal operation signature.

GraphStreamtype

Serial graph execution over frame sources. Use await using or await delete() to release retained handles.

GraphValuestype

Runtime values in the order declared by a custom operation.

initOpenCVhelper

Initialize the shared OpenCV instance used by named imports such as Mat and GaussianBlur.

installGraphStreaminghelper

Install the streaming adapter on this instance's computation prototype.

makeIterableSourcehelper

Convert a synchronous or asynchronous iterable to a source with explicit end-of-stream cleanup.

matFromArrayhelper

Copy row-major interleaved values into an owned native matrix on the shared engine.

matFromImageDatahelper

Copy canvas RGBA bytes into an owned CV_8UC4 matrix on the initialized shared engine. Dispose after use.

OpenCVtype

All native functions, classes, constants and enums in this build.

OpenCVOptionstype

Loading options; use wasmUrl with bundlers or wasmBinary for an in-memory binary.

toImageDatahelper

Copy a shared-engine 8-bit matrix to independent RGBA ImageData, handling row strides.

TypedGraphKerneltype

Synchronous callback with borrowed matrix/primitive handles. Fill matrices or assign output values.

TypedGraphOperationtype

A native operation with its exact node tuple and callback signature preserved by TypeScript.

TypedGraphSignaturetype

Matrix outputs require metadata; purely scalar, array and opaque operations can omit it.

valueAPIhelper

JavaScript value constructors and OpenCV 5 matrix type constants/functions.