14 lines
620 B
TypeScript
14 lines
620 B
TypeScript
export { getConfig as C } from "./addon";
|
|
import { Mat } from "./mat";
|
|
|
|
export type TypedArray = Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | BigUint64Array | BigInt64Array | Float32Array | Float64Array
|
|
|
|
export function FromCV(mat: any): Mat { return new (Mat as any)(mat); }
|
|
export function M(mat: Mat) { return (mat as any).__mat__; }
|
|
|
|
export function resolveArgs<R extends Array<any>>(args: any[], checker: boolean | (() => boolean)): R {
|
|
if (typeof checker === "function") checker = checker();
|
|
if (checker) return args as R;
|
|
return [args[0], new Mat(), ...args.slice(1)] as R;
|
|
}
|