AsyncArray
import { AsyncArray } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods.
Returns result of asynchronous operations
Object has attached asynchronous state. Assignment operator doesn't clone asynchronous state (it is shared between all instances).
Result can be fetched via get() method only once.
Constructors and members
static new
Create an owned AsyncArray object. Release native handles with using or delete().
new(): AsyncArray;The AsyncArray result.
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
release
Release this asynchronous result reference and its associated storage.
release(): void;get
Fetch the result.
Note: Result or stored exception can be fetched only once.
get(dst: Mat): void;dstOutput destination, filled by the native operation. destination array
Waits for result until container has valid result. Throws exception if exception was stored as a result.
Throws exception on invalid container state.
get1
Retrieving the result with timeout
Note: Result or stored exception can be fetched only once.
get1(dst: Mat, timeoutNs: number): boolean;dstOutput destination, filled by the native operation. destination array
timeoutNstimeout in nanoseconds, -1 for infinite wait
true if result is ready, false if the timeout has expired
wait_for
Wait up to the supplied timeout for the result and return whether it became ready. Native asynchronous execution backends are not enabled in this build.
wait_for(timeoutNs: number): boolean;timeoutNstimeout ns argument (number).
The boolean result.
valid
Return whether this object holds an asynchronous result state.
valid(): boolean;The boolean result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.