Class JSPrePostProcessor

Note

Construct via the Class AniraWeb factory in most cases: aniraWeb.JSPrePostProcessor(...) rather than new JSPrePostProcessor(...). The factory threads the WASM instance through for you.

class JSPrePostProcessor(wasmInstance, inferenceConfig)

TypeScript wrapper for JSPrePostProcessor. Each instance is identified by its C++ pointer and carries its own pre/post implementation that the inference worker dispatches to.

Extends:
  • PrePostProcessor

Arguments:
  • wasmInstance (AniraWasmInstance)

  • inferenceConfig (PossiblePointer<InferenceConfig>)

destroy()

Free the underlying C++ object. See Lifecycle and Cleanup for when to call this.

postProcess(buffers, ringBuffers, backend)

Called by the inference worker when C++ invokes the JS callback. Override in a subclass to implement custom postprocessing.

Arguments:
  • buffers (PossiblePointer<VectorBufferF>)

  • ringBuffers (PossiblePointer<VectorRingBuffer>)

  • backend (number)

preProcess(ringBuffers, buffers, backend)

Called by the inference worker when C++ invokes the JS callback. Override in a subclass to implement custom preprocessing.

Arguments:
  • ringBuffers (PossiblePointer<VectorRingBuffer>)

  • buffers (PossiblePointer<VectorBufferF>)

  • backend (number)