@100mslive/hms-virtual-background 1.3.2 → 1.3.6

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.
@@ -1,11 +1,13 @@
1
1
  import '@tensorflow/tfjs-backend-webgl';
2
- import { HMSVideoPlugin, HMSVideoPluginType } from "@100mslive/hms-video";
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 | undefined;
8
+ backgroundImage: HTMLImageElement | null;
9
+ backgroundVideo: HTMLVideoElement | null;
10
+ backgroundType: string;
9
11
  loadModelCalled: boolean;
10
12
  blurValue: any;
11
13
  tfLite: any;
@@ -20,22 +22,36 @@ export declare class HMSVirtualBackgroundPlugin implements HMSVideoPlugin {
20
22
  personMask: ImageData;
21
23
  personMaskCanvas: HTMLCanvasElement;
22
24
  personMaskCtx: any;
23
- constructor(background: string);
25
+ filters: any;
26
+ enableSharpening?: boolean | false;
27
+ gifFrames: any;
28
+ gifFramesIndex: number;
29
+ gifFrameImageData: any;
30
+ tempGifCanvas: HTMLCanvasElement;
31
+ tempGifContext: any;
32
+ giflocalCount: number;
33
+ constructor(background: string, enableSharpening?: boolean);
24
34
  init(): Promise<void>;
25
35
  isSupported(): boolean;
26
36
  getName(): string;
27
37
  getPluginType(): HMSVideoPluginType;
28
- setBackground(path?: string | HTMLImageElement): Promise<void>;
38
+ setBackground(path?: string | HTMLImageElement | HTMLVideoElement): Promise<void>;
29
39
  stop(): void;
30
40
  processVideoFrame(input: HTMLCanvasElement, output: HTMLCanvasElement, skipProcessing?: boolean): Promise<void> | void;
31
41
  private setImage;
42
+ private setGiF;
32
43
  private log;
33
44
  private resizeInputData;
34
45
  private infer;
35
46
  private postProcessing;
47
+ private sharpenFilter;
36
48
  private drawPersonMask;
37
49
  private drawSegmentedBackground;
38
50
  private runSegmentation;
51
+ private fitVideoToBackground;
39
52
  private fitImageToBackground;
53
+ private fitGifToBackground;
54
+ private fitData;
40
55
  private addBlurToBackground;
56
+ private initSharpenFilter;
41
57
  }