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 | List of all members
MakeupEngine Class Reference

#import <MakeupEngine.h>

Inheritance diagram for MakeupEngine:
MakeUpEngine

Instance Methods

(void) - AddObserver:
 
(FeatureTemplateRepository *) - GetFeatures
 
(void) - CreateMakeup:featureTemplate:
 
(void) - CreateMakeup:featureTemplate:finishTemplate:
 
(void) - DisplayMakeup:
 
(void) - UpdateMakeup:
 
(void) - ClearMakeup
 
(void) - HideMakeup:
 
(void) - RemoveMakeup:
 
(void) - Reset
 
(void) - SetCameraDevice:
 
(FinishTemplateRepository *) - GetFinishes
 
(UIView *) - GetView
 Retrieve surface that displays the resulting output of the makeup engine. Resizing of the surface is tied to the quality of the rendering pipeline. Higher resolutions give better fidelity but at the cost of performance. For the highest quality keep the aspect ratio of input images and the surface similar.
 

Detailed Description

This class is part of the SDK's core functionality.
It primarily serves two key functions:
Manipulating the current output of the view throught creating, displaying, updating, hiding, and removing makeup effects.
Exposure of FeatureTemplateRepository and FinishTemplateRepository deserialized from Feature.json and finishes.json files.

Method Documentation

◆ AddObserver:

- (void) AddObserver: (id< IMakeupObserver >)  observer

Attaches observer to the engine. IMakeupObserver is used to obtain event notifications from the engine.

Parameters
observerInstance of IMakeupObserver

◆ ClearMakeup

- (void) ClearMakeup

Destroys all created makeup effects.

◆ CreateMakeup:featureTemplate:

- (void) CreateMakeup: (FeatureTemplate *) 
featureTemplate: (FinishTemplate *)  finishTemplate 

Creates makeup effect from given feature and finish templates. Returns the id of the created effect via IMakeupObserver interface.

Parameters
featureTemplateFeatureTemplate object
finishTemplateFinishTemplate object

◆ CreateMakeup:featureTemplate:finishTemplate:

- (void) CreateMakeup: (FeatureTemplate *) 
featureTemplate: (FinishTemplate *) 
finishTemplate: (NSArray *)  boundingBox 

Creates makeup effect from given feature and finish templates. Additionally, this function takes an array of NSNumbers specifying a bounding box in the following way:

  • Lower left x coordinate is the first element of the array
  • Lower left y coordinate is the second element of the array
  • Upper right x coordinate is the third element of the array
  • Upper right y coordinate is the fourth element of the array Bounding box is set in normalized image coordinates where point (0.0, 0.0) is the lower left corner of the output image while point (1.0, 1.0) is the upper right corner of the output image. This effect will be visible only when its location in the output image is inside of the bounding box. The default bounding box is contains the whole output image. If the input array has less than 4 elements, the default bounding box will be used. Returns the id of the created effect via IMakeupObserver interface.
    Parameters
    featureTemplateFeatureTemplate object
    finishTemplateFinishTemplate object
    boundingBoxQuuartet specifying bounding box in which this effect is visible

◆ DisplayMakeup:

- (void) DisplayMakeup: (Effect *)  effect

Displays given makeup effect.

Parameters
effectmakeup effect

◆ GetFeatures

- (FeatureTemplateRepository *) GetFeatures

Returns loaded feature template repository containing predefined features. Each of the predefined feature templates specify a standard renderfing procedure for each of the makeup features supported by the engine.

◆ GetFinishes

- (FinishTemplateRepository *) GetFinishes

Returns loaded finish template repository containing predefined finishes. Each of the predefined finish templates specify a standard renderfing procedure for each of the finishes supported by the engine.

◆ GetView

- (UIView *) GetView

Retrieve surface that displays the resulting output of the makeup engine. Resizing of the surface is tied to the quality of the rendering pipeline. Higher resolutions give better fidelity but at the cost of performance. For the highest quality keep the aspect ratio of input images and the surface similar.

Returns
Returns an UIView displaying the output of the makeup engine

◆ HideMakeup:

- (void) HideMakeup: (Effect *)  effect

Hides given makeup effect.

Parameters
effectmakeup effect

◆ RemoveMakeup:

- (void) RemoveMakeup: (Effect *)  effect

Destroys given makeup effect.

Parameters
effectmakeup effect

◆ Reset

- (void) Reset

Reinitializes face tracking. When using the SDK on single images, this method should be called after each image has been processed.

◆ SetCameraDevice:

- (void) SetCameraDevice: (unsigned int)  id

Defines which camera will be used.

Parameters
idcamera id

◆ UpdateMakeup:

- (void) UpdateMakeup: (Effect *)  effect

Updates given makeup effect.

Parameters
effectmakeup effect