makeup|SDK
makeup|SDK is a library based on visage|SDK face tracking used to configure and render virtual makeup.
Loading...
Searching...
No Matches
Instance Methods | Class Methods | Properties | List of all members
FeatureTemplate Class Reference

#import <FeatureTemplate.h>

Inherits NSObject.

Instance Methods

(NSMutableDictionary *) - ToJSON
 
(NSString *) - ToJSONString
 

Class Methods

(FeatureTemplate *) + FromJSONString:
 
(FeatureTemplate *) + FromJSON:
 

Properties

NSString * name
 
NSString * type
 
NSMutableArray< ElementTemplate * > * elements
 

Detailed Description

Stores a definition of makeup feature. One makeup feature contains all information required to render virtual makeup:

One FeatureTemplate instance can contain multiple rendering elements which share the mesh but can have different application area, color or blending and filtering algorithm. The simplest use-case for this class is using one of the predefined template specified in FeatureTemplateRepository obtained from MakeUpEngine::getStyles function and setting the color of each element in elements array.

FeatureTemplate is defined by the following:

The following types are supported:

Each type maps to a single mesh. The meshes used are stored in .obj format in the "Assets/Models" folder. The name of the .obj corresponds to the type name.

Additionally, this class provides methods for serialization and deserialization of FeatureTemplate instances from and to JSON format.

Method Documentation

◆ FromJSON:

+ (FeatureTemplate *) FromJSON: (NSDictionary *)  jsonDictionary

Deserializes FeatureTemplate object from JSON representation.

Parameters
jsonDictionaryJSON dictionary
Returns
deserialized FeatureTemplate object

◆ FromJSONString:

+ (FeatureTemplate *) FromJSONString: (NSString *)  JSON_data

Returns FeatureTemplate object out of JSON string.

Parameters
JSON_dataJSON string
Returns
deserialized FeatureTemplate object

◆ ToJSON

- (NSMutableDictionary *) ToJSON

Creates JSON representation out of this FeatureTemplate object.

Returns
JSON representation of this FeatureTemplate returned as NSMutableDictionary

◆ ToJSONString

- (NSString *) ToJSONString

Creates JSON string out of FeatureTemplate object.

Parameters
featureTemplateFeatureTemplate object
Returns
JSON representation of this FeatureTemplate returned as string

Property Documentation

◆ elements

- (NSMutableArray<ElementTemplate*>*) elements
readwritenonatomicstrong

A list of elements required for rendering this feature.

◆ name

- (NSString*) name
readwritenonatomicstrong

Name of the feature.

◆ type

- (NSString*) type
readwritenonatomicstrong

Type of the feature. Specifies one of the predefined meshes to use to represent this feature.