LiteAVSDK
Tencent Cloud TRTC SDK, is a high availability components serving tens of thousands of enterprise customers, which is committed to helping you to minimize your research and development costs.
TXBeautyManager

Data Structures

class  TXBeautyManager
 

Enumerations

enum  TXBeautyStyle : NSInteger
 

Detailed Description

Beauty filter and animated effect parameter management.


Data Structure Documentation

◆ TXBeautyManager

class TXBeautyManager
+ Inheritance diagram for TXBeautyManager:

Instance Methods

(void) - setBeautyStyle:
 
(void) - setBeautyLevel:
 
(void) - setWhitenessLevel:
 
(void) - enableSharpnessEnhancement:
 
(void) - setRuddyLevel:
 
(void) - setFilter:
 
(void) - setFilterStrength:
 
(int) - setGreenScreenFile:
 
(int) - setEyeScaleLevel:
 
(int) - setFaceSlimLevel:
 
(int) - setFaceVLevel:
 
(int) - setChinLevel:
 
(int) - setFaceShortLevel:
 
(int) - setFaceNarrowLevel:
 
(int) - setNoseSlimLevel:
 
(int) - setEyeLightenLevel:
 
(int) - setToothWhitenLevel:
 
(int) - setWrinkleRemoveLevel:
 
(int) - setPounchRemoveLevel:
 
(int) - setSmileLinesRemoveLevel:
 
(int) - setForeheadLevel:
 
(int) - setEyeDistanceLevel:
 
(int) - setEyeAngleLevel:
 
(int) - setMouthShapeLevel:
 
(int) - setNoseWingLevel:
 
(int) - setNosePositionLevel:
 
(int) - setLipsThicknessLevel:
 
(int) - setFaceBeautyLevel:
 
(void) - setMotionTmpl:inDir:
 
(void) - setMotionMute:
 

Method Documentation

◆ enableSharpnessEnhancement:()

- (void) enableSharpnessEnhancement: (BOOL)  enable

Enables clarity enhancement.

◆ setBeautyLevel:()

- (void) setBeautyLevel: (float)  beautyLevel

Sets the strength of the beauty filter.

Parameters
beautyLevelStrength of the beauty filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.

◆ setBeautyStyle:()

- (void) setBeautyStyle: (TXBeautyStyle beautyStyle

Sets the beauty (skin smoothing) filter algorithm.

TRTC has multiple built-in skin smoothing algorithms. You can select the one most suitable for your product needs:

Parameters
beautyStyleBeauty filter style. TXBeautyStyleSmooth: smooth; TXBeautyStyleNature: natural; TXBeautyStylePitu: Pitu

◆ setChinLevel:()

- (int) setChinLevel: (float)  chinLevel

Sets the strength of the chin lengthening/shortening filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
chinLevelStrength of the chin lengthening/shortening filter. Value range: -9–9. 0 indicates to disable the filter, a value smaller than 0 indicates that the chin is shortened, and a value greater than 0 indicates that the chin is lengthened.
Returns
0: Success; -5: feature of license not supported.

◆ setEyeAngleLevel:()

- (int) setEyeAngleLevel: (float)  eyeAngleLevel

Sets the strength of the eye corner adjustment filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
eyeAngleLevelStrength of the eye corner adjustment filter. Value range: -9–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setEyeDistanceLevel:()

- (int) setEyeDistanceLevel: (float)  eyeDistanceLevel

Sets the strength of the eye distance adjustment filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
eyeDistanceLevelStrength of the eye distance adjustment filter. Value range: -9–9. 0 indicates to disable the filter, a value smaller than 0 indicates to widen, and a value greater than 0 indicates to narrow.
Returns
0: Success; -5: feature of license not supported.

◆ setEyeLightenLevel:()

- (int) setEyeLightenLevel: (float)  eyeLightenLevel

Sets the strength of the eye brightening filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
eyeLightenLevelStrength of the eye brightening filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setEyeScaleLevel:()

- (int) setEyeScaleLevel: (float)  eyeScaleLevel

Sets the strength of the eye enlarging filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
eyeScaleLevelStrength of the eye enlarging filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setFaceBeautyLevel:()

- (int) setFaceBeautyLevel: (float)  faceBeautyLevel

Sets the strength of the face shape adjustment filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
faceBeautyLevelStrength of the face shape adjustment filter. Value range: 0–9. 0 indicates to disable the filter, and the greater the value, the more obvious the effect.
Returns
0: Success; -5: feature of license not supported.

◆ setFaceNarrowLevel:()

- (int) setFaceNarrowLevel: (float)  faceNarrowLevel

Sets the strength of the face narrowing filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
levelStrength of the face narrowing filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setFaceShortLevel:()

- (int) setFaceShortLevel: (float)  faceShortLevel

Sets the strength of the face shortening filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
faceShortLevelStrength of the face shortening filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setFaceSlimLevel:()

- (int) setFaceSlimLevel: (float)  faceSlimLevel

Sets the strength of the face slimming filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
faceSlimLevelStrength of the face slimming filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setFaceVLevel:()

- (int) setFaceVLevel: (float)  faceVLevel

Sets the strength of the chin slimming filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
faceVLevelStrength of the chin slimming filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setFilter:()

- (void) setFilter: (nullable TXImage *)  image

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.

Parameters
imageColor lookup table containing color mapping relationships. The image must be in PNG format.

◆ setFilterStrength:()

- (void) setFilterStrength: (float)  strength

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.

Parameters
strengthValue range: 0–1. The greater the value, the more obvious the effect. Default value: 0.5

◆ setForeheadLevel:()

- (int) setForeheadLevel: (float)  foreheadLevel

Sets the strength of the hairline adjustment filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
foreheadLevelStrength of the hairline adjustment filter. Value range: -9–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setGreenScreenFile:()

- (int) setGreenScreenFile: (nullable NSString *)  path

Sets green screen video. This API takes effect only in the Enterprise Edition SDK.

The green screen feature enabled by this API is not capable of intelligent keying. It requires that there be a green screen behind the videoed person or object for further chroma keying.

Parameters
pathPath of the video file in MP4 format. An empty value indicates to disable the effect.
Returns
0: Success; -5: feature of license not supported.

◆ setLipsThicknessLevel:()

- (int) setLipsThicknessLevel: (float)  lipsThicknessLevel

Sets the strength of the lip thickness adjustment filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
lipsThicknessLevelStrength of the lip thickness adjustment filter. Value range: -9–9. 0 indicates to disable the filter, a value smaller than 0 indicates to thicken, and a value greater than 0 indicates to thin.
Returns
0: Success; -5: feature of license not supported.

◆ setMotionMute:()

- (void) setMotionMute: (BOOL)  motionMute

Sets whether to mute during animated effect playback. This API takes effect only in the Enterprise Edition SDK. Some animated effects have audio effects, which can be disabled through this API when they are played back.

Parameters
motionMuteYES: mute; NO: unmute

◆ setMotionTmpl:inDir:()

- (void) setMotionTmpl: (nullable NSString *)  tmplName
inDir: (nullable NSString *)  tmplDir 

Selects the AI animated effect pendant. This API takes effect only in the Enterprise Edition SDK.

Parameters
tmplNameAnimated effect pendant name
tmplDirDirectory of the animated effect material file

◆ setMouthShapeLevel:()

- (int) setMouthShapeLevel: (float)  mouthShapeLevel

Sets the strength of the mouth shape adjustment filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
mouthShapeLevelStrength of the mouth shape adjustment filter. Value range: -9–9. 0 indicates to disable the filter, a value smaller than 0 indicates to widen, and a value greater than 0 indicates to narrow.
Returns
0: Success; -5: feature of license not supported.

◆ setNosePositionLevel:()

- (int) setNosePositionLevel: (float)  nosePositionLevel

Sets the strength of the nose position adjustment filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
nosePositionLevelStrength of the nose position adjustment filter. Value range: -9–9. 0 indicates to disable the filter, a value smaller than 0 indicates to lift, and a value greater than 0 indicates to lower.
Returns
0: Success; -5: feature of license not supported.

◆ setNoseSlimLevel:()

- (int) setNoseSlimLevel: (float)  noseSlimLevel

Sets the strength of the nose slimming filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
noseSlimLevelStrength of the nose slimming filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setNoseWingLevel:()

- (int) setNoseWingLevel: (float)  noseWingLevel

Sets the strength of the nose wing narrowing filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
noseWingLevelStrength of the nose wing adjustment filter. Value range: -9–9. 0 indicates to disable the filter, a value smaller than 0 indicates to widen, and a value greater than 0 indicates to narrow.
Returns
0: Success; -5: feature of license not supported.

◆ setPounchRemoveLevel:()

- (int) setPounchRemoveLevel: (float)  pounchRemoveLevel

Sets the strength of the eye bag removal filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
pounchRemoveLevelStrength of the eye bag removal filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setRuddyLevel:()

- (void) setRuddyLevel: (float)  ruddyLevel

Sets the strength of the rosy skin filter.

Parameters
ruddyLevelStrength of the rosy skin filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.

◆ setSmileLinesRemoveLevel:()

- (int) setSmileLinesRemoveLevel: (float)  smileLinesRemoveLevel

Sets the strength of the smile line removal filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
smileLinesRemoveLevelStrength of the smile line removal filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setToothWhitenLevel:()

- (int) setToothWhitenLevel: (float)  toothWhitenLevel

Sets the strength of the teeth whitening filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
toothWhitenLevelStrength of the teeth whitening filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

◆ setWhitenessLevel:()

- (void) setWhitenessLevel: (float)  whitenessLevel

Sets the strength of the brightening filter.

Parameters
whitenessLevelStrength of the brightening filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.

◆ setWrinkleRemoveLevel:()

- (int) setWrinkleRemoveLevel: (float)  wrinkleRemoveLevel

Sets the strength of the wrinkle removal filter. This API takes effect only in the Enterprise Edition SDK.

Parameters
wrinkleRemoveLevelStrength of the wrinkle removal filter. Value range: 0–9. 0 indicates to disable the filter, and 9 indicates the most obvious effect.
Returns
0: Success; -5: feature of license not supported.

Enumeration Type Documentation

◆ TXBeautyStyle

enum TXBeautyStyle : NSInteger

Beauty (skin smoothing) filter algorithm TRTC has multiple built-in skin smoothing algorithms. You can select the one most suitable for your product needs.

Enumerator
TXBeautyStyleSmooth 

Smooth style, which uses a more radical algorithm for more obvious effect and is suitable for show live streaming.

TXBeautyStyleNature 

Natural style, which retains more facial details for more natural effect and is suitable for most live streaming use cases.

TXBeautyStylePitu 

Pitu style, which is provided by YouTu Lab. Its skin smoothing effect is between the smooth style and the natural style, that is, it retains more skin details than the smooth style and has a higher skin smoothing degree than the natural style.