NERtc iOS SDK V4.6.10
Instance Methods | Class Methods | Properties | List of all members
NERtcBeauty Class Reference

#import <NERtcBeauty.h>

Inheritance diagram for NERtcBeauty:

Instance Methods

(int) - startBeauty
 Enables the beauty module. More...
 
(void) - stopBeauty
 Stops the beauty module. More...
 
(void) - setBeautyEffectWithValue:atType:
 Sets the beauty type and intensity. More...
 
(int) - addTempleteWithPath:andName:
 Imports beauty assets or models. More...
 
(void) - addBeautyFilterWithPath:andName:
 Add filters. More...
 
(void) - removeBeautyFilter
 Removes a filter effect. More...
 
(void) - addBeautyStickerWithPath:andName:
 Adds a sticker (beta). More...
 
(void) - removeBeautySticker
 Removes a sticker (beta). More...
 
(void) - addBeautyMakeupWithPath:andName:
 Adds a makeup effect (beta). More...
 
(void) - removeBeautyMakeup
 Removes a makeup effect (beta). More...
 
(NSString *) - getError
 Gets error messages related to beauty More...
 

Class Methods

(NERtcBeauty *) + shareInstance
 

Properties

float teeth
 Applies bright teeth. More...
 
float brightEye
 Applies bright eyes. More...
 
float whiteSkin
 Whitening. More...
 
float smoothSkin
 Smoothing. More...
 
float smallNose
 Applies a small nose. More...
 
float eyesDistance
 Adjusts the eye distance. More...
 
float eyesAngle
 Adjusts the eye angle. More...
 
float mouth
 Adjusts the mouth shape. More...
 
float bigEye
 Applies big eyes. More...
 
float smallFace
 Applies a small face. More...
 
float jaw
 Adjusts the jaw. More...
 
float thinFace
 Applies a thin face. More...
 
float faceRuddyStrength
 Applies a ruddy face. More...
 
float longNoseStrength
 Applies a long nose. More...
 
float renZhongStrength
 Adjusts the philtrum. More...
 
float mouthAngle
 Adjusts the mouth angle. More...
 
float roundEyeStrength
 Applies round eyes. More...
 
float openEyeAngleStrength
 Adjusts the eye corners. More...
 
float vFaceStrength
 Applies a V-shaped face. More...
 
float thinUnderjawStrength
 Applies a thin jaw. More...
 
float narrowFaceStrength
 Applies a narrow face. More...
 
float cheekBoneStrength
 Adjusts the cheekbone. More...
 
float faceSharpenStrength
 Sharpens the face. More...
 
float filterStrength
 Sets the filter intensity Value range: 0 - 1. More...
 
BOOL flipX
 Enables or disables the mirror mode when beauty is enabled. More...
 
BOOL isLandscape
 Set the screen to the landscape orientation when beauty is enabled The default value NO indicates that the landscape orientation is applied when beauty is enabled. More...
 
BOOL isOpenBeauty
 Pauses or resumes the beauty effect
The beauty effect is paused, including the global beauty effect, filters, stickers, and makeups, until the effect is resumed. More...
 

Method Documentation

◆ addBeautyFilterWithPath:andName:

- (void) addBeautyFilterWithPath: (NSString *)  path
andName: (NSString *)  name 

Add filters.


The API is used to load filter assets and add related filter effects. To change a filter, call this method for a new filter.

Note
  • Before applying filters, stickers, and makeups, you must call NERtcBeauty#addTempleteWithPath:andName: to import beauty assets or models.
  • A filter effect can be applied together with global beauty effects, stickers, and makeups. However, multiple filters cannot be applied at the same time.
Since
V4.2.202
Parameters
pathThe path of the filter assets or models. An absolute path is required.
nameThe name of the filter assets or model file.
Returns
  • 0: success
  • Others: failure

◆ addBeautyMakeupWithPath:andName:

- (void) addBeautyMakeupWithPath: (NSString *)  path
andName: (NSString *)  name 

Adds a makeup effect (beta).


The API is used to load makeup assets and add related sticker effects. To change a makeup effect, call this method for a new makeup effect.

Note
  • Before applying filters, stickers, and makeups, you must call NERtcBeauty#addTempleteWithPath:andName: to import beauty assets or models.
  • A makeup effect can be applied together with global beauty effects, stickers, and makeups. However, multiple makeup effects cannot be applied at the same time.
Since
V4.2.202
Parameters
pathThe path of the sticker assets or models. An absolute path is required.
nameThe name of the sticker assets or model file.
Returns
  • 0: success
  • Others: failure

◆ addBeautyStickerWithPath:andName:

- (void) addBeautyStickerWithPath: (NSString *)  path
andName: (NSString *)  name 

Adds a sticker (beta).


The API is used to load sticker assets and add related sticker effects. To change a sticker, call this method for a new sticker.

Note
  • Before applying filters, stickers, and makeups, you must call NERtcBeauty#addTempleteWithPath:andName: to import beauty assets or models.
  • A sticker effect can be applied together with global beauty effects, stickers, and makeups. However, multiple stickers cannot be applied at the same time.
Since
V4.2.202
Parameters
pathThe path of the sticker assets or models. An absolute path is required.
nameThe name of the sticker assets or model file.
Returns
  • 0: success
  • Others: failure

◆ addTempleteWithPath:andName:

- (int) addTempleteWithPath: (NSString *)  path
andName: (NSString *)  name 

Imports beauty assets or models.

Note
  • Before you use custom beauty effects, import beauty assets or models using this method.
  • If the asset directory or name does not change when the beauty feature is applied, you need to import the assets once. If you want to change the assets, you must import your assets again by calling this method.
Since
V4.2.202
Parameters
pathThe path of the beauty assets or models. An absolute path is required.
nameThe name of the beauty assets or model file.
Returns
  • 0: success
  • Others: failure

◆ getError

- (NSString *) getError

Gets error messages related to beauty

Since
V4.2.202
Returns
Error code.
  • 0: success.
  • 1: No permissions. Contact your account manager for billing rules and activate the beauty feature.
  • 100: Internal engine error. Contact the technical support for help.

◆ removeBeautyFilter

- (void) removeBeautyFilter

Removes a filter effect.

Since
V4.2.202
Returns
  • 0: success
  • Others: failure

◆ removeBeautyMakeup

- (void) removeBeautyMakeup

Removes a makeup effect (beta).

Since
V4.2.202
Returns
  • 0: success
  • Others: failure

◆ removeBeautySticker

- (void) removeBeautySticker

Removes a sticker (beta).

Since
V4.2.202
Returns
  • 0: success
  • Others: failure

◆ setBeautyEffectWithValue:atType:

- (void) setBeautyEffectWithValue: (float)  value
atType: (NERtcBeautyEffectType type 

Sets the beauty type and intensity.

  • The method can set various types of beauty effects, such as smoothing, whitening, and big eyes.
  • Multiple method calls can apply multiple global effects. Filters, stickers, and makeups can be added in the same way.
    Since
    V4.2.202
    Parameters
    typeBeauty type. For more information, see NERtcBeautyEffectType.
    valueBeauty intensity. Value range: [0, 1]. The default values of effects are different.
    Returns
  • 0: success
  • Others: failure

◆ shareInstance

+ (NERtcBeauty *) shareInstance

◆ startBeauty

- (int) startBeauty

Enables the beauty module.

  • The API starts the beauty engine. If beauty is not needed, you can call NERtcBeauty#stopBeauty to end the beauty module, destroy the beauty engine and release resources.
  • When the beauty module is enabled, no beauty effect is applied by default. You must set beauty effects or filters by calling NERtcBeauty#setBeautyEffectWithValue:atType: or other filters and stickers methods.
    Note
    The method must be called before INERtcEngine#enableLocalVideo.
    Since
    V4.2.202
    Returns
  • 0: success.
  • 30001 (kNERtcErrFatal): failure.
  • 30004 (kNERtcErrNotSupported): beauty is not supported.

◆ stopBeauty

- (void) stopBeauty

Stops the beauty module.


If the beauty module is not needed, you can call NERtcBeauty#stopBeauty to stop the module. The SDK will automatically destroy the beauty engine and release the resources.

Since
V4.2.202
Returns
  • 0: success
  • Others: failure

Property Documentation

◆ bigEye

- (float) bigEye
readwritenonatomicassign

Applies big eyes.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ brightEye

- (float) brightEye
readwritenonatomicassign

Applies bright eyes.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ cheekBoneStrength

- (float) cheekBoneStrength
readwritenonatomicassign

Adjusts the cheekbone.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ eyesAngle

- (float) eyesAngle
readwritenonatomicassign

Adjusts the eye angle.

Value range:[0.0, 1.0] 0.5 indicates no effect. 0.0 and 1.0 indicate the maximum effect. The default value is 0.5.

◆ eyesDistance

- (float) eyesDistance
readwritenonatomicassign

Adjusts the eye distance.

Value range:[0.0, 1.0] 0.5 indicates no effect. 0.0 and 1.0 indicate the maximum effect. The default value is 0.5.

◆ faceRuddyStrength

- (float) faceRuddyStrength
readwritenonatomicassign

Applies a ruddy face.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ faceSharpenStrength

- (float) faceSharpenStrength
readwritenonatomicassign

Sharpens the face.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ filterStrength

- (float) filterStrength
readwritenonatomicassign

Sets the filter intensity Value range: 0 - 1.

Default value: 0.0. A larger value indicates more intensity. Developers can adjust a custom value based on business requirements. The setting takes effect when it is applied. The intensity remains if a filter is changes. You can adjust the intensity by setting this property.

◆ flipX

- (BOOL) flipX
readwritenonatomicassign

Enables or disables the mirror mode when beauty is enabled.

The default value NO indicates that the mirror mode is enabled.

  • If beauty is enabled, this property enables or disables the mirror mode. The mirror mode is disabled by default. If beauty is paused or disabled, the property becomes invalid.
  • After the mirror mode is enabled, the local screen will flip left and right.
  • This property is deprecated.

◆ isLandscape

- (BOOL) isLandscape
readwritenonatomicassign

Set the screen to the landscape orientation when beauty is enabled The default value NO indicates that the landscape orientation is applied when beauty is enabled.

  • If beauty is enabled, this property sets the screen to the landscape orientation. The landscape orientation is disabled by default. If beauty is paused or disabled, the property becomes invalid.
  • If the screen is set to the landscape orientation, the images will be processed in the landscape orientation.
  • This property is deprecated.

◆ isOpenBeauty

- (BOOL) isOpenBeauty
readwritenonatomicassign

Pauses or resumes the beauty effect
The beauty effect is paused, including the global beauty effect, filters, stickers, and makeups, until the effect is resumed.

Note
Beauty effect is enabled by default. If you want to temporarily disable the beauty effect, call the isOpenBeauty method after invoking startBeauty.
Since
V4.2.202
Parameters
enablespecifies whether to resume the beauty effect.
  • YES (default): resumes the beauty effect.
  • NO: pauses the beauty effect.
Returns
  • 0: success
  • Others: failure

◆ jaw

- (float) jaw
readwritenonatomicassign

Adjusts the jaw.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ longNoseStrength

- (float) longNoseStrength
readwritenonatomicassign

Applies a long nose.

Value range:[0.0, 1.0] 0.5 indicates no effect. 0.0 and 1.0 indicate the maximum effect. The default value is 0.5.

◆ mouth

- (float) mouth
readwritenonatomicassign

Adjusts the mouth shape.

Value range:[0.0, 1.0] 0.5 indicates no effect. 0.0 and 1.0 indicate the maximum effect. The default value is 0.5.

◆ mouthAngle

- (float) mouthAngle
readwritenonatomicassign

Adjusts the mouth angle.

Value range:[0.0, 1.0] 0.5 indicates no effect. 0.0 and 1.0 indicate the maximum effect. The default value is 0.5.

◆ narrowFaceStrength

- (float) narrowFaceStrength
readwritenonatomicassign

Applies a narrow face.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ openEyeAngleStrength

- (float) openEyeAngleStrength
readwritenonatomicassign

Adjusts the eye corners.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ renZhongStrength

- (float) renZhongStrength
readwritenonatomicassign

Adjusts the philtrum.

Value range:[0.0, 1.0] 0.5 indicates no effect. 0.0 and 1.0 indicate the maximum effect. The default value is 0.5.

◆ roundEyeStrength

- (float) roundEyeStrength
readwritenonatomicassign

Applies round eyes.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ smallFace

- (float) smallFace
readwritenonatomicassign

Applies a small face.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ smallNose

- (float) smallNose
readwritenonatomicassign

Applies a small nose.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ smoothSkin

- (float) smoothSkin
readwritenonatomicassign

Smoothing.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ teeth

- (float) teeth
readwritenonatomicassign

Applies bright teeth.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ thinFace

- (float) thinFace
readwritenonatomicassign

Applies a thin face.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ thinUnderjawStrength

- (float) thinUnderjawStrength
readwritenonatomicassign

Applies a thin jaw.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ vFaceStrength

- (float) vFaceStrength
readwritenonatomicassign

Applies a V-shaped face.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.

◆ whiteSkin

- (float) whiteSkin
readwritenonatomicassign

Whitening.

Value range:[0.0, 1.0] 0.0 indicates no effect. 1.0 indicates the maximum effect. The default value is 0.0.


The documentation for this class was generated from the following file: