add filter effects by calling addBeautyFilter and set the filter intensity using setBeautyFilterLevel.
The filter effect can be overlayed with the global beauty effect, but multiple filters cannot apply at the same time. To replace filters, call this API repeatedly to use the new filter resource.
To add a filter, specify the path where the filter model is located using the path parameter. An absolute path on the SD card or a relative path in the asset directory are supported.
The level parameter is used to specify the filter intensity and the value range is 0,1. The default value is 0.5. The greater the value, the greater the filter intensity. You can customize the beauty intensity according to business needs.
@param path The path where the filter resource or model is located. /// An absolute path on the SD card or a relative path in the asset directory are supported.
SD card: "/storage/emulated/0/Android/data/com.xxx/files/filter_portrait/filter_style_FN1".
asset: "2D/bunny"。
@return callback 0: success. Others: failure
/
Add a sticker effect.
This interface is used to load sticker resources and add corresponding sticker effects. To replace stickers, call this API repeatedly to use new sticker resources.
Before using custom beauty effects such as filters, stickers, and makeup, you need to prepare the corresponding beauty resources or models.
The sticker effect can be overlayed with the global beauty effect, filters, and makeups, but multiple stickers cannot apply at the same time.
@param path The path where the sticker resource is located. /// An absolute path on the SD card or a relative path in the asset directory are supported.
SD card: "/storage/emulated/0/Android/data/com.xxx/files/filter_portrait/filter_style_FN1"
asset: "2D/bunny"
@return 0: success. Others: failure
/
Enable the beauty function, the setting will not be reset if your leave the channel.
The interface is used when the beauty needs to be temporarily disabled. For example, comparing the effects before and after the beauty enabled
@param isOpenBeauty true: enable beauty effect, false: disable the beauty effect
@return callback 0: success. Others: failure
/
https://doc.yunxin.163.com/docs/jcyOTA0ODM/DQ1OTY0NjI?platformId=50002#Global beauty effect
Enable the specified beauty effect and set the beauty intensity by calling setBeautyEffect.
@param beautyType specifies the beauty effect. Beauty effects such as whitening and polishing are supported. For specific enumeration values, see the table below. NERoomBeautyEffectType
@param level specifies the beauty intensity. The value range is 0,1, and the default values of various beauty effects are different. The greater the value, the greater the beauty intensity. You can customize the beauty intensity according to business needs.
@return callback 0: success. Others: failure
/
Sets the filter intensity.
The greater the value, the greater the filter intensity. You can customize the filter intensity according to business needs.
The filter intensity setting takes effect in real time. After changing the filter, the filter intensity does not change. If you need to adjust it, you can call this interface again to reset the filter intensity.
@param level Filter intensity. Value range 0 - 1. The default value is 0.5
@return 0: success. Others: failure
/
example: https://doc.yunxin.163.com/docs/jcyOTA0ODM/DQ1OTY0NjI?platformId=50002#sample code
Enable the beauty effect module.
Before starting the video, enable the beauty module by calling startBeauty. After the beauty effect is enabled, you can apply global beauty, filters and other beauty effects.
Start the beauty engine by calling this interface. If you no longer need to use the beauty function, you can disabel the beauty module by calling stopBeauty, destroy the beauty engine and release resources.
After the beauty function module is enabled, the global beauty effect is enabled by default. You can also set beauty, filter and other effects using setBeautyEffect or other filter and sticker related interfaces.
@return callback 0: success. Others: failure
/