@omnimedia/omnitool
Version:
open source video processing tools
18 lines • 651 B
JavaScript
import { queue } from "@e280/stz";
import { Comrade, LoggerTap, tune } from "@e280/comrade";
export async function makeBgRemover({ spec, workerUrl, onLoading }) {
const thread = await Comrade.thread({
label: "OmnitoolBgRemover",
workerUrl,
tap: new LoggerTap(),
setupHost: () => ({
loading: async (loading) => onLoading(loading),
}),
});
await thread.work.prepare(spec);
return {
remove: queue(async (input) => await thread.work.remove[tune]({ transfer: [input.frame] })(input.frame)),
dispose: () => thread.terminate()
};
}
//# sourceMappingURL=bg-remover.js.map