Added SRAnipal back to repo

This commit is contained in:
kenzomenzo 2020-09-30 20:34:21 +01:00
parent c23105e17d
commit 691a92eed0
23 changed files with 1035 additions and 1 deletions

2
.gitmodules vendored
View File

@ -9,4 +9,4 @@
url = https://github.com/g-truc/glm
[submodule "gibson2/render/openvr"]
path = gibson2/render/openvr
url = https://github.com/ValveSoftware/openvr
url = https://github.com/ValveSoftware/openvr

1
gibson2/render/glfw Submodule

@ -0,0 +1 @@
Subproject commit 40d150c39900921e94f16f53ba38b4b48689f80e

1
gibson2/render/glm Submodule

@ -0,0 +1 @@
Subproject commit b3f87720261d623986f164b2a7f6a0a938430271

1
gibson2/render/openvr Submodule

@ -0,0 +1 @@
Subproject commit 0eb70325a4ea3edca2a0ff8aefa631f2529e6eb7

@ -0,0 +1 @@
Subproject commit d159a563383d10c821ba7b2a71905d1207db6de4

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,85 @@
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2017, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
///////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "ViveSR_Enums.h"
#include "SRanipal_Enums.h"
#ifdef SRANIPAL_EXPORTS
#define SR_ANIPAL __declspec(dllexport)
#else
#define SR_ANIPAL __declspec(dllimport)
#endif
/** Vive Super Reality
*/
namespace ViveSR {
/** Animation pal
*/
namespace anipal {
extern "C" {
/** Invokes an anipal module.
* @param anipalType The index of an anipal module.
* @param config
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int Initial(int anipalType, void* config);
/** Turn off and release the specific anipal engine.
* @param anipalType The index of an anipal module.
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int Release(int anipalType);
/** Gets the status of an anipal module.
* @param anipalType The index of an anipal module.
* @param status The status of an anipal module.
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int GetStatus(int anipalType, AnipalStatus *status);
/** Gets the SRanipal version
* @param version Represented by four integer
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int SRanipal_GetVersion(char *& version);
}
}
}

View File

@ -0,0 +1,14 @@
//========= Copyright 2018, HTC Corporation. All rights reserved. ===========
#pragma once
namespace ViveSR {
namespace anipal {
/** @enum AnipalStatus
An enum type of the status of the specific anipal engine.
*/
enum AnipalStatus {
ANIPAL_STATUS_ERROR,
ANIPAL_STATUS_IDLE,
ANIPAL_STATUS_WORKING,
};
}
}

View File

@ -0,0 +1,147 @@
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2019, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
///////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "SRanipal_EyeData_v1.h"
#include "SRanipal_EyeData_v2.h"
#ifdef SRANIPAL_EXPORTS
#define SR_ANIPAL __declspec(dllexport)
#else
#define SR_ANIPAL __declspec(dllimport)
#endif
using VivesrEyeDataCallback = void(*)(ViveSR::anipal::Eye::EyeData const &data);
using VivesrEyeDataCallback_v2 = void(*)(ViveSR::anipal::Eye::EyeData_v2 const &data);
extern "C" {
namespace ViveSR {
namespace anipal {
namespace Eye {
const int ANIPAL_TYPE_EYE = 0;
const int ANIPAL_TYPE_EYE_V2 = 2;
/** Check HMD device is ViveProEye or not.
* @return true : ViveProEye, false : other HMD.
*/
SR_ANIPAL bool IsViveProEye();
/** Gets data from anipal's Eye module.
* @param data ViveSR::anipal::Eye::EyeData
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int GetEyeData(EyeData *data);
/** Gets data from anipal's Eye module.
* @param data ViveSR::anipal::Eye::EyeData
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int GetEyeData_v2(EyeData_v2 *data);
/** Sets the parameter of anipal's Eye module.
* @param parameter ViveSR::anipal::Eye::EyeParameter
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int SetEyeParameter(EyeParameter parameter);
/** Get the EyeParameter from Eye engine.
* @param parameter ViveSR::anipal::Eye::EyeParameter
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int GetEyeParameter(EyeParameter *parameter);
/** Launches anipal's Eye Calibration tool (an overlay program).
* @param callback (Upcoming feature) A callback method invoked at the end of the calibration process.
* @return Indicates the resulting ViveSR::Error and CalibrationExitCode status of this method.
*/
SR_ANIPAL int LaunchEyeCalibration(void* callback);
/** Indicate if user is use right calibration configuration and in good IPD and HMD position.
* @param[out] result Indicate is needed or not.
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int IsUserNeedCalibration(bool* need);
/* Register a callback function to receive eye camera related data when the module has new outputs.
[in] function pointer of callback
[out] error code. please refer Error in ViveSR_Enums.h
*/
SR_ANIPAL int RegisterEyeDataCallback(VivesrEyeDataCallback callback);
/* Unegister a callback function to stop receiving eye camera related data.
[in] function pointer of callback
[out] error code. please refer Error in ViveSR_Enums.h
*/
SR_ANIPAL int UnregisterEyeDataCallback(VivesrEyeDataCallback callback);
/* Register a callback function to receive eye camera related data when the module has new outputs.
[in] function pointer of callback
[out] error code. please refer Error in ViveSR_Enums.h
*/
SR_ANIPAL int RegisterEyeDataCallback_v2(VivesrEyeDataCallback_v2 callback);
/* Unegister a callback function to stop receiving eye camera related data.
[in] function pointer of callback
[out] error code. please refer Error in ViveSR_Enums.h
*/
SR_ANIPAL int UnregisterEyeDataCallback_v2(VivesrEyeDataCallback_v2 callback);
/**
One of return code of API LaunchEyeCalibration()
*/
enum CalibrationExitCode {
CALIBRATION_IS_ALREADY_RUNNING = 2001,
OPENVR_DASHBOARD_ACTIVATED = 2002,
OPENVR_INIT_FAILED = 2003,
OPENVR_OVERLAY_ALREADY_EXISTS = 2004,
OPENVR_OVERLAY_CREATE_FAILED = 2005,
OPENVR_OVERLAY_INTERFACE_INVALID = 2006,
OPENVR_QUIT = 2007
};
}
}
}
}

View File

@ -0,0 +1,226 @@
#pragma once
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2019, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
#include <stdint.h>
namespace ViveSR {
namespace anipal {
namespace Eye {
#pragma region basic_math_data_type
/**
* @struct Vector3
* A basic 3d vector type
*/
struct Vector3
{
union
{
struct
{
float x;
float y;
float z;
};
float elem_[3];
};
};
/**
* @struct Vector2
* A basic 2d vector type
*/
struct Vector2
{
union
{
struct
{
float x;
float y;
};
float elem_[2];
};
};
/**
* @struct Matrix4x4
* A basic affine matrix in 3D space
*/
struct Matrix4x4
{
union
{
struct
{
float m00;
float m33;
float m23;
float m13;
float m03;
float m32;
float m22;
float m02;
float m12;
float m21;
float m11;
float m01;
float m30;
float m20;
float m10;
float m31;
};
float elem_[16];
};
};
#pragma endregion
#pragma region bit_mask_enum
/** @enum SingleEyeDataValidity
An enum type for getting validity from the structure: eye data's bitmask
*/
enum SingleEyeDataValidity {
SINGLE_EYE_DATA_GAZE_ORIGIN_VALIDITY,/*!<The validity of the origin of gaze of the eye data*/
SINGLE_EYE_DATA_GAZE_DIRECTION_VALIDITY,/*!<The validity of the direction of gaze of the eye data*/
SINGLE_EYE_DATA_PUPIL_DIAMETER_VALIDITY,/*!<The validity of the diameter of gaze of the eye data*/
SINGLE_EYE_DATA_EYE_OPENNESS_VALIDITY,/*!<The validity of the openness of the eye data>*/
SINGLE_EYE_DATA_PUPIL_POSITION_IN_SENSOR_AREA_VALIDITY/*!<The validity of normalized position of pupil*/
};
enum TrackingImprovement
{
TRACKING_IMPROVEMENT_USER_POSITION_HMD,
TRACKING_IMPROVEMENT_CALIBRATION_CONTAINS_POOR_DATA,
TRACKING_IMPROVEMENT_CALIBRATION_DIFFERENT_BRIGHTNESS,
TRACKING_IMPROVEMENT_IMAGE_QUALITY,
TRACKING_IMPROVEMENT_INCREASE_EYE_RELIEF,
};
/** A utility function for decoding bits by bitmask.
@param bits the input as bitmask
@param position the the position of the bits.
@return The status of a bit.
@sa VerboseDataValidity, EyeDataValidity
*/
inline bool DecodeBitMask(const uint64_t& bits, unsigned char position) {
return bits&(1 << position);
}
/** A utility function for encoding bits by bitmask
@param position the the position of the bits.
@param status the status you would set.
@param[out] bits the bits.
@sa VerboseDataValidity, EyeDataValidity
*/
inline void EecodeBitMask(unsigned char position, bool status, uint64_t& bits) {
uint64_t the_mask = (((uint64_t)1) << position);
if (status)
bits |= the_mask;
else
bits &= ~the_mask;
}
#pragma endregion
#pragma region eye_parameter
struct TrackingImprovements
{
int count;
union
{
struct
{
TrackingImprovement t0;
TrackingImprovement t1;
TrackingImprovement t2;
TrackingImprovement t3;
TrackingImprovement t4;
TrackingImprovement t5;
TrackingImprovement t6;
TrackingImprovement t7;
TrackingImprovement t8;
TrackingImprovement t9;
};
TrackingImprovement elem_[10];
};
};
/** @struct GazeRayParameter
* A struct containing all data listed below.
*/
struct GazeRayParameter {
double sensitive_factor;/*!<The sensitive factor of gaze ray in [0,1]. The bigger factor is, the more sensitive the gaze ray is.*/
};
/** @struct EyeParameter
* A struct containing all data listed below.
*/
struct EyeParameter {
GazeRayParameter gaze_ray_parameter;
};
#pragma endregion
#pragma region VerboseData
/** @struct SingleEyeData
* A struct containing status related an eye.
*/
typedef struct SingleEyeData
{
uint64_t eye_data_validata_bit_mask;/*!<The bits containing all validity for this frame.*/
Vector3 gaze_origin_mm;/*!<The point in the eye from which the gaze ray originates in meter miles.(right-handed coordinate system)*/
Vector3 gaze_direction_normalized;/*!The normalized gaze direction of the eye in [0,1].(right-handed coordinate system)*/
float pupil_diameter_mm;/*!<The diameter of the pupil in meter miles*/
float eye_openness;/*!<A value representing how open the eye is.*/
Vector2 pupil_position_in_sensor_area;/*!<The normalized position of a pupil in [0,1]*/
}SingleEyeData;
typedef struct CombinedEyeData
{
SingleEyeData eye_data;
bool convergence_distance_validity;
float convergence_distance_mm;
};
/** @struct VerboseData
* A struct containing all data listed below.
*/
typedef struct VerboseData
{
SingleEyeData left;/*!<A instance of the struct as @ref EyeData related to the left eye*/
SingleEyeData right;/*!<A instance of the struct as @ref EyeData related to the right eye*/
CombinedEyeData combined;/*!<A instance of the struct as @ref EyeData related to the combined eye*/
TrackingImprovements tracking_improvements;
}VerboseData;
#pragma endregion
}
}
}

View File

@ -0,0 +1,62 @@
#pragma once
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2019, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
#include "SRanipal_EyeDataType.h"
namespace ViveSR {
namespace anipal {
/**
* Eye module
*/
namespace Eye
{
/** @struct EyeData
* A struct containing all data listed below.
*/
struct EyeData
{
bool no_user;
int frame_sequence;/*!<The frame sequence.*/
int timestamp;/*!<The time when the frame was capturing. in millisecond.*/
VerboseData verbose_data;
};
}
}
}

View File

@ -0,0 +1,74 @@
#pragma once
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2019, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
#include "SRanipal_EyeDataType.h"
namespace ViveSR {
namespace anipal {
/**
* Eye module
*/
namespace Eye
{
struct SingleEyeExpression {
float eye_wide; /*!<A value representing how open eye widely.*/
float eye_squeeze; /*!<A value representing how the eye is closed tightly.*/
float eye_frown; /*!<A value representing user's frown.*/
};
struct EyeExpression {
SingleEyeExpression left;
SingleEyeExpression right;
};
/** @struct EyeData
* A struct containing all data listed below.
*/
struct EyeData_v2
{
bool no_user;
int frame_sequence;/*!<The frame sequence.*/
int timestamp;/*!<The time when the frame was capturing. in millisecond.*/
VerboseData verbose_data;
EyeExpression expression_data;
};
}
}
}

View File

@ -0,0 +1,65 @@
#pragma once
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2017, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
#include <stdint.h>
namespace ViveSR
{
namespace anipal
{
/**
* Eye module
*/
namespace Eye
{
namespace Calibration
{
enum CommandType
{
IPD_CONFIG = 7,
START,
CLEAR,
COLLECT,
DONE,
STOP,
};
}
}
}
}

View File

@ -0,0 +1,76 @@
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2017, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
///////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "SRanipal_LipData_v1.h"
#include "SRanipal_LipData_v2.h"
#ifdef SRANIPAL_EXPORTS
#define SR_ANIPAL __declspec(dllexport)
#else
#define SR_ANIPAL __declspec(dllimport)
#endif
extern "C" {
namespace ViveSR {
namespace anipal {
namespace Lip {
const int ANIPAL_TYPE_LIP = 1;
const int ANIPAL_TYPE_LIP_V2 = 3;
/** Gets the LipData from Lip engine.
* @param data ViveSR::anipal::Lip::LipData
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int GetLipData(LipData *data);
/** Gets the LipData_v2 from Lip engine. The version 2 LipData contains tongue's blendshape
* @param data ViveSR::anipal::Lip::LipData_v2
* @return Indicates the resulting ViveSR::Error status of this method.
*/
SR_ANIPAL int GetLipData_v2(LipData_v2 *data);
}
}
}
}

View File

@ -0,0 +1,104 @@
#pragma once
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2019, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
namespace ViveSR {
namespace anipal {
/**
* Lip module
*/
namespace Lip {
/** @enum LipShape
An enum type for defined muscle.
*/
enum LipShape
{
Jaw_Forward = 0,
Jaw_Right = 1,
Jaw_Left = 2,
Jaw_Open = 3,
Mouth_Ape_Shape = 4,
Mouth_O_Shape = 5,
Mouth_Pout = 6,
Mouth_Lower_Right = 7,
Mouth_Lower_Left = 8,
Mouth_Smile_Right = 9,
Mouth_Smile_Left = 10,
Mouth_Sad_Right = 11,
Mouth_Sad_Left = 12,
Cheek_Puff_Right = 13,
Cheek_Puff_Left = 14,
Mouth_Lower_Inside = 15,
Mouth_Upper_Inside = 16,
Mouth_Lower_Overlay = 17,
Mouth_Upper_Overlay = 18,
Cheek_Suck = 19,
Mouth_LowerRight_Down = 20,
Mouth_LowerLeft_Down = 21,
Mouth_UpperRight_Up = 22,
Mouth_UpperLeft_Up = 23,
Mouth_Philtrum_Right = 24,
Mouth_Philtrum_Left = 25,
None = 26,
};
/**
* @struct PredictionData
* A struct containing all data listed below.
*/
struct PredictionData
{
float blend_shape_weight[27]; /*!<The prediction result listing all of @ref LipShape in [0,1].*/
};
/**
* @struct LipData
* A struct containing all data listed below.
*/
struct LipData
{
int frame_sequence; /*!<The frame sequence.*/
int timestamp; /*!<The time when the frame was capturing. in millisecond.*/
char *image; /*!<The raw buffer. width=800, height=400, channel=1*/
PredictionData prediction_data; /*!<The prediction result listing all of @ref LipShape in [0,1].*/
};
}
}
}

View File

@ -0,0 +1,116 @@
#pragma once
///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
// License Agreement
// For Vive Super Reality Library
//
// Copyright (c) 2019, HTC Corporation
//
// All rights reserved. Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
namespace ViveSR {
namespace anipal {
/**
* Lip module
*/
namespace Lip {
const int blend_shape_nums = 60;
/** @enum LipShape
An enum type for defined muscle.
*/
namespace Version2 {
/**
* To avoid naming conflict
*/
enum LipShape_v2
{
None = -1,
Jaw_Right = 0,
Jaw_Left = 1,
Jaw_Forward = 2,
Jaw_Open = 3,
Mouth_Ape_Shape = 4,
Mouth_Upper_Right = 5,
Mouth_Upper_Left = 6,
Mouth_Lower_Right = 7,
Mouth_Lower_Left = 8,
Mouth_Upper_Overturn = 9,
Mouth_Lower_Overturn = 10,
Mouth_Pout = 11,
Mouth_Smile_Right = 12,
Mouth_Smile_Left = 13,
Mouth_Sad_Right = 14,
Mouth_Sad_Left = 15,
Cheek_Puff_Right = 16,
Cheek_Puff_Left = 17,
Cheek_Suck = 18,
Mouth_Upper_UpRight = 19,
Mouth_Upper_UpLeft = 20,
Mouth_Lower_DownRight = 21,
Mouth_Lower_DownLeft = 22,
Mouth_Upper_Inside = 23,
Mouth_Lower_Inside = 24,
Mouth_Lower_Overlay = 25,
Tongue_LongStep1 = 26,
Tongue_LongStep2 = 32,
Tongue_Down = 30,
Max = 33,
};
}
/**
* @struct PredictionData
* A struct containing all data listed below.
*/
struct PredictionData_v2
{
float blend_shape_weight[blend_shape_nums]; /*!<The prediction result listing all of @ref LipShape in [0,1].*/
};
/**
* @struct LipData
* A struct containing all data listed below.
*/
struct LipData_v2
{
int frame_sequence; /*!<The frame sequence.*/
int timestamp; /*!<The time when the frame was capturing. in millisecond.*/
char *image; /*!<The raw buffer. width=800, height=400, channel=1*/
PredictionData_v2 prediction_data; /*!<The prediction result listing all of @ref LipShape in [0,1].*/
};
}
}
}

View File

@ -0,0 +1,61 @@
//========= Copyright 2018, HTC Corporation. All rights reserved. ===========
#pragma once
namespace ViveSR
{
enum ModuleStatus {
CREATE = 0,
INITIAL = 1,
START = 2,
STOP = 3,
RELEASE = 4,
DESTROY = 5,
};
enum Error {
RUNTIME_NOT_FOUND = -3, // please follows SRanipal SDK guide to install SR_Runtime first
NOT_INITIAL = -2,
FAILED = -1,
WORK = 0,
INVALID_INPUT = 1,
FILE_NOT_FOUND = 2,
DATA_NOT_FOUND = 13,
UNDEFINED = 319,
INITIAL_FAILED = 1001,
NOT_IMPLEMENTED = 1003,
NULL_POINTER = 1004,
OVER_MAX_LENGTH = 1005,
FILE_INVALID = 1006,
UNINSTALL_STEAM = 1007,
MEMCPY_FAIL = 1008,
NOT_MATCH = 1009,
NODE_NOT_EXIST = 1010,
UNKONW_MODULE = 1011,
MODULE_FULL = 1012,
UNKNOW_TYPE = 1013,
INVALID_MODULE = 1014,
INVALID_TYPE = 1015,
MEMORY_NOT_ENOUGH = 1016,
BUSY = 1017,
NOT_SUPPORTED = 1018,
INVALID_VALUE = 1019,
COMING_SOON = 1020,
INVALID_CHANGE = 1021, // this/these module parameter can't be changed dynamic
TIMEOUT = 1022,
DEVICE_NOT_FOUND = 1023,
INVALID_DEVICE = 1024,
NOT_AUTHORIZED = 1025,
ALREADY = 1026,
INTERNAL = 1027,
CONNECTION_FAILED = 1028,
ALLOCATION_FAILED = 1029,
OPERATION_FAILED = 1030,
NOT_AVAILABLE = 1031,
CALLBACK_IN_PROGRESS= 1032,
SERVICE_NOT_FOUND = 1033,
DISABLED_BY_USER = 1034,
EULA_NOT_ACCEPT = 1035,
// 1036 - 1050 reserved
LIP_NOT_SUPPORT = 1051, // VIVE Lip Sync is not supported by VIVE Wireless Adapter
};
}

Binary file not shown.