Blame view

HHVDoctorSDK/TXLiteAVSDK_TRTC.framework/Headers/TXBeautyManager.h 12.1 KB
wangguolei authored
1 2 3 4
/**
 * Module:   美颜与图像处理参数设置类
 * Function: 修改美颜、滤镜、绿幕等参数
 */
ashen_23 authored
5
#import <Foundation/Foundation.h>
wangguolei authored
6 7 8 9 10 11 12 13
#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
typedef UIImage TXImage;
#else
#import <AppKit/AppKit.h>
typedef NSImage TXImage;
#endif
ashen_23 authored
14 15 16 17

NS_ASSUME_NONNULL_BEGIN

/// @defgroup TXBeautyManager_ios TXBeautyManager
wangguolei authored
18
/// 美颜与图像处理参数设置类
ashen_23 authored
19 20 21 22
/// @{

/**
 * 美颜(磨皮)算法
wangguolei authored
23
 * TRTC 内置多种不同的磨皮算法,您可以选择最适合您产品定位的方案。
ashen_23 authored
24 25
 */
typedef NS_ENUM(NSInteger, TXBeautyStyle) {
wangguolei authored
26 27 28 29 30 31 32 33 34

    ///光滑,算法比较激进,磨皮效果比较明显,适用于秀场直播。
    TXBeautyStyleSmooth = 0,

    ///自然,算法更多地保留了面部细节,磨皮效果更加自然,适用于绝大多数直播场景。
    TXBeautyStyleNature = 1,

    ///优图,由优图实验室提供,磨皮效果介于光滑和自然之间,比光滑保留更多皮肤细节,比自然磨皮程度更高。
    TXBeautyStylePitu = 2
ashen_23 authored
35 36 37 38 39 40 41
};

@interface TXBeautyManager : NSObject

/**
 * 设置美颜(磨皮)算法
 *
wangguolei authored
42
 * TRTC 内置多种不同的磨皮算法,您可以选择最适合您产品定位的方案:
ashen_23 authored
43
 *
wangguolei authored
44
 * @param beautyStyle 美颜风格,TXBeautyStyleSmooth:光滑;TXBeautyStyleNature:自然;TXBeautyStylePitu:优图。
ashen_23 authored
45 46 47 48 49
 */
- (void)setBeautyStyle:(TXBeautyStyle)beautyStyle;

/**
 * 设置美颜级别
wangguolei authored
50 51
 *
 * @param beautyLevel 美颜级别,取值范围0 - 9; 0表示关闭,9表示效果最明显。
ashen_23 authored
52
 */
wangguolei authored
53
- (void)setBeautyLevel:(float)beautyLevel;
ashen_23 authored
54 55 56 57

/**
 * 设置美白级别
 *
wangguolei authored
58 59 60 61 62 63
 * @param whitenessLevel 美白级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 */
- (void)setWhitenessLevel:(float)whitenessLevel;

/**
 * 开启清晰度增强
ashen_23 authored
64
 */
wangguolei authored
65
- (void)enableSharpnessEnhancement:(BOOL)enable;
ashen_23 authored
66 67 68 69

/**
 * 设置红润级别
 *
wangguolei authored
70 71 72 73 74 75 76 77 78 79
 * @param ruddyLevel 红润级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 */
- (void)setRuddyLevel:(float)ruddyLevel;

/**
 * 设置色彩滤镜效果
 *
 * 色彩滤镜,是一副包含色彩映射关系的颜色查找表图片,您可以在我们提供的官方 Demo 中找到预先准备好的几张滤镜图片。
 * SDK 会根据该查找表中的映射关系,对摄像头采集出的原始视频画面进行二次处理,以达到预期的滤镜效果。
 * @param image 包含色彩映射关系的颜色查找表图片,必须是 png 格式。
ashen_23 authored
80
 */
wangguolei authored
81
- (void)setFilter:(nullable TXImage *)image;
ashen_23 authored
82
wangguolei authored
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
/**
 * 设置色彩滤镜的强度
 *
 * 该数值越高,色彩滤镜的作用强度越明显,经过滤镜处理后的视频画面跟原画面的颜色差异越大。
 * 我默认的滤镜浓度是0.5,如果您觉得默认的滤镜效果不明显,可以设置为 0.5 以上的数字,最大值为1。
 *
 * @param strength 从0到1,数值越大滤镜效果越明显,默认值为0.5。
 */
- (void)setFilterStrength:(float)strength;

/**
 * 设置绿幕背景视频,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
 *
 * 此接口所开启的绿幕功能不具备智能去除背景的能力,需要被拍摄者的背后有一块绿色的幕布来辅助产生特效。
 *
 * @param path MP4格式的视频文件路径; 设置空值表示关闭特效。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
 */
- (int)setGreenScreenFile:(nullable NSString *)path;

/**
 * 设置大眼级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
 *
 * @param eyeScaleLevel 大眼级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
 */
ashen_23 authored
109
#if TARGET_OS_IPHONE
wangguolei authored
110 111 112
- (int)setEyeScaleLevel:(float)eyeScaleLevel;
#endif
ashen_23 authored
113
/**
wangguolei authored
114
 * 设置瘦脸级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
115
 *
wangguolei authored
116 117
 * @param faceSlimLevel 瘦脸级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
118
 */
wangguolei authored
119 120 121
#if TARGET_OS_IPHONE
- (int)setFaceSlimLevel:(float)faceSlimLevel;
#endif
ashen_23 authored
122 123

/**
wangguolei authored
124
 * 设置 V 脸级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
125
 *
wangguolei authored
126 127
 * @param faceVLevel V脸级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
128
 */
wangguolei authored
129 130 131
#if TARGET_OS_IPHONE
- (int)setFaceVLevel:(float)faceVLevel;
#endif
ashen_23 authored
132 133

/**
wangguolei authored
134
 * 设置下巴拉伸或收缩,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
135
 *
wangguolei authored
136 137
 * @param chinLevel 下巴拉伸或收缩级别,取值范围-9 - 9;0 表示关闭,小于0表示收缩,大于0表示拉伸。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
138
 */
wangguolei authored
139 140 141
#if TARGET_OS_IPHONE
- (int)setChinLevel:(float)chinLevel;
#endif
ashen_23 authored
142 143

/**
wangguolei authored
144
 * 设置短脸级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
145
 *
wangguolei authored
146 147
 * @param faceShortLevel 短脸级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
148
 */
wangguolei authored
149 150 151 152
#if TARGET_OS_IPHONE
- (int)setFaceShortLevel:(float)faceShortLevel;
#endif
ashen_23 authored
153
/**
wangguolei authored
154
 * 设置窄脸级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
155
 *
wangguolei authored
156 157
 * @param level 窄脸级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
158
 */
wangguolei authored
159 160 161
#if TARGET_OS_IPHONE
- (int)setFaceNarrowLevel:(float)faceNarrowLevel;
#endif
ashen_23 authored
162 163

/**
wangguolei authored
164
 * 设置瘦鼻级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
165
 *
wangguolei authored
166 167
 * @param noseSlimLevel 瘦鼻级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
168
 */
wangguolei authored
169 170 171
#if TARGET_OS_IPHONE
- (int)setNoseSlimLevel:(float)noseSlimLevel;
#endif
ashen_23 authored
172 173

/**
wangguolei authored
174
 * 设置亮眼级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
175
 *
wangguolei authored
176 177
 * @param eyeLightenLevel 亮眼级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
178
 */
wangguolei authored
179 180 181
#if TARGET_OS_IPHONE
- (int)setEyeLightenLevel:(float)eyeLightenLevel;
#endif
ashen_23 authored
182 183

/**
wangguolei authored
184
 * 设置牙齿美白级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
185
 *
wangguolei authored
186 187
 * @param toothWhitenLevel 白牙级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
188
 */
wangguolei authored
189 190 191
#if TARGET_OS_IPHONE
- (int)setToothWhitenLevel:(float)toothWhitenLevel;
#endif
ashen_23 authored
192 193

/**
wangguolei authored
194
 * 设置祛皱级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
195
 *
wangguolei authored
196 197
 * @param wrinkleRemoveLevel 祛皱级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
198
 */
wangguolei authored
199 200 201
#if TARGET_OS_IPHONE
- (int)setWrinkleRemoveLevel:(float)wrinkleRemoveLevel;
#endif
ashen_23 authored
202 203

/**
wangguolei authored
204
 * 设置祛眼袋级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
205
 *
wangguolei authored
206 207
 * @param pounchRemoveLevel 祛眼袋级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
208
 */
wangguolei authored
209 210 211
#if TARGET_OS_IPHONE
- (int)setPounchRemoveLevel:(float)pounchRemoveLevel;
#endif
ashen_23 authored
212 213

/**
wangguolei authored
214
 * 设置法令纹去除级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
215
 *
wangguolei authored
216 217
 * @param smileLinesRemoveLevel 法令纹级别,取值范围0 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
218
 */
wangguolei authored
219 220 221
#if TARGET_OS_IPHONE
- (int)setSmileLinesRemoveLevel:(float)smileLinesRemoveLevel;
#endif
ashen_23 authored
222 223

/**
wangguolei authored
224
 * 设置发际线调整级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
225
 *
wangguolei authored
226 227
 * @param foreheadLevel 发际线级别,取值范围-9 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
228
 */
wangguolei authored
229 230 231
#if TARGET_OS_IPHONE
- (int)setForeheadLevel:(float)foreheadLevel;
#endif
ashen_23 authored
232 233

/**
wangguolei authored
234
 * 设置眼距,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
235
 *
wangguolei authored
236 237
 * @param eyeDistanceLevel 眼距级别,取值范围-9 - 9;0表示关闭,小于0表示拉伸,大于0表示收缩。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
238
 */
wangguolei authored
239 240 241
#if TARGET_OS_IPHONE
- (int)setEyeDistanceLevel:(float)eyeDistanceLevel;
#endif
ashen_23 authored
242 243

/**
wangguolei authored
244
 * 设置眼角调整级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
245
 *
wangguolei authored
246 247
 * @param eyeAngleLevel 眼角调整级别,取值范围-9 - 9;0表示关闭,9表示效果最明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
248
 */
wangguolei authored
249 250 251
#if TARGET_OS_IPHONE
- (int)setEyeAngleLevel:(float)eyeAngleLevel;
#endif
ashen_23 authored
252 253

/**
wangguolei authored
254
 * 设置嘴型调整级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
255
 *
wangguolei authored
256 257
 * @param mouthShapeLevel 嘴型级别,取值范围-9 - 9;0表示关闭,小于0表示拉伸,大于0表示收缩。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
258
 */
wangguolei authored
259 260 261
#if TARGET_OS_IPHONE
- (int)setMouthShapeLevel:(float)mouthShapeLevel;
#endif
ashen_23 authored
262 263

/**
wangguolei authored
264
 * 设置鼻翼调整级别,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
265
 *
wangguolei authored
266 267
 * @param noseWingLevel 鼻翼调整级别,取值范围-9 - 9;0表示关闭,小于0表示拉伸,大于0表示收缩。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
268
 */
wangguolei authored
269 270 271
#if TARGET_OS_IPHONE
- (int)setNoseWingLevel:(float)noseWingLevel;
#endif
ashen_23 authored
272 273

/**
wangguolei authored
274 275 276 277
 * 设置鼻子位置,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
 *
 * @param nosePositionLevel 鼻子位置级别,取值范围-9 - 9;0表示关闭,小于0表示抬高,大于0表示降低。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
278
 */
wangguolei authored
279 280 281
#if TARGET_OS_IPHONE
- (int)setNosePositionLevel:(float)nosePositionLevel;
#endif
ashen_23 authored
282 283

/**
wangguolei authored
284 285 286 287
 * 设置嘴唇厚度,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
 *
 * @param lipsThicknessLevel 嘴唇厚度级别,取值范围-9 - 9;0表示关闭,小于0表示拉伸,大于0表示收缩。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
288
 */
wangguolei authored
289 290 291
#if TARGET_OS_IPHONE
- (int)setLipsThicknessLevel:(float)lipsThicknessLevel;
#endif
ashen_23 authored
292 293

/**
wangguolei authored
294 295 296 297
 * 设置脸型,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
 *
 * @param   faceBeautyLevel 美型级别,取值范围0 - 9;0表示关闭,1 - 9值越大,效果越明显。
 * @return 0:成功;-5:当前 License 对应 feature 不支持。
ashen_23 authored
298
 */
wangguolei authored
299 300 301
#if TARGET_OS_IPHONE
- (int)setFaceBeautyLevel:(float)faceBeautyLevel;
#endif
ashen_23 authored
302 303

/**
wangguolei authored
304
 * 选择 AI 动效挂件,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
305
 *
wangguolei authored
306 307
 * @param tmplName 动效挂件名称
 * @param tmplDir 动效素材文件所在目录
ashen_23 authored
308
 */
wangguolei authored
309
#if TARGET_OS_IPHONE
ashen_23 authored
310
- (void)setMotionTmpl:(nullable NSString *)tmplName inDir:(nullable NSString *)tmplDir;
wangguolei authored
311
#endif
ashen_23 authored
312 313

/**
wangguolei authored
314
 * 是否在动效素材播放时静音,该接口仅在 [企业版 SDK](https://cloud.tencent.com/document/product/647/32689#Enterprise) 中生效
ashen_23 authored
315 316 317 318
 * 有些挂件本身会有声音特效,通过此 API 可以关闭这些特效播放时所带的声音效果。
 *
 * @param motionMute YES:静音;NO:不静音。
 */
wangguolei authored
319
#if TARGET_OS_IPHONE
ashen_23 authored
320 321 322 323 324 325 326
- (void)setMotionMute:(BOOL)motionMute;
#endif

@end
/// @}

NS_ASSUME_NONNULL_END