Class JSBackendBase¶
Note
Construct via the Class AniraWeb factory in most cases:
aniraWeb.JSBackendBase(...) rather than new JSBackendBase(...). The
factory threads the WASM instance through for you.
- class JSBackendBase(wasmInstance, inferenceConfig)¶
TypeScript wrapper for JSBackendBase. Each instance is identified by its C++ pointer and carries its own process implementation that the inference worker dispatches to.
- Extends:
BaseWrapper
- Arguments:
wasmInstance (AniraWasmInstance)
inferenceConfig (PossiblePointer<InferenceConfig>)
- JSBackendBase.inferenceConfigPtr¶
type: number
Pointer to the C++ InferenceConfig used to create this processor.
- destroy()¶
Destroy this buffer and free memory
- async init()¶
- Returns:
Promise<void>
- process(inputVecPtr, outputVecPtr)¶
Process buffers. Called by the inference worker when C++ invokes the JS callback. Override in a subclass to implement custom processing.
- Arguments:
inputVecPtr (number)
outputVecPtr (number)