deepar 5.4.2 → 5.4.3-chromeExtension
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/VERSION.txt +1 -1
- package/js/deepar.esm.js +1 -1
- package/js/deepar.js +1 -1
- package/js/types/version.d.ts +1 -1
- package/lib/LICENSE +1 -0
- package/lib/README.md +326 -0
- package/lib/VERSION.txt +1 -0
- package/lib/effects/background_blur.deepar +0 -0
- package/lib/effects/background_replacement.deepar +0 -0
- package/lib/js/deepar.esm.js +1 -0
- package/lib/js/deepar.js +1 -0
- package/lib/js/types/DeepAR.d.ts +387 -0
- package/lib/js/types/callbacks.d.ts +64 -0
- package/lib/js/types/canvasHelper.d.ts +18 -0
- package/lib/js/types/canvasTouchHelper.d.ts +13 -0
- package/lib/js/types/errors.d.ts +6 -0
- package/lib/js/types/faceData.d.ts +33 -0
- package/lib/js/types/footData.d.ts +9 -0
- package/lib/js/types/index.d.ts +10 -0
- package/lib/js/types/initParams.d.ts +236 -0
- package/lib/js/types/logType.d.ts +18 -0
- package/lib/js/types/mediaRecorderVideoRecording.d.ts +10 -0
- package/lib/js/types/scriptingApi.d.ts +107 -0
- package/lib/js/types/touchType.d.ts +34 -0
- package/lib/js/types/version.d.ts +5 -0
- package/lib/js/types/webCodecsVideoRecording.d.ts +11 -0
- package/lib/js/types/wristData.d.ts +13 -0
- package/lib/mediaPipe/segmentation/models/selfie_segmenter.tflite +0 -0
- package/lib/mediaPipe/segmentation/models/selfie_segmenter_landscape.tflite +0 -0
- package/lib/mediaPipe/segmentation/wasm/vision_wasm_internal.js +22 -0
- package/lib/mediaPipe/segmentation/wasm/vision_wasm_internal.wasm +0 -0
- package/lib/mediaPipe/segmentation/wasm/vision_wasm_nosimd_internal.js +22 -0
- package/lib/mediaPipe/segmentation/wasm/vision_wasm_nosimd_internal.wasm +0 -0
- package/lib/models/face/models-68-extreme.bin +0 -0
- package/lib/models/face-cnn/face-det.bin +0 -0
- package/lib/models/face-cnn/face-track-19.bin +0 -0
- package/lib/models/foot/foot-detection-96x96x6.bin +0 -0
- package/lib/models/foot/foot-model.obj +3965 -0
- package/lib/models/foot/foot-tracker-96x96x13-test.bin +0 -0
- package/lib/models/foot/foot-tracker-96x96x18-test.bin +0 -0
- package/lib/models/segmentation/segmentation-160x160-opt.bin +0 -0
- package/lib/models/wrist/wrist-base-2.obj +3815 -0
- package/lib/models/wrist/wrist-det-9.bin +0 -0
- package/lib/models/wrist/wrist-track.bin +0 -0
- package/lib/wasm/deepar.wasm +0 -0
- package/lib/wasm/libxzimgPoseEstimation.wasm +0 -0
- package/lib/wasm/tfjs-backend-wasm-simd.wasm +0 -0
- package/lib/wasm/tfjs-backend-wasm-threaded-simd.wasm +0 -0
- package/lib/wasm/tfjs-backend-wasm.wasm +0 -0
- package/package.json +1 -1
- package/wasm/deepar.wasm +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for the initialization of {@link DeepAR} object.
|
|
3
|
+
*/
|
|
4
|
+
export interface DeepARParams {
|
|
5
|
+
/**
|
|
6
|
+
* License key created on <a href="https://developer.deepar.ai/">DeepAR developer portal</a> for your web app.
|
|
7
|
+
*/
|
|
8
|
+
licenseKey: string;
|
|
9
|
+
/**
|
|
10
|
+
* HTML element where AR preview will be presented.
|
|
11
|
+
*
|
|
12
|
+
* This is usually a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div">div</a> element which
|
|
13
|
+
* is used solely for AR preview. AR preview will fully occupy the previewElement's space.
|
|
14
|
+
* Therefore, position and size your previewElement according to your preferred AR preview dimensions.
|
|
15
|
+
*
|
|
16
|
+
* > NOTE: AR preview will adjust to the size of the previewElement if it changes.
|
|
17
|
+
*
|
|
18
|
+
* The canvas element will be appended as child to the previewElement. If you wish to work with the canvas element directly
|
|
19
|
+
* and position and size it yourself then use {@link canvas} parameter instead.
|
|
20
|
+
*
|
|
21
|
+
* > ⚠️ You must specify {@link previewElement} or {@link canvas}.
|
|
22
|
+
*/
|
|
23
|
+
previewElement?: HTMLElement;
|
|
24
|
+
/**
|
|
25
|
+
* The URL of a DeepAR effect file. This effect will be applied when DeepAR is initialized.
|
|
26
|
+
* This parameter is optional. You can always later switch to a different effect with {@link DeepAR.switchEffect}.
|
|
27
|
+
*/
|
|
28
|
+
effect?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Path to the root directory of the DeepAR SDK. This path will be used to locate and download all the additional needed files like ML models and wasm files.
|
|
31
|
+
* By default, this points to the JsDelivr CDN. For example "https://cdn.jsdelivr.net/npm/deepar@5.0.0/".<br>
|
|
32
|
+
*
|
|
33
|
+
* If you want to host the DeepAR SDK yourself set the path to it here. It is recommended to host DeepAR SDK on your own since then you can use compressions like gzip and brotli on the files.
|
|
34
|
+
*
|
|
35
|
+
* > ⚠️ <b>Be sure that the version of DeepAR js file and the root SDK path match!</b>
|
|
36
|
+
*
|
|
37
|
+
* DeepAR SDK can be hosted on any other server, but be sure not to change the directory and file structure of DeepAR SDK when hosing it.<br>
|
|
38
|
+
*
|
|
39
|
+
* To configure usage of non-default ML models, define them in the {@link additionalOptions}.
|
|
40
|
+
*/
|
|
41
|
+
rootPath?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Canvas element where DeepAR will render the AR preview.
|
|
44
|
+
*
|
|
45
|
+
* > ⚠️ You must specify {@link previewElement} or {@link canvas}.
|
|
46
|
+
*
|
|
47
|
+
* The preferred way is by using the {@link previewElement} parameter.
|
|
48
|
+
* In that case, the DeepAR will take care of correctly sizing the canvas.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```javascript
|
|
52
|
+
* const canvas = document.createElement('canvas')
|
|
53
|
+
* canvas.style.display = 'block'
|
|
54
|
+
*
|
|
55
|
+
* // We want to fill the whole screen.
|
|
56
|
+
* const width = window.innerWidth
|
|
57
|
+
* const height = window.innerHeight
|
|
58
|
+
* const dpr = window.devicePixelRatio || 1
|
|
59
|
+
* canvas.width = width * dpr
|
|
60
|
+
* canvas.height = height * dpr
|
|
61
|
+
* canvas.style.width = `${width}px`
|
|
62
|
+
* canvas.style.height = `${height}px`
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
canvas?: HTMLCanvasElement;
|
|
66
|
+
/**
|
|
67
|
+
* Additional DeepAR options.
|
|
68
|
+
*/
|
|
69
|
+
additionalOptions?: {
|
|
70
|
+
/**
|
|
71
|
+
* Camera options. DeepAR will use the camera by default.
|
|
72
|
+
*/
|
|
73
|
+
cameraConfig?: {
|
|
74
|
+
/**
|
|
75
|
+
* If true, DeepAR will not use camera preview by default and all the other options here are ignored in that case. You can use your own camera/video by calling {@link DeepAR.setVideoElement} or start the camera at any time by calling {@link DeepAR.startCamera}
|
|
76
|
+
*/
|
|
77
|
+
disableDefaultCamera?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Can be "user" or "environment". User will be a front facing camera on mobile devices, while environment will be the back facing camera. Default is "user".
|
|
80
|
+
*/
|
|
81
|
+
facingMode?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Called when the camera permission is asked.
|
|
84
|
+
*/
|
|
85
|
+
cameraPermissionAsked?: () => void;
|
|
86
|
+
/**
|
|
87
|
+
* Called when the camera permission is granted.
|
|
88
|
+
*/
|
|
89
|
+
cameraPermissionGranted?: () => void;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Provide a hint or hints to DeepAR to optimize the SDK in some scenarios. <br><br>
|
|
93
|
+
* Available hints:
|
|
94
|
+
* <ul>
|
|
95
|
+
* <li><b>faceModelsPredownload</b> - Will download the face models as soon as possible.</li>
|
|
96
|
+
* <li><b>segmentationModelsPredownload</b> - Will download the segmentation models as soon as possible. Note - it will not try to initialize segmentation. Segmentation will be lazy loaded when needed.</li>
|
|
97
|
+
* <li><b>footModelsPredownload</b> - Will download the foot models as soon as possible. Note - it will not try to initialize foot tracking. Foot tracking will be lazy loaded when needed.</li>
|
|
98
|
+
* <li><b>segmentationInit</b> - Will initialize segmentation as soon as possible. Without this hint segmentation is lazy loaded when some segmentation effect is loaded.</li>
|
|
99
|
+
* <li><b>footInit</b> - Will initialize foot tracking as soon as possible. Without this hint foot tracking is lazy loaded when some foot tracking effect is loaded.</li>
|
|
100
|
+
* </ul>
|
|
101
|
+
*/
|
|
102
|
+
hint?: string | string[];
|
|
103
|
+
/**
|
|
104
|
+
* Face tracking module path and options.
|
|
105
|
+
*/
|
|
106
|
+
faceTrackingConfig?: {
|
|
107
|
+
/**
|
|
108
|
+
* Path to the face tracking model. Something like "path/to/deepar/models/face/models-68-extreme.bin".
|
|
109
|
+
*/
|
|
110
|
+
modelPath: string;
|
|
111
|
+
};
|
|
112
|
+
rigidFaceTrackingConfig?: {
|
|
113
|
+
/**
|
|
114
|
+
* Path to the pose libPoseEstimation.wasm file, e.g. "/path/to/deepar/wasm/libPoseEstimation.wasm".
|
|
115
|
+
*/
|
|
116
|
+
poseEstimationWasmPath?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Path to the detector model, e.g. "/path/to/deepar/models/foot/foot-detector.bin".
|
|
119
|
+
*/
|
|
120
|
+
detectorPath?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Path to the tracker model, e.g. "/path/to/deepar/models/foot/foot-tracker.bin".
|
|
123
|
+
*/
|
|
124
|
+
trackerPath?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Path to the foot model object file, e.g. "/path/to/deepar/models/foot/foot-model.obj".
|
|
127
|
+
*/
|
|
128
|
+
objPath?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Path to tfjs-backend-wasm.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm.wasm"
|
|
131
|
+
*/
|
|
132
|
+
tfjsBackendWasmPath?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Path to tfjs-backend-wasm-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-simd.wasm"
|
|
135
|
+
*/
|
|
136
|
+
tfjsBackendWasmSimdPath?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Path to tfjs-backend-wasm-threaded-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm"
|
|
139
|
+
*/
|
|
140
|
+
tfjsBackendWasmThreadedSimdPath?: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Segmentation module path and options.
|
|
144
|
+
*/
|
|
145
|
+
segmentationConfig?: {
|
|
146
|
+
/**
|
|
147
|
+
* Path to the base segmentation model. Something like "path/to/deepar/models/segmentation/segmentation-192x192.bin".
|
|
148
|
+
* Thi is not used by default.
|
|
149
|
+
*/
|
|
150
|
+
modelPath?: string;
|
|
151
|
+
/**
|
|
152
|
+
* MediaPipe segmentation config.
|
|
153
|
+
*/
|
|
154
|
+
mediaPipeConfig?: {
|
|
155
|
+
/**
|
|
156
|
+
* Base path to wasm fileset. Something like "path/to/deepar/mediaPipe/segmentation/wasm".
|
|
157
|
+
*/
|
|
158
|
+
wasmBasePath?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Media Pipe selfie segmenter model to be used. Something like "path/to/deepar/mediaPipe/segmentation/model/selfie_segmenter.tflite"
|
|
161
|
+
*/
|
|
162
|
+
modelPath?: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Foot tracking module paths and options.
|
|
167
|
+
*/
|
|
168
|
+
footTrackingConfig?: {
|
|
169
|
+
/**
|
|
170
|
+
* Path to the pose libPoseEstimation.wasm file, e.g. "/path/to/deepar/wasm/libPoseEstimation.wasm".
|
|
171
|
+
*/
|
|
172
|
+
poseEstimationWasmPath?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Path to the detector model, e.g. "/path/to/deepar/models/foot/foot-detector.bin".
|
|
175
|
+
*/
|
|
176
|
+
detectorPath?: string;
|
|
177
|
+
/**
|
|
178
|
+
* Path to the tracker model, e.g. "/path/to/deepar/models/foot/foot-tracker.bin".
|
|
179
|
+
*/
|
|
180
|
+
trackerPath?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Path to the foot model object file, e.g. "/path/to/deepar/models/foot/foot-model.obj".
|
|
183
|
+
*/
|
|
184
|
+
objPath?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Path to tfjs-backend-wasm.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm.wasm"
|
|
187
|
+
*/
|
|
188
|
+
tfjsBackendWasmPath?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Path to tfjs-backend-wasm-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-simd.wasm"
|
|
191
|
+
*/
|
|
192
|
+
tfjsBackendWasmSimdPath?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Path to tfjs-backend-wasm-threaded-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm"
|
|
195
|
+
*/
|
|
196
|
+
tfjsBackendWasmThreadedSimdPath?: string;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Foot tracking module paths and options.
|
|
200
|
+
*/
|
|
201
|
+
wristTrackingConfig?: {
|
|
202
|
+
/**
|
|
203
|
+
* Path to the pose libPoseEstimation.wasm file, e.g. "/path/to/deepar/wasm/libPoseEstimation.wasm".
|
|
204
|
+
*/
|
|
205
|
+
poseEstimationWasmPath?: string;
|
|
206
|
+
/**
|
|
207
|
+
* Path to the detector model, e.g. "/path/to/deepar/models/foot/foot-detector.bin".
|
|
208
|
+
*/
|
|
209
|
+
detectorPath?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Path to the tracker model, e.g. "/path/to/deepar/models/foot/foot-tracker.bin".
|
|
212
|
+
*/
|
|
213
|
+
trackerPath?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Path to the foot model object file, e.g. "/path/to/deepar/models/foot/foot-model.obj".
|
|
216
|
+
*/
|
|
217
|
+
objPath?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Path to tfjs-backend-wasm.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm.wasm"
|
|
220
|
+
*/
|
|
221
|
+
tfjsBackendWasmPath?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Path to tfjs-backend-wasm-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-simd.wasm"
|
|
224
|
+
*/
|
|
225
|
+
tfjsBackendWasmSimdPath?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Path to tfjs-backend-wasm-threaded-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm"
|
|
228
|
+
*/
|
|
229
|
+
tfjsBackendWasmThreadedSimdPath?: string;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Path to deepar.wasm file. Something like "/path/to/deepar/wasm/deepar.wasm".
|
|
233
|
+
*/
|
|
234
|
+
deeparWasmPath?: string;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Enum that defines possible types of logging messages.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum LogType {
|
|
6
|
+
/**
|
|
7
|
+
* Information logging message.
|
|
8
|
+
*/
|
|
9
|
+
INFO = 1,
|
|
10
|
+
/**
|
|
11
|
+
* Warning logging message.
|
|
12
|
+
*/
|
|
13
|
+
WARNING = 2,
|
|
14
|
+
/**
|
|
15
|
+
* Error logging message.
|
|
16
|
+
*/
|
|
17
|
+
ERROR = 3
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="dom-mediacapture-transform" />
|
|
2
|
+
export declare function startMediaRecorderVideoRecording(canvas: HTMLCanvasElement, options: {
|
|
3
|
+
audioTrack?: MediaStreamAudioTrack;
|
|
4
|
+
audioBitRate?: number;
|
|
5
|
+
audioSampleRate: number;
|
|
6
|
+
videoBitRate: number;
|
|
7
|
+
videoFrameRate: number;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function finishMediaRecorderVideoRecording(): Promise<Blob>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeepAR Scripting API interop variable types.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum VarType {
|
|
5
|
+
Bool = 0,
|
|
6
|
+
Int = 1,
|
|
7
|
+
Double = 2,
|
|
8
|
+
String = 3
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A DeepAR Scripting API interop namespace.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ScriptingAPI {
|
|
14
|
+
private module;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
* @param module DeepAR emscripten module.
|
|
18
|
+
*/
|
|
19
|
+
constructor(module: any);
|
|
20
|
+
/**
|
|
21
|
+
* Check if variable with the given name is already created.
|
|
22
|
+
* @param name The variable name.
|
|
23
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
24
|
+
* @return boolean True if the variable is already created, false otherwise.
|
|
25
|
+
*/
|
|
26
|
+
hasVar(name: string, slot?: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get the type of the variable with the given name.
|
|
29
|
+
* @param name The variable name.
|
|
30
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
31
|
+
* @return VarType The variable type.
|
|
32
|
+
*/
|
|
33
|
+
getVarType(name: string, slot?: string): VarType;
|
|
34
|
+
/**
|
|
35
|
+
* Get boolean variable with the given name.
|
|
36
|
+
* @param name The variable name.
|
|
37
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
38
|
+
* @return boolean Value of the variable with the specified name.
|
|
39
|
+
*/
|
|
40
|
+
getBoolVar(name: string, slot?: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get int variable with the given name.
|
|
43
|
+
* @param name The variable name.
|
|
44
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
45
|
+
* @return int Value of the variable with the specified name.
|
|
46
|
+
*/
|
|
47
|
+
getIntVar(name: string, slot?: string): number;
|
|
48
|
+
/**
|
|
49
|
+
* Get the double variable with the given name.
|
|
50
|
+
* @param name The variable name.
|
|
51
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
52
|
+
* @return double Value of the variable with the specified name.
|
|
53
|
+
*/
|
|
54
|
+
getDoubleVar(name: string, slot?: string): number;
|
|
55
|
+
/**
|
|
56
|
+
* Get the string variable with the given name.
|
|
57
|
+
* @param name The variable name.
|
|
58
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
59
|
+
* @return string Value of the variable with the specified name.
|
|
60
|
+
*/
|
|
61
|
+
getStringVar(name: string, slot?: number): string;
|
|
62
|
+
/**
|
|
63
|
+
* Set the boolean variable with the given name.
|
|
64
|
+
* @param name The variable name.
|
|
65
|
+
* @param value Value to be set.
|
|
66
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
67
|
+
* @return True if the variable is created, false if the variable already exists and the new value is set.
|
|
68
|
+
*/
|
|
69
|
+
setBoolVar(name: string, value: boolean, slot?: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Set the int variable with the given name.
|
|
72
|
+
* @param name The variable name.
|
|
73
|
+
* @param value Value to be set.
|
|
74
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
75
|
+
* @return True if the variable is created, false if the variable already exists and the new value is set.
|
|
76
|
+
*/
|
|
77
|
+
setIntVar(name: string, value: number, slot?: string): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Set the double variable with the given name.
|
|
80
|
+
* @param name The variable name.
|
|
81
|
+
* @param value Value to be set.
|
|
82
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
83
|
+
* @return True if the variable is created, false if the variable already exists and the new value is set.
|
|
84
|
+
*/
|
|
85
|
+
setDoubleVar(name: string, value: number, slot?: string): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Set the string variable with the given name.
|
|
88
|
+
* @param name The variable name.
|
|
89
|
+
* @param value Value to be set.
|
|
90
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
91
|
+
* @return True if the variable is created, false if the variable already exists and the new value is set.
|
|
92
|
+
*/
|
|
93
|
+
setStringVar(name: string, value: string, slot?: string): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Delete variable with the given name.
|
|
96
|
+
* @param name The variable name.
|
|
97
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
98
|
+
* @return boolean True if the variable is deleted, false otherwise.
|
|
99
|
+
*/
|
|
100
|
+
deleteVar(name: string, slot?: string): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Clear all variables or variables from the specified effect.
|
|
103
|
+
* @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
|
|
104
|
+
* @return boolean True if one or more variables are deleted, false otherwise.
|
|
105
|
+
*/
|
|
106
|
+
clearVars(slot?: string): boolean;
|
|
107
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes the touch/click type.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ARTouchType {
|
|
5
|
+
/**
|
|
6
|
+
* Touch started.
|
|
7
|
+
*/
|
|
8
|
+
Start = 0,
|
|
9
|
+
/**
|
|
10
|
+
* Touch is pressed and is being moved.
|
|
11
|
+
*/
|
|
12
|
+
Move = 1,
|
|
13
|
+
/**
|
|
14
|
+
* Touch ended.
|
|
15
|
+
*/
|
|
16
|
+
End = 2
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Information about the touch. Used by {@link DeepAR.touchOccurred}.
|
|
20
|
+
*/
|
|
21
|
+
export interface ARTouchInfo {
|
|
22
|
+
/**
|
|
23
|
+
* X coordinate.
|
|
24
|
+
*/
|
|
25
|
+
x: number;
|
|
26
|
+
/**
|
|
27
|
+
* Y coordinate
|
|
28
|
+
*/
|
|
29
|
+
y: number;
|
|
30
|
+
/**
|
|
31
|
+
* Touch type.
|
|
32
|
+
*/
|
|
33
|
+
touchType: ARTouchType;
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="dom-mediacapture-transform" />
|
|
2
|
+
import { DeepARCallbacks } from './callbacks';
|
|
3
|
+
export declare function startWebCodecVideoRecording(canvas: HTMLCanvasElement, callbacks: DeepARCallbacks, options: {
|
|
4
|
+
audioTrack?: MediaStreamAudioTrack;
|
|
5
|
+
audioBitRate?: number;
|
|
6
|
+
audioSampleRate: number;
|
|
7
|
+
videoBitRate: number;
|
|
8
|
+
videoFrameRate: number;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare function finishWebCodecVideoRecording(callbacks: DeepARCallbacks): Promise<Blob>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Information about the wrist being tracked. WristData object is constructed and passed in the {@link DeepARCallbacks.onWristTracked} callback.
|
|
3
|
+
*/
|
|
4
|
+
export interface WristData {
|
|
5
|
+
/**
|
|
6
|
+
* True if the wrist is detected, false otherwise.
|
|
7
|
+
*/
|
|
8
|
+
detected: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* True if the detected wrist is of the left hande. False if the detected wrist is of the right hand.
|
|
11
|
+
*/
|
|
12
|
+
isLeft: boolean;
|
|
13
|
+
}
|
|
Binary file
|