makeup|SDK
makeup|SDK is a library based on visage|SDK face tracking used to configure and render virtual makeup.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
com.visagetechnologies.makeupsdk.ElementTemplate Class Reference

Public Member Functions

JSONObject ToJSON ()
 

Static Public Member Functions

static ElementTemplate FromJSON (JSONObject jsonObject)
 

Public Attributes

String name
 
String area = ""
 
Color color = new Color()
 
PipeTemplate pipeline = new PipeTemplate()
 

Detailed Description

Contains rendering information of each element of a makeup feature. A makeup feature can consit of multiple elements with different color, renderign area and/or rendering algorithm.

Each ElementTemplate consists of the following:

Color is stored in Color class which contains a 4 dimensional vector specifying red, green, blue and alpha channels. Additionally, color can be provided as a path to a file containign color map to use.

Area is specified as a name of the image file that contains a greyscale image specifying how much of the color of this ElementTemplate should be used at each fragment of the mesh used for rendering of the feature containing this ElementTemplate. For each pixel in the area image, if the pixel is white this 100% of color from this element template will be used. If the pixel is black 100% of the color from the previous element will be used. The pixel values in between are lineraly interpolated.

Once an effect is created from a feature each element template in the feature is mapped to one element. The previous element of the first element in an effect is the output of the previous effect. If there are no previous effects displayed, the previous element is raw input image without augmentation.

The location where area images are stored is <path to platform dependent assets folder> + "/Textures/Area/" + FeatureTemplate.type + ElementTemplate.area where FeatureTemplate.type is type of the feature containing this ElementTemplate and ElementTemplate.area is the area parameter of this ElementTemplate. The location where color maps are <path to platform dependent assets folder> + "/Textures/" + ElementTemplate.texture.

Since both the area image and the color map are used as a texture on a mesh used for rendering the feature it will only work correctly if the uv mapping used on the mesh matches those images. This means that those images can be reused between features only if the features have the same type. Therefore, when specifying a new custom area image or a new color map, the image file needs to be placed in the subfolder specific to the type of the feature the new image was created for.

Additional files containing custom areas have to be added into the bundle and unpacked on the location defined above on the library consumer level.

The available meshes are stored in .obj format in the "StreamingAssets/Models" folder of the package. UV maps from these meshes should be used when creating new area textures.

Member Function Documentation

◆ FromJSON()

static ElementTemplate com.visagetechnologies.makeupsdk.ElementTemplate.FromJSON ( JSONObject  jsonObject)
inlinestatic

Deserializes ElementTemplate object from JSON representation

Parameters
jsonObjectJSON object
Returns
deserialized ElementTemplate object

◆ ToJSON()

JSONObject com.visagetechnologies.makeupsdk.ElementTemplate.ToJSON ( )
inline

Returns JSON object out of this ElementTemplate object

Returns
JSON representation of this ElementTemplate returned as JSONObject

Member Data Documentation

◆ area

String com.visagetechnologies.makeupsdk.ElementTemplate.area = ""

Name of the image file specifying the area where rendering of this element will be performed.

◆ color

Color com.visagetechnologies.makeupsdk.ElementTemplate.color = new Color()

Color of the area where rendering will be performed

◆ name

String com.visagetechnologies.makeupsdk.ElementTemplate.name

Name of the element

◆ pipeline

PipeTemplate com.visagetechnologies.makeupsdk.ElementTemplate.pipeline = new PipeTemplate()

Rendering steps to use when rendering the element