@100mslive/hms-virtual-background 1.3.1-6e → 1.3.3-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/HMSVirtualBackgroundPlugin.d.ts +11 -6
- package/dist/hms-virtual-background.cjs.development.js +272 -189
- package/dist/hms-virtual-background.cjs.development.js.map +1 -1
- package/dist/hms-virtual-background.cjs.production.min.js +1 -1
- package/dist/hms-virtual-background.cjs.production.min.js.map +1 -1
- package/dist/hms-virtual-background.esm.js +270 -189
- package/dist/hms-virtual-background.esm.js.map +1 -1
- package/package.json +2 -4
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import '@tensorflow/tfjs-backend-webgl';
|
|
2
|
-
import { HMSVideoPlugin, HMSVideoPluginType } from
|
|
2
|
+
import { HMSVideoPlugin, HMSVideoPluginType } from "@100mslive/hms-video";
|
|
3
3
|
export declare class HMSVirtualBackgroundPlugin implements HMSVideoPlugin {
|
|
4
4
|
background: string | HTMLImageElement;
|
|
5
5
|
personMaskWidth: number;
|
|
6
6
|
personMaskHeight: number;
|
|
7
7
|
isVirtualBackground: boolean;
|
|
8
|
-
backgroundImage: HTMLImageElement |
|
|
8
|
+
backgroundImage: HTMLImageElement | null;
|
|
9
|
+
backgroundVideo: HTMLVideoElement | null;
|
|
10
|
+
backgroundType: string;
|
|
9
11
|
loadModelCalled: boolean;
|
|
10
12
|
blurValue: any;
|
|
11
13
|
tfLite: any;
|
|
@@ -20,14 +22,14 @@ export declare class HMSVirtualBackgroundPlugin implements HMSVideoPlugin {
|
|
|
20
22
|
personMask: ImageData;
|
|
21
23
|
personMaskCanvas: HTMLCanvasElement;
|
|
22
24
|
personMaskCtx: any;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
filters: any;
|
|
26
|
+
enableSharpening?: boolean | false;
|
|
27
|
+
constructor(background: string, enableSharpening?: boolean);
|
|
25
28
|
init(): Promise<void>;
|
|
26
29
|
isSupported(): boolean;
|
|
27
30
|
getName(): string;
|
|
28
31
|
getPluginType(): HMSVideoPluginType;
|
|
29
|
-
|
|
30
|
-
setBackground(path?: string | HTMLImageElement): Promise<void>;
|
|
32
|
+
setBackground(path?: string | HTMLImageElement | HTMLVideoElement): Promise<void>;
|
|
31
33
|
stop(): void;
|
|
32
34
|
processVideoFrame(input: HTMLCanvasElement, output: HTMLCanvasElement, skipProcessing?: boolean): Promise<void> | void;
|
|
33
35
|
private setImage;
|
|
@@ -35,9 +37,12 @@ export declare class HMSVirtualBackgroundPlugin implements HMSVideoPlugin {
|
|
|
35
37
|
private resizeInputData;
|
|
36
38
|
private infer;
|
|
37
39
|
private postProcessing;
|
|
40
|
+
private sharpenFilter;
|
|
38
41
|
private drawPersonMask;
|
|
39
42
|
private drawSegmentedBackground;
|
|
40
43
|
private runSegmentation;
|
|
44
|
+
private fitVideoToBackground;
|
|
41
45
|
private fitImageToBackground;
|
|
42
46
|
private addBlurToBackground;
|
|
47
|
+
private initSharpenFilter;
|
|
43
48
|
}
|