agora-electron-sdk 4.5.3-dev.1 → 4.5.3-dev.2
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/CHANGELOG.md +2 -0
- package/js/example/src/renderer/examples/advanced/VideoEffect/videoEffectHelpers.js +88 -1
- package/package.json +1 -1
- package/types/example/src/renderer/examples/advanced/VideoEffect/videoEffectHelpers.d.ts +38 -0
- package/types/example/src/renderer/examples/advanced/VideoEffect/videoEffectHelpers.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildFaceShapeEffectOperations = exports.buildMakeupEffectOperations = exports.releaseVideoEffectResources = exports.resolveVideoEffectBundlePath = exports.getFaceShapeAreaParamName = exports.mapUiToResourceId = exports.FACE_SHAPE_STYLE_ITEMS = exports.FACE_SHAPE_AREA_ITEMS = exports.toIndexedItems = exports.MAKEUP_ITEMS = exports.DEFAULT_FACE_SHAPE_OPTIONS = exports.FACE_SHAPE_BEAUTY_STYLES = exports.FACE_SHAPE_AREAS = exports.DEFAULT_MAKEUP_OPTIONS = exports.VIDEO_EFFECT_BUNDLE_RELATIVE_PATH_CANDIDATES = exports.DEFAULT_VIDEO_EFFECT_BUNDLE_RELATIVE_PATH = exports.CLEAR_VISION_EXTENSION_NAME = exports.CLEAR_VISION_EXTENSION_PROVIDER = void 0;
|
|
3
|
+
exports.buildFaceShapeEffectOperations = exports.buildMakeupEffectOperations = exports.buildStyleEffectOperations = exports.buildSdkDrivenBeautyOperations = exports.releaseVideoEffectResources = exports.resolveVideoEffectBundlePath = exports.getFaceShapeAreaParamName = exports.mapUiToResourceId = exports.FACE_SHAPE_STYLE_ITEMS = exports.FACE_SHAPE_AREA_ITEMS = exports.toIndexedItems = exports.MAKEUP_ITEMS = exports.DEFAULT_SDK_DRIVEN_BEAUTY_OPTIONS = exports.DEFAULT_FACE_SHAPE_OPTIONS = exports.FACE_SHAPE_BEAUTY_STYLES = exports.FACE_SHAPE_AREAS = exports.DEFAULT_MAKEUP_OPTIONS = exports.FILTER_TEMPLATES = exports.STYLE_MAKEUP_TEMPLATES = exports.BEAUTY_TEMPLATES = exports.VIDEO_EFFECT_BUNDLE_RELATIVE_PATH_CANDIDATES = exports.DEFAULT_VIDEO_EFFECT_BUNDLE_RELATIVE_PATH = exports.CLEAR_VISION_EXTENSION_NAME = exports.CLEAR_VISION_EXTENSION_PROVIDER = exports.CUSTOM_VIDEO_EFFECT_BUNDLE_RELATIVE_PATH = void 0;
|
|
4
4
|
const agora_electron_sdk_1 = require("agora-electron-sdk");
|
|
5
|
+
exports.CUSTOM_VIDEO_EFFECT_BUNDLE_RELATIVE_PATH = 'AgoraBeautyMaterial/beauty_material_functional';
|
|
5
6
|
exports.CLEAR_VISION_EXTENSION_PROVIDER = 'agora_video_filters_clear_vision';
|
|
6
7
|
exports.CLEAR_VISION_EXTENSION_NAME = 'clear_vision';
|
|
7
8
|
exports.DEFAULT_VIDEO_EFFECT_BUNDLE_RELATIVE_PATH = 'beauty_agora/beauty_material.bundle/beauty_material_v2.0.0';
|
|
@@ -11,6 +12,32 @@ exports.VIDEO_EFFECT_BUNDLE_RELATIVE_PATH_CANDIDATES = [
|
|
|
11
12
|
'beauty_material.bundle/beauty_material_v2.0.0',
|
|
12
13
|
'beauty_material.bundle/beauty_material_v2.0.0_encrypted',
|
|
13
14
|
];
|
|
15
|
+
exports.BEAUTY_TEMPLATES = {
|
|
16
|
+
basic: {
|
|
17
|
+
label: 'Basic (基础)',
|
|
18
|
+
templateName: 'Beauty-Basic',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
exports.STYLE_MAKEUP_TEMPLATES = {
|
|
22
|
+
none: {
|
|
23
|
+
label: 'None',
|
|
24
|
+
templateName: null,
|
|
25
|
+
},
|
|
26
|
+
natural: {
|
|
27
|
+
label: 'Natural (百熙)',
|
|
28
|
+
templateName: 'Makeup-Natural',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
exports.FILTER_TEMPLATES = {
|
|
32
|
+
none: {
|
|
33
|
+
label: 'None',
|
|
34
|
+
templateName: null,
|
|
35
|
+
},
|
|
36
|
+
whiteTea: {
|
|
37
|
+
label: 'Whitetea (白茶)',
|
|
38
|
+
templateName: 'Filter-Whitetea',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
14
41
|
exports.DEFAULT_MAKEUP_OPTIONS = {
|
|
15
42
|
enable_mu: false,
|
|
16
43
|
browStyle: 0,
|
|
@@ -55,6 +82,14 @@ exports.DEFAULT_FACE_SHAPE_OPTIONS = {
|
|
|
55
82
|
shapeStyle: exports.FACE_SHAPE_BEAUTY_STYLES.FaceShapeBeautyStyleFemale,
|
|
56
83
|
styleIntensity: 0,
|
|
57
84
|
};
|
|
85
|
+
exports.DEFAULT_SDK_DRIVEN_BEAUTY_OPTIONS = {
|
|
86
|
+
smoothness: 0.5,
|
|
87
|
+
lightness: 0.3,
|
|
88
|
+
redness: 0,
|
|
89
|
+
eyePouch: 0,
|
|
90
|
+
faceStyle: -1,
|
|
91
|
+
faceIntensity: 50,
|
|
92
|
+
};
|
|
58
93
|
exports.MAKEUP_ITEMS = {
|
|
59
94
|
browStyle: ['CLOSE', 'eyebrow001', 'eyebrow002', 'eyebrow003'],
|
|
60
95
|
browColor: ['Brown', 'Gray Brown', 'Dark Brown'],
|
|
@@ -183,6 +218,58 @@ function releaseVideoEffectResources(engine, videoEffectObject) {
|
|
|
183
218
|
engine?.enableExtension?.(exports.CLEAR_VISION_EXTENSION_PROVIDER, exports.CLEAR_VISION_EXTENSION_NAME, false, agora_electron_sdk_1.MediaSourceType.PrimaryCameraSource);
|
|
184
219
|
}
|
|
185
220
|
exports.releaseVideoEffectResources = releaseVideoEffectResources;
|
|
221
|
+
function buildSdkDrivenBeautyOperations(options) {
|
|
222
|
+
return [
|
|
223
|
+
{
|
|
224
|
+
kind: 'float',
|
|
225
|
+
option: 'beauty_effect_option',
|
|
226
|
+
key: 'smoothness',
|
|
227
|
+
value: options.smoothness,
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
kind: 'float',
|
|
231
|
+
option: 'beauty_effect_option',
|
|
232
|
+
key: 'lightness',
|
|
233
|
+
value: options.lightness,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
kind: 'float',
|
|
237
|
+
option: 'beauty_effect_option',
|
|
238
|
+
key: 'redness',
|
|
239
|
+
value: options.redness,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
kind: 'float',
|
|
243
|
+
option: 'face_buffing_option',
|
|
244
|
+
key: 'eye_pouch',
|
|
245
|
+
value: options.eyePouch,
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
kind: 'int',
|
|
249
|
+
option: 'face_shape_beauty_option',
|
|
250
|
+
key: 'style',
|
|
251
|
+
value: options.faceStyle,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
kind: 'int',
|
|
255
|
+
option: 'face_shape_beauty_option',
|
|
256
|
+
key: 'intensity',
|
|
257
|
+
value: options.faceIntensity,
|
|
258
|
+
},
|
|
259
|
+
];
|
|
260
|
+
}
|
|
261
|
+
exports.buildSdkDrivenBeautyOperations = buildSdkDrivenBeautyOperations;
|
|
262
|
+
function buildStyleEffectOperations(option, value) {
|
|
263
|
+
return [
|
|
264
|
+
{
|
|
265
|
+
kind: 'float',
|
|
266
|
+
option,
|
|
267
|
+
key: option === 'style_effect_option' ? 'styleIntensity' : 'strength',
|
|
268
|
+
value,
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
}
|
|
272
|
+
exports.buildStyleEffectOperations = buildStyleEffectOperations;
|
|
186
273
|
function buildMakeupEffectOperations(options) {
|
|
187
274
|
const operations = [
|
|
188
275
|
{
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MediaSourceType } from 'agora-electron-sdk';
|
|
2
|
+
export declare const CUSTOM_VIDEO_EFFECT_BUNDLE_RELATIVE_PATH = "AgoraBeautyMaterial/beauty_material_functional";
|
|
2
3
|
export declare const CLEAR_VISION_EXTENSION_PROVIDER = "agora_video_filters_clear_vision";
|
|
3
4
|
export declare const CLEAR_VISION_EXTENSION_NAME = "clear_vision";
|
|
4
5
|
export declare const DEFAULT_VIDEO_EFFECT_BUNDLE_RELATIVE_PATH = "beauty_agora/beauty_material.bundle/beauty_material_v2.0.0";
|
|
@@ -34,6 +35,40 @@ export interface FaceShapeOptions {
|
|
|
34
35
|
shapeStyle: number;
|
|
35
36
|
styleIntensity: number;
|
|
36
37
|
}
|
|
38
|
+
export interface SdkDrivenBeautyOptions {
|
|
39
|
+
smoothness: number;
|
|
40
|
+
lightness: number;
|
|
41
|
+
redness: number;
|
|
42
|
+
eyePouch: number;
|
|
43
|
+
faceStyle: number;
|
|
44
|
+
faceIntensity: number;
|
|
45
|
+
}
|
|
46
|
+
export declare const BEAUTY_TEMPLATES: {
|
|
47
|
+
readonly basic: {
|
|
48
|
+
readonly label: "Basic (基础)";
|
|
49
|
+
readonly templateName: "Beauty-Basic";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const STYLE_MAKEUP_TEMPLATES: {
|
|
53
|
+
readonly none: {
|
|
54
|
+
readonly label: "None";
|
|
55
|
+
readonly templateName: null;
|
|
56
|
+
};
|
|
57
|
+
readonly natural: {
|
|
58
|
+
readonly label: "Natural (百熙)";
|
|
59
|
+
readonly templateName: "Makeup-Natural";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const FILTER_TEMPLATES: {
|
|
63
|
+
readonly none: {
|
|
64
|
+
readonly label: "None";
|
|
65
|
+
readonly templateName: null;
|
|
66
|
+
};
|
|
67
|
+
readonly whiteTea: {
|
|
68
|
+
readonly label: "Whitetea (白茶)";
|
|
69
|
+
readonly templateName: "Filter-Whitetea";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
37
72
|
export declare const DEFAULT_MAKEUP_OPTIONS: MakeupOptions;
|
|
38
73
|
export declare const FACE_SHAPE_AREAS: {
|
|
39
74
|
readonly FaceShapeAreaNone: -1;
|
|
@@ -55,6 +90,7 @@ export declare const FACE_SHAPE_BEAUTY_STYLES: {
|
|
|
55
90
|
readonly FaceShapeBeautyStyleMale: 1;
|
|
56
91
|
};
|
|
57
92
|
export declare const DEFAULT_FACE_SHAPE_OPTIONS: FaceShapeOptions;
|
|
93
|
+
export declare const DEFAULT_SDK_DRIVEN_BEAUTY_OPTIONS: SdkDrivenBeautyOptions;
|
|
58
94
|
export declare const MAKEUP_ITEMS: {
|
|
59
95
|
browStyle: string[];
|
|
60
96
|
browColor: string[];
|
|
@@ -125,6 +161,8 @@ export declare function releaseVideoEffectResources(engine: {
|
|
|
125
161
|
destroyVideoEffectObject?: (videoEffectObject: any) => void;
|
|
126
162
|
enableExtension?: (provider: string, extension: string, enable?: boolean, type?: MediaSourceType) => void;
|
|
127
163
|
} | undefined, videoEffectObject: any): void;
|
|
164
|
+
export declare function buildSdkDrivenBeautyOperations(options: SdkDrivenBeautyOptions): VideoEffectOperation[];
|
|
165
|
+
export declare function buildStyleEffectOperations(option: 'style_effect_option' | 'filter_effect_option', value: number): VideoEffectOperation[];
|
|
128
166
|
export declare function buildMakeupEffectOperations(options: MakeupOptions): VideoEffectOperation[];
|
|
129
167
|
export declare function buildFaceShapeEffectOperations(options: FaceShapeOptions): VideoEffectOperation[];
|
|
130
168
|
//# sourceMappingURL=videoEffectHelpers.d.ts.map
|
package/types/example/src/renderer/examples/advanced/VideoEffect/videoEffectHelpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoEffectHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../example/src/renderer/examples/advanced/VideoEffect/videoEffectHelpers.
|
|
1
|
+
{"version":3,"file":"videoEffectHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../example/src/renderer/examples/advanced/VideoEffect/video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