TEBeautyKit is the UI panel library for the Beauty AR module, used for quick and convenient usage and management of the effect features. You can download the TEBeautyDemo from Github. The effect is as shown in the figure below:
origin: Enumeration value (YtLightImageOriginTopLeft, YtLightImageOriginBottomLeft). When setting to YtLightImageOriginBottomLeft, the image is flipped vertically
orientation: Enumeration value for image rotation angle
Image address, supports setting local images and network images. Local images support assets resources and SD resources. Assets images are as shown in the image above. For SD card images, set the full path of the image. For network images, set the corresponding HTTP link.
sdkParam
The effect SDK requires four properties. Refer to the Effect Parameters table
effectName
Effect attribute key, refer to the Effect Parameters table
effectValue
Setting the attribute intensity, refer to the Effect Parameters table
resourcePath
Setting the resource path, refer to the Effect Parameters table
extraInfo
Setting other information, refer to the Effect Parameters table
Filters, Animated Stickers and Segmentation.
Since the configuration of Filters, Animated Stickers and Segmentation is primarily identical, the JSON for filters is used here for illustration. The fields downloadPath and resourceUri are added here.
Field
Description
downloadPath
If your filter material is downloaded from the network, then the configuration here is the location of your material stored locally after download, which is a relative path, and the full path is
set in TEDownloader.h using basicPath+the path set here
resourceUri
If your material needs to be downloaded via network, configure the network address here, as in the third red box in the image above. However, if your filter material is local, configure the corresponding local address according to the figure above.
Makeup
In the Makeup, the makeupLutStrength field is added under extraInfo. This field is used to adjust the strength of the filter in the makeup material (if this makeup material supports adjusting the filter strength, configure it accordingly). This field can be referenced in the Effect Parameters table.
TEBeautyKit Method Descriptions
//Create TEBeautyKit object, do not enable the High Performance Mode
isEnableHighPerformance: Whether to enable the High Performance Mode
When the High Performance Mode is enabled, the effect feature consumes fewer system CPU/GPU resources, reducing heating and lagging of the phone, making it more suitable for prolonged use on low-end devices.
Note: After enabling the High Performance Mode, the following effect options will be unavailable:
4. Face: Slim face (natural, woman, man), chin tuck, wrinkle removal, smile lines removal. It is recommended to use "Face Shape" for comprehensive big eyes and slim face effect
// Setting effect panel, to implement the delegate of tePanelView
-(void)setTePanelView:(id)tePanelView;
// Mute Effect
-(void)setMute:(BOOL)isMute;
/**
* Set the toggle of a certain feature
*
* @param featureName Values see XmagicConstant.FeatureName
* @param enable true indicates enable, false indicates disable
*/