9. Set Contents
Downloaded contents, face beautifications, and face fun bulge effects can be rendered on video frames. These features can be applied or removed through ARGContents class in ARGSession. Types of Contents are defined in ARGContents.h as ARGContentItemType.
9.1 Set Item (2D/3D Sticker, Filter, Background, ARContents, …)
Using the setItemWithType method in the ARGContents Class, you can set an item to be rendered with the the ARGContentItemType, downloaded file, and uuid.
There are several types of items that can be applied in ARGContents as shown below. Currently, the only the contents exist in https://argear.io 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.
9.2 Apply Face Beautification Effect
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 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 |
9.2.1 Enable Face Beautification
The sample code below shows how to enable face beautification effects.
9.2.2 Face Beautification Effects Manipulation
By setting beauty values, you can change the amount face beautification effects are applied.
The sample code below shows how to manipulate one or multiple face beautification effects.
9.3 Face Fun Bulge
The setBulge function in ARGContents class allows you to set 6 types of fun bulge effects.
Sample code of fun bulge is written below.
9.4 Remove Contents
By calling clear method with the ARGContentItemType in ARContents Class, related contents can be removed.
Sample code is written below.
Last updated