iOS
This documentation explains integrating and using the TEBeautyKit library in the
XiaoShiPin project.Integration Steps
1. Integration TEBeautyKit,Edit the Podfile and append the following code snippet and execution
pod install.# Replace S1-07 with the package you purchased,Note that TEBeautyKit and TencentEffect must use the same packagepod 'TEBeautyKit/S1-07', :podspec => 'https://mediacloud-76607.gzc.vod.tencent-cloud.com/TencentEffect/iOS/TEBeautyKit/latest/TEBeautyKit.podspec'pod 'TencentEffect_S1-07', :podspec => 'https://mediacloud-76607.gzc.vod.tencent-cloud.com/TencentEffect/iOS/podspec/latest/TencentEffect_S1-07.podspec'
2. Integration Panel Resources,download the resource package and incorporate it into your main project. The contents can be found in the appendix.
3. Integration Effect Resources.
Usage Guide
Step 1: Integrated beauty panel
The beauty panel is a custom view control provided by TEBeautyKit. For how to use it, please refer to the TEBeautyKit usage guide.
Step 2: Use beauty
1. Initialization
- (void)initXMagic {__weak typeof(self)weakSelf = self;[TEBeautyKit createXMagic:EFFECT_MODE_PRO onInitListener:^(TEBeautyKit * _Nullable beautyKit) {__strong typeof(weakSelf)strongSelf = weakSelf;strongSelf.teBeautyKit = beautyKit;strongSelf.tePanelView.teBeautyKit = strongSelf.teBeautyKit;[strongSelf.tePanelView setDefaultBeauty];}];}
2. Processing video data
- (GLuint)onPreProcessTexture:(GLuint)texture width:(CGFloat)width height:(CGFloat)height {YTProcessOutput *output = [self.teBeautyKit processTexture:texturetextureWidth:widthtextureHeight:heightwithOrigin:YtLightImageOriginTopLeftwithOrientation:YtLightCameraRotation0];return output.textureData.texture;}
3. Destroy Beauty Filter
- (void)destroyXMagic {[self.teBeautyKit onDestroy];self.teBeautyKit = nil;}
