/// beauty filter and image processing parameter configurations export default class TXBeautyManager { private nativeSdk: any; constructor(trtcReactNativeSdk: any) { this.nativeSdk = trtcReactNativeSdk; } /** - Sets the beauty (skin smoothing) filter algorithm. @param beautyStyle Beauty style. Three beauty style: 0: smooth 1: natural 2: hazy */ setBeautyStyle(beautyStyle: number): Promise { return this.nativeSdk.setBeautyStyle({ beautyStyle }); } /** - Sets color filter. - The color filter is a color lookup table image containing color mapping relationships. You can find several predefined filter images in the official demo we provide. - The SDK performs secondary processing on the original video image captured by the camera according to the mapping relationships in the lookup table to achieve the expected filter effect. @param image Color lookup table containing color mapping relationships. The image must be in PNG format. */ setFilter(image: string): Promise { return this.nativeSdk.setFilter({ imageUrl: image }); } /** - Sets the strength of color filter. - The larger this value, the more obvious the effect of the color filter, and the greater the color difference between the video image processed by the filter and the original video image. - The default strength is 0.5, and if it is not sufficient, it can be adjusted to a value above 0.5. The maximum value is 1. @param strength Value range: 0–1. The greater the value, the more obvious the effect. Default value: 0.5 */ setFilterStrength(strength: number): Promise { return this.nativeSdk.setFilterStrength({ strength: strength.toString(), }); } /** - Sets the strength of the beauty filter. @param beautyLevel Strength of the beauty filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect. */ setBeautyLevel(beautyLevel: number): Promise { return this.nativeSdk.setBeautyLevel({ beautyLevel, }); } /** - Sets the strength of the brightening filter. @param whitenessLevel Strength of the brightening filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect. */ setWhitenessLevel(whitenessLevel: number): Promise { return this.nativeSdk.setWhitenessLevel({ whitenessLevel, }); } /** - Sets the strength of the rosy skin filter. @param ruddyLevel Strength of the rosy skin filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect. */ setRuddyLevel(ruddyLevel: number): Promise { return this.nativeSdk.setRuddyLevel({ ruddyLevel, }); } /** - Enables clarity enhancement. @param enable TRUE: Enhancement of opening sharpness; FALSE: Turn off the definition enhancement. Default value: true */ enableSharpnessEnhancement(enable: boolean): Promise { return this.nativeSdk.enableSharpnessEnhancement({ enable, }); } }