Downloaded contents, face beautifications, and face fun bulge effects can be rendered on video frames. Such functionalities can be applied or removed through ARGContents Class in ARGSession. Types of Contents are defined in ARGContents.h as ARGContentItemType.
<Definition. ARGContentItemType>typedef NS_ENUM (NSInteger, ARGContentItemType) {ARGContentItemTypeSticker,ARGContentItemTypeFilter,ARGContentItemTypeBeauty,ARGContentItemTypeBulge,ARGContentItemTypeNum};
Using setItemWithType:withItemFilePath:withItemID method in ARGContents Class, you can set an item.
There are several types of items that can be applied in ARGContents as shown below. Currently, the contents exist in https://argear.io only can be used in ARGContents.
2D Animation Sticker / Effects (BGM Support)
2D Face Mask
Face Fun Bulge
Face Beautification
Camera Filter
3D Animation Sticker
Realtime Segmentation
3D Avatar (Blendshape 52)
The sample code below shows an example of how to set an item.
<Sample Code. An example of setting an ARG Item>/*type ARGContentItemTypefilePath Path of Downloaded ContentsitemID uuid of an Item*/ARGSession *argSession = [[ARGSession alloc] initWithARGConfig:argConfig error:&error];[[argSession contents] setItemWithType:ARGContentItemTypeSticker withItemFilePath:targetPath withItemID:uuid];
There are 16 face beautification effects in ARGContents such as V-line, face slim, jaw, chin, eye, eye gap, nose line, nose side, nose length, mouth size, eye back, eye corner, lip size, face skin, dark circle, and lip wrinkle. By applying these effects, your customers can naturally transform their faces easily.
Face beautification types are defined in ARGContentItemBeauty type in ARGContents.h. For the details of each parameter type, please refer to the table below.
<Table. Types of ARGContentItemBeauty Description>
ARGContentItemBeauty | Description | Value |
ARGContentItemBeautyVline 0 | Sharpening Jaw (V-Line) | Float ( 0 ~ 100 ) Default 0. 100 to the sharpest jaw |
ARGContentItemBeautyFaceSlim 1 | Reducing Face Width (Slimmer) | Float ( 0 ~ 100 ) Default 0. 100 to the slimmest face width |
ARGContentItemBeautyJaw 2 | Shortening Face Height (Smaller Face) | Float ( 0 ~ 100 ) Default 0. 100 to the shortest face height |
ARGContentItemBeautyChin 3 | Increasing or Decreasing Chin Length (Chin Length) | Float ( -100 ~ 100 ) Default 0 -100 to the shortest 100 to the longest |
ARGContentItemBeautyEye 4 | Increasing Eye Size (Eye Height) | Float ( 0 ~ 100 ) Default 0. 100 to the biggest |
ARGContentItemBeautyEyeGap 5 | Increasing or Decreasing the Gap Between Eyes (Gap between Eyes) | Float ( -100 ~ 100 ) Default 0 -100 to the shortest 100 to the highest |
ARGContentItemBeautyNoseLine 6 | Sharpening Nose Width (Nose Width) | Float ( 0 ~ 100 ) Default 0. 100 to the slimmest |
ARGContentItemBeautyNoseSize 7 | Shortening Width of Nostrils (Nostrils Width) | Float ( 0 ~ 100 ) Default 0. 100 to the smallest |
ARGContentItemBeautyNoseLength 8 | Increasing or Decreasing Nose Length (Nose Length) | Float ( -100 ~ 100 ) Default 0 -100 to the shortest 100 to the longest |
ARGContentItemBeautyMouthSize 9 | Increasing or Decreasing Mouth Width (Mouth Width) | Float ( -100 ~ 100 ) Default 0 -100 to the smallest 100 to the largest |
ARGContentItemBeautyEyeBack 10 | Increasing Back Side of Eyes (Width of Back Side of Eyes) | Float ( 0 ~ 100 ) Default 0. 100 to the longest |
ARGContentItemBeautyEyeCorner 11 | Increasing or Decreasing Degree of Eyes (Degree of Eyes) | Float ( -100 ~ 100 ) Default 0 -100 to the lowest 100 to the highest |
ARGContentItemBeautyLipSize 12 | Increasing or Decreasing Height Thickness of Lips (Thickness of Lips) | Float ( -100 ~ 100 ) Default 0 -100 to the thinnest 100 to the thickest |
ARGContentItemBeautySkinFace 13 | Hiding Facial Blemish (Facial Blemish Removal) | Float ( 0 ~ 100 ) Default 0. 100 to the cleanest |
ARGContentItemBeautySkinDarkCircle 14 | Hiding Dark Circles (Dark Circles Removal) | Float ( 0 ~ 100 ) Default 0. 100 to the cleanest |
ARGContentItemBeautySkinMouthWrinkle 15 | Hiding Mouth Wrinkles (Mouth Wrinkles Removal) | Float ( 0 ~ 100 ) Default 0. 100 to the cleanest |
We show how to enable face beautification first.
The sample code below shows how to enable face beautification effect.
<Sample Code. Enabling Face Beautification>ARGSession *argSession = [[ARGSession alloc] initWithARGConfig:argConfig error:&error];[[argSession.contents] setBulge:ARGContentItemBulgeNONE];[[argSession contents] setDefaultBeauty];
By setting beauty values, you can change how much level of face beautification effects should be applied.
The sample code below shows how to manipulate one or multiple face beautification effects.
<Sample Code. Manipulating Face Beautification Effects>ARGSession *argSession = [[ARGSession alloc] initWithARGConfig:argConfig error:&error];…// Set a Specific Face Beautification Effect Level[[argSession contents] setBeauty:ARGContentItemBeautyFaceSlim value:0.7f];// Set 15 Face Beautification Effects at the Same Timefloat beautyValue[BEAUTY_TYPE_NUM];beautyValue[ARGContentItemBeautyVline] = 10.f;beautyValue[ARGContentItemBeautyFaceSlim] = 90.f;beautyValue[ARGContentItemBeautyJaw] = 55.f;beautyValue[ARGContentItemBeautyChin] = -50.f;beautyValue[ARGContentItemBeautyEye] = 5.f;beautyValue[ARGContentItemBeautyEyeGap] = -10.f;beautyValue[ARGContentItemBeautyNoseLine] = 0.f;beautyValue[ARGContentItemBeautyNoseSize] = 35.f;beautyValue[ARGContentItemBeautyNoseLength] = 30.f;beautyValue[ARGContentItemBeautyMouthSize] = -35.f;beautyValue[ARGContentItemBeautyEyeBack] = 0.f;beautyValue[ARGContentItemBeautyEyeCorner] = 0.f;beautyValue[ARGContentItemBeautyLipSize] = 0.f;beautyValue[ARGContentItemBeautySkinFace] = 50.f;beautyValue[ARGContentItemBeautySkinDarkCircle] = 0.f;beautyValue[ARGContentItemBeautySkinMouthWrinkle] = 0.f;[[argSession contents] setBeautyValues:beautyValue];
setBulge function in ARGContents class allows you to set 6 types of fun bulge effects.
A sample code of fun bulge is written below.
<Sample Code. Set Face Bulge Fun Type>ARGSession *argSession = [[ARGSession alloc] initWithARGConfig:argConfig error:&error];…[[argSession contents] setBulge:1];
By calling clear method with ARGContentItemType in ARContents Class, related Contents can be removed.
A sample code is written below.
<Sample Code. Removing Contents Example>ARGSession *argSession = [[ARGSession alloc] initWithARGConfig:argConfig error:&error];…[[argSession contents] clear:ARGContentItemTypeSticker];