Local Compute Avatar SDK
2.0.9
To generate Head 2.0 avatars
|
#include <avatar_sdk_2/avatar_sdk_structures.hpp>
Go to the source code of this file.
Typedefs | |
typedef void(* | avatar_sdk_2::ReportProgress) (float) |
Functions | |
DllExport int | avatar_sdk_2::initAvatarSdk (const char *programName, const char *resourcesPath) |
DllExport int | avatar_sdk_2::releaseAvatarSdk () |
DllExport const char * | avatar_sdk_2::getAvailableHaircuts (AvatarSdkPipelineSubtype pipelineSubtype, unsigned int &size) |
DllExport const char * | avatar_sdk_2::getAvailableBlendshapes (AvatarSdkPipelineSubtype pipelineSubtype, unsigned int &size) |
DllExport int | avatar_sdk_2::generateAvatar (const AvatarSdkParams &avatarParams, ReportProgress reportProgress) |
DllExport int | avatar_sdk_2::generateAdditionalHaircutsFromJson (const char *avatarMeshFile, const char *outputDir, const char *resourcesJsonWithHaircuts, AvatarSdkMeshFormat format, bool saveAsPointCloud) |
DllExport int | avatar_sdk_2::generateAdditionalHaircutsFromList (const char *avatarMeshFile, const char *outputDir, const char *haircutsList, int haircutsStrSize, AvatarSdkMeshFormat format, bool saveAsPointCloud) |
DllExport const float * | avatar_sdk_2::getAvatarVertices (int &verticesCount, const char *pathToModelDir) |
DllExport const int * | avatar_sdk_2::getAvatarFaces (int &facesCount, const char *pathToModelDir) |
DllExport const double * | avatar_sdk_2::getAvatarUVMapping (int &facesCount, const char *pathToModelDir) |
DllExport const unsigned char * | avatar_sdk_2::getAvatarTexture (int &textureWidth, int &textureHeight, const char *pathToModelDir) |
DllExport const float * | avatar_sdk_2::getAvatarBlendshapeDeltas (const char *blendshapeName, int &verticesCount, const char *pathToModelDir) |
DllExport const float * | avatar_sdk_2::getHaircutVertices (int &verticesCount, const char *haircutName, const char *pathToModelDir) |
DllExport const int * | avatar_sdk_2::getHaircutFaces (int &facesCount, const char *haircutName, const char *pathToModelDir) |
DllExport const double * | avatar_sdk_2::getHaircutUVMapping (int &facesCount, const char *haircutName, const char *pathToModelDir) |
DllExport const unsigned char * | avatar_sdk_2::getHaircutTexture (int &textureWidth, int &textureHeight, const char *haircutName, const char *pathToModelDir) |
DllExport int | avatar_sdk_2::getAvatarModelInfo (const char *pathToModelDir, AvatarSdkModelInfoEntry &entry) |
DllExport AvatarSdkResourcesList | avatar_sdk_2::getAvatarHaircutsList (const char *pathToModelDir) |
DllExport AvatarSdkResourcesList | avatar_sdk_2::getAvatarBlendshapesList (const char *pathToModelDir) |
DllExport AvatarSdkResourcesList | avatar_sdk_2::getAvatarAdditionalTextures (const char *pathToModelDir, AvatarSdkPipelineSubtype pipelineSubtype) |
DllExport int | avatar_sdk_2::getParametersJson (AvatarSdkPipelineSubtype pipelineSubtype, char *parametersJson, int parametersBufferSize) |
DllExport void | avatar_sdk_2::getLastError (char *buffer, int bufferSize) |
DllExport void | avatar_sdk_2::setLoggingFile (const char *logFile) |
DllExport void | avatar_sdk_2::setAdvancedLogs (bool isAdvanced) |
DllExport bool | avatar_sdk_2::isHardwareSupported () |
This file contains public methods of the itSeez3D Offline Avatar SDK.
Definition in file avatar_sdk.hpp.
typedef void(* avatar_sdk_2::ReportProgress) (float) |
The handler of the calculation progress.
[in] | float | The calculation progress in percents. |
Definition at line 25 of file avatar_sdk.hpp.
DllExport int avatar_sdk_2::generateAdditionalHaircutsFromJson | ( | const char * | avatarMeshFile, |
const char * | outputDir, | ||
const char * | resourcesJsonWithHaircuts, | ||
AvatarSdkMeshFormat | format, | ||
bool | saveAsPointCloud | ||
) |
Generates additional haircuts from the JSON for already created avatar. Does not work for avatar 'base/generated' haircut.
[in] | avatarMeshFile | Path to the file with avatar mesh. |
[in] | outputDir | Directory where the generated haircuts will be saved. |
[in] | resourcesJsonWithHaircuts | Pointer to the resources JSON that contains haircuts list. |
[in] | format | Format of the generated haircuts. |
[in] | saveAsPointCloud | Save haircuts as point clouds. |
DllExport int avatar_sdk_2::generateAdditionalHaircutsFromList | ( | const char * | avatarMeshFile, |
const char * | outputDir, | ||
const char * | haircutsList, | ||
int | haircutsStrSize, | ||
AvatarSdkMeshFormat | format, | ||
bool | saveAsPointCloud | ||
) |
Generates additional haircuts from the list for already created avatar. Does not work for avatar 'base/generated' haircut.
[in] | avatarMeshFile | Path to the file with avatar mesh in PLY or OBJ format. |
[in] | outputDir | Directory where the generated haircuts will be saved. |
[in] | haircutsList | Haircuts names separated by ';'. |
[in] | haircutsStrSize | Length of the haircutsList string. |
[in] | format | Format of the generated haircuts. |
[in] | saveAsPointCloud | Save haircuts as point clouds. |
DllExport int avatar_sdk_2::generateAvatar | ( | const AvatarSdkParams & | avatarParams, |
ReportProgress | reportProgress | ||
) |
Generates an avatar with the given params. The avatar will be stored in memory if the outputDirPath isn't specified. Only one avatar can be genearted at a time.
[in] | avatarParams | Generation parameters. |
[in] | reportProgress | Callback that is invoked when the calculation progress is changed. |
DllExport const char* avatar_sdk_2::getAvailableBlendshapes | ( | AvatarSdkPipelineSubtype | pipelineSubtype, |
unsigned int & | size | ||
) |
Get available blendshapes
[in] | pipelineSubtype | Subtype of pipeline. |
[out] | size | Number of symbols in list |
DllExport const char* avatar_sdk_2::getAvailableHaircuts | ( | AvatarSdkPipelineSubtype | pipelineSubtype, |
unsigned int & | size | ||
) |
Get available haircuts
[in] | pipelineSubtype | Subtype of pipeline. |
[out] | size | Number of symbols in list |
DllExport AvatarSdkResourcesList avatar_sdk_2::getAvatarAdditionalTextures | ( | const char * | pathToModelDir, |
AvatarSdkPipelineSubtype | pipelineSubtype | ||
) |
Get additional textures for model located at specific directory.
[in] | pathToModelDir | Path to model directory |
[in] | pipelineSubtype | Subtype of pipeline |
DllExport const float* avatar_sdk_2::getAvatarBlendshapeDeltas | ( | const char * | blendshapeName, |
int & | verticesCount, | ||
const char * | pathToModelDir | ||
) |
Gets a pointer to the buffer of blendshape deltas for the avatar. Blendshape deltas can be returned for the avatar in PLY or OBJ format. If pathToModelDir was not specified, the deltas will be returned for the latest generated avatar that stored in memory. The deltas buffer is a raw float values with 3 floats per vertex.
[in] | blendshapeName | Name of blendshape. "jawOpen" for example. |
[out] | verticesCount | Vertices count. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport AvatarSdkResourcesList avatar_sdk_2::getAvatarBlendshapesList | ( | const char * | pathToModelDir | ) |
Get blendshapes for model located at specific directory.
[in] | pathToModelDir | Path to model directory |
DllExport const int* avatar_sdk_2::getAvatarFaces | ( | int & | facesCount, |
const char * | pathToModelDir | ||
) |
Gets a pointer to the buffer of faces for the avatar. Data can be returned for the avatar in PLY or OBJ format. If pathToModelDir was not specified, the vertices will be returned for the latest generated avatar that stored in memory. The faces buffer is a raw int values (vertex indices). Each face consists from the three vertices.
[out] | facesCount | Faces count. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport AvatarSdkResourcesList avatar_sdk_2::getAvatarHaircutsList | ( | const char * | pathToModelDir | ) |
Get haircuts for model located at specific directory.
[in] | pathToModelDir | Path to model directory |
DllExport int avatar_sdk_2::getAvatarModelInfo | ( | const char * | pathToModelDir, |
AvatarSdkModelInfoEntry & | entry | ||
) |
Reads model information and fills appropriate structure with data read.
[in] | pathToModelDir | Path to directory where model is located. |
[out] | entry | Model information structure. |
DllExport const unsigned char* avatar_sdk_2::getAvatarTexture | ( | int & | textureWidth, |
int & | textureHeight, | ||
const char * | pathToModelDir | ||
) |
Gets a pointer to the RGB texture for the avatar. Data can be returned for the avatar in PLY or OBJ format. If pathToModelDir was not specified, the vertices will be returned for the latest generated avatar that stored in memory. RGB values are stored as 3 channels of unsigned char data.
[out] | textureWidth | Texture width. |
[out] | textureHeight | Texture height. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport const double* avatar_sdk_2::getAvatarUVMapping | ( | int & | facesCount, |
const char * | pathToModelDir | ||
) |
Gets a pointer to the buffer of the uv-mapping for the avatar. Data can be returned for the avatar in PLY or OBJ format. If pathToModelDir was not specified, the vertices will be returned for the latest generated avatar that stored in memory. The uv-mapping is available only in case the outputDirPath was not specified. The uv-mapping buffer is a raw double values of the UV texture coordinates of the vertices in the faces. So if the total number of the faces is N, then the size of the uv-mapping buffer is M = N * 3 * 2. (number 3 means vertices per faces, number 2 means U and V coordinates for each vertex)
[out] | facesCount | Faces count. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport const float* avatar_sdk_2::getAvatarVertices | ( | int & | verticesCount, |
const char * | pathToModelDir | ||
) |
Gets a pointer to the buffer of vertices for the avatar. Data can be returned for the avatar in PLY or OBJ format. If pathToModelDir was not specified, the vertices will be returned for the latest generated avatar that stored in memory. The vertices buffer is a raw float values with 3 floats per vertex.
[out] | verticesCount | Vertices count. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport const int* avatar_sdk_2::getHaircutFaces | ( | int & | facesCount, |
const char * | haircutName, | ||
const char * | pathToModelDir | ||
) |
Gets a pointer to the buffer of faces for the haircut. If pathToModelDir was not specified, an attemp to find data among saved in memory haircuts will be performed. Haircuts are saved in memory during avatar generation. The faces buffer is a raw int values (vertex indices). Each face consists from the three vertices.
[out] | facesCount | Faces count. |
[in] | haircutName | Name of haircut. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport const unsigned char* avatar_sdk_2::getHaircutTexture | ( | int & | textureWidth, |
int & | textureHeight, | ||
const char * | haircutName, | ||
const char * | pathToModelDir | ||
) |
Gets a pointer to the RGB texture for the avatar. If pathToModelDir was not specified, an attemp to find data among saved in memory haircuts will be performed. Haircuts are saved in memory during avatar generation. RGB values are stored as 3 channels of unsigned char data.
[out] | textureWidth | Texture width. |
[out] | textureHeight | Texture height. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport const double* avatar_sdk_2::getHaircutUVMapping | ( | int & | facesCount, |
const char * | haircutName, | ||
const char * | pathToModelDir | ||
) |
Gets a pointer to the buffer of the uv-mapping for the haircut. If pathToModelDir was not specified, an attemp to find data among saved in memory haircuts will be performed. Haircuts are saved in memory during avatar generation. The uv-mapping is available only in case the outputDirPath was not specified. The uv-mapping buffer is a raw double values of the UV texture coordinates of the vertices in the faces. So if the total number of the faces is N, then the size of the uv-mapping buffer is M = N * 3 * 2. (number 3 means vertices per faces, number 2 means U and V coordinates for each vertex)
[out] | facesCount | Faces count. |
[in] | haircutName | Name of haircut. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport const float* avatar_sdk_2::getHaircutVertices | ( | int & | verticesCount, |
const char * | haircutName, | ||
const char * | pathToModelDir | ||
) |
Gets a pointer to the buffer of vertices for the haircut. If pathToModelDir was not specified, an attemp to find data among saved in memory haircuts will be performed. Haircuts are saved in memory during avatar generation. The vertices buffer is a raw float values with 3 floats per vertex.
[out] | verticesCount | Vertices count. |
[in] | haircutName | Name of haircut. |
[in] | pathToModelDir | Path to directory where model is located. |
DllExport void avatar_sdk_2::getLastError | ( | char * | buffer, |
int | bufferSize | ||
) |
Returns the description of the latest error.
[out] | buffer | Pointer to the buffer where the message will be written. |
[in] | bufferSize | Size of the buffer. |
DllExport int avatar_sdk_2::getParametersJson | ( | AvatarSdkPipelineSubtype | pipelineSubtype, |
char * | parametersJson, | ||
int | parametersBufferSize | ||
) |
Gets the JSON with all available parameters. You could modify this JSON and set the AvatarSdkParams.resourcesJson to configure some specific parameters.
[in] | pipelineSubtype | Type of avatar. |
[out] | parametersJson | Pointer the buffer in which the JSON will be written. |
[in] | parametersBufferSize | Size of the buffer. |
DllExport int avatar_sdk_2::initAvatarSdk | ( | const char * | programName, |
const char * | resourcesPath | ||
) |
Initializes the Avatar SDK. Should be called once before any other methods.
[in] | programName | Name of your application. |
[in] | resourcesPath | Path to the resources. |
DllExport bool avatar_sdk_2::isHardwareSupported | ( | ) |
Check if the avatar can be generated with this hardware configuration. Windows requirements: CPU must support AVX extensions set.
DllExport int avatar_sdk_2::releaseAvatarSdk | ( | ) |
Deinitializes the Avatar SDK and releases available resources. Should be called before the app terminates.
DllExport void avatar_sdk_2::setAdvancedLogs | ( | bool | isAdvanced | ) |
Configures if the advanced (more detailed) logs are written.
[in] | isAdvanced | True for advanced logging. |
DllExport void avatar_sdk_2::setLoggingFile | ( | const char * | logFile | ) |
Set the logs file. By default logs are not written to file.
[in] | logFile | path to the log file. |