MeiCam SDK For iOS  3.14.0
NvsARSceneManipulate.h
Go to the documentation of this file.
1 //================================================================================
2 //
3 // (c) Copyright Meishe Co. Ltd, 2016. All rights reserved.
4 //
5 // This code and information is provided "as is" without warranty of any kind,
6 // either expressed or implied, including but not limited to the implied
7 // warranties of merchantability and/or fitness for a particular purpose.
8 //
9 //--------------------------------------------------------------------------------
10 // Birth Date: Dec 29. 2016
11 // Author: Meishe video team
12 //================================================================================
13 #pragma once
14 
15 #import <Foundation/Foundation.h>
16 #import "NvsCommonDef.h"
17 
26 typedef enum {
34 
35 
44 typedef NS_ENUM(NSInteger,NvsFaceActionType){
46  NvsFaceActionTypeInvalid = -1,
47  NvsFaceActionTypeEyeBlink,
48  NvsFaceActionTypeLipsPart,
49  NvsFaceActionTypeHeadYaw,
50  NvsFaceActionTypeHeadPitch,
51  NvsFaceActionTypeBrowJump,
52  NvsFaceActionTypeLipsUpward,
53  NvsFaceActionTypeLipsPouted
54 };
55 
64 typedef NS_ENUM(NSInteger,NvsAvatarActionType){
66  NvsAvatarActionTypeInvalid = -1,
67  NvsAvatarActionTypeEyeRightClose,
68  NvsAvatarActionTypeEyeRightDown,
69  NvsAvatarActionTypeEyeRightInward,
70  NvsAvatarActionTypeEyeRightOutward,
71  NvsAvatarActionTypeEyeRightUp,
72  NvsAvatarActionTypeEyeRightNarrow,
73  NvsAvatarActionTypeEyeRightWide,
74  NvsAvatarActionTypeEyeLeftClose,
75  NvsAvatarActionTypeEyeLeftDown,
76  NvsAvatarActionTypeEyeLeftInward,
77  NvsAvatarActionTypeEyeLeftOutward,
78  NvsAvatarActionTypeEyeLeftUp,
79  NvsAvatarActionTypeEyeLeftNarrow,
80  NvsAvatarActionTypeEyeLeftWide,
81  NvsAvatarActionTypeJawForward,
82  NvsAvatarActionTypeJawRight,
83  NvsAvatarActionTypeJawLeft,
84  NvsAvatarActionTypeJawOpen,
85  NvsAvatarActionTypeJawDown,
86  NvsAvatarActionTypeMouthClose,
87  NvsAvatarActionTypeMouthRound,
88  NvsAvatarActionTypeMouthPucker,
89  NvsAvatarActionTypeMouthBulge,
90  NvsAvatarActionTypeMouthBothLipRight,
91  NvsAvatarActionTypeMouthBothLipLeft,
92  NvsAvatarActionTypeMouthRightCornerUp,
93  NvsAvatarActionTypeMouthLeftCornerUp,
94  NvsAvatarActionTypeMouthRightCornerDown,
95  NvsAvatarActionTypeMouthLeftCornerDown,
96  NvsAvatarActionTypeMouthRightCornerBackward,
97  NvsAvatarActionTypeMouthLeftCornerBackward,
98  NvsAvatarActionTypeMouthRightCornerOutward,
99  NvsAvatarActionTypeMouthLeftCornerOutward,
100  NvsAvatarActionTypeMouthCornerShrink,
101  NvsAvatarActionTypeMouthLowerLipInward,
102  NvsAvatarActionTypeMouthUpperLipInward,
103  NvsAvatarActionTypeMouthLowerLipOutward,
104  NvsAvatarActionTypeMouthUpperLipOutward,
105  NvsAvatarActionTypeMouthLowerLipRightUp,
106  NvsAvatarActionTypeMouthLowerLipLeftUp,
107  NvsAvatarActionTypeMouthLowerLipRightDown,
108  NvsAvatarActionTypeMouthLowerLipLeftDown,
109  NvsAvatarActionTypeMouthUpperLipRightUp,
110  NvsAvatarActionTypeMouthUpperLipLeftUp,
111  NvsAvatarActionTypeMouthLipPart,
112  NvsAvatarActionTypeEyebrowRightOuterDown,
113  NvsAvatarActionTypeEyebrowLeftOuterDown,
114  NvsAvatarActionTypeEyebrowBothInnerUp,
115  NvsAvatarActionTypeEyebrowBothInnerDown,
116  NvsAvatarActionTypeEyebrowRightOuterUp,
117  NvsAvatarActionTypeEyebrowLeftOuterUp,
118  NvsAvatarActionTypeCheekBothOutward,
119  NvsAvatarActionTypeCheekRightUp,
120  NvsAvatarActionTypeCheekLeftUp,
121  NvsAvatarActionTypeNoseRightUp,
122  NvsAvatarActionTypeNoseLeftUp,
123  NvsAvatarActionTypeNoseBothWide,
124  NvsAvatarActionTypeTongueOutward
125 };
126 
127 typedef NS_ENUM(NSInteger,NvsToBeCheckedFunctionType) {
128  NvsToBeCheckedFunctionType_Invalid = -1,
129  NvsToBeCheckedFunctionType_Matte,
130  NvsToBeCheckedFunctionType_Count
131 };
132 
140 @interface NvsFaceFeatureInfo : NSObject
141 
142 @property (nonatomic, assign) int faceId;
143 @property (nonatomic, assign) NvsRect boundingBox;
144 @property (nonatomic, strong) NSMutableArray<NSValue *> *landmarks;
145 @property (nonatomic, strong) NSMutableArray<NSNumber *> *visibilities;
146 @property (nonatomic, strong) NSMutableArray<NSValue *> *extraPoints;
147 @property (nonatomic, strong) NSMutableArray<NSNumber *> *extraVisibilities;
148 @property (nonatomic, assign) float yaw;
149 @property (nonatomic, assign) float pitch;
150 @property (nonatomic, assign) float roll;
151 @property (nonatomic, strong) NSMutableArray<NSValue *> *vertices; //Values is NvsPosition3D
152 @property (nonatomic, assign) NvsPosition3D rotation;
153 @property (nonatomic, assign) NvsPosition3D translation;
154 
155 @property (nonatomic, strong) NSMutableArray<NSValue *> *extraVertices;
156 
157 @property (nonatomic, strong) NSMutableArray<NSNumber *> *faceActions;
158 @property (nonatomic, strong) NSMutableArray<NSNumber *> *avatarExpressions;
159 
160 @end
161 
162 typedef NS_ENUM(NSInteger, NvsHandActionType) {
163  NvsHandActionInvalid = -1,
164  NvsHandActionOK = 0,
165  NvsHandActionScissor,
166  NvsHandActionGood,
167  NvsHandActionPalm,
168  NvsHandActionPistol,
169  NvsHandActionLove,
170  NvsHandActionHoldup,
171  NvsHandActionCongratulate,
172  NvsHandActionFingerHeart,
173  NvsHandActionFingerIndex,
174  NvsHandActionFist,
175  NvsHandAction666,
176  NvsHandActionBless,
177  NvsHandActionILoveYou,
178  NvsHandActionSSH,
179  NvsHandActionThree,
180  NvsHandActionFour
181 };
182 
183 @interface NvsHandFeatureInfo : NSObject
184 
185 @property (nonatomic, assign) int handId;
186 @property (nonatomic, assign) NvsRect boundingBox;
187 @property (nonatomic, assign) NvsHandActionType actionType;
188 
189 @end
190 
191 @protocol NvsARSceneManipulateDelegate <NSObject>
192 @optional
193 
209 - (void)notifyFaceBoundingRectWithId:(int*)faceIds boundingRect:(NvsRect*)boundingRects faceCount:(int)count;
210 
222 - (void)notifyFaceFeatureInfos:(NSMutableArray<NvsFaceFeatureInfo *> *)faceFeatureInfos;
223 
235 - (void)notifyHandFeatureInfos:(NSArray<NvsHandFeatureInfo *> *)handFeatureInfos;
236 
248 - (void)notifyCustomAvatarRealtimeResourcesPreloaded:(BOOL)isPreloaded;
249 
261 - (void)notifyDetectionTimeCost:(float)time;
262 
263 
275 - (void)notifyTotalTimeCost:(float)time;
276 
277 @end
278 
289 @interface NvsARSceneManipulate : NSObject
290 
291 @property (nonatomic, weak) id<NvsARSceneManipulateDelegate> delegate;
292 
302 - (void)setDetectionMode:(NvsARSceneDetectionMode)mode;
303 
311 - (void)resetTracking;
312 
320 - (void)resetSkinColor;
321 
331 - (void)setDetectionAutoProbe:(bool)autoProbe;
332 
333 - (void)setInternalObject:(void *)internalObject;
334 
344 - (void)setDisableDetectionSmooth:(BOOL)disable;
345 
356 - (void)setSoundVolumeGain:(float)volume;
357 
368 - (float)getSoundVolumeGain;
369 
380 - (void)setMusicVolumeGain:(float)volume;
381 
392 - (float)getMusicVolumeGain;
393 
403 - (BOOL)isFunctionAvailable:(NvsToBeCheckedFunctionType)functionType;
404 
414 - (void)setFaceLandmarkConfidenceThresh:(float)thresh;
415 
425 - (void)setFaceConfidenceThresh:(float)thresh;
426 
436 - (void)setDetectionForceInterval:(int)interval;
437 
447 - (void)setDetectionInterval:(int)interval;
448 @end
NvsARSceneManipulate
AR scene processing interface.
Definition: NvsARSceneManipulate.h:290
NvsFaceFeatureInfo::faceId
int faceId
Definition: NvsARSceneManipulate.h:142
NvsFaceFeatureInfo::visibilities
NSMutableArray< NSNumber * > * visibilities
Definition: NvsARSceneManipulate.h:145
NvsFaceFeatureInfo::extraVertices
NSMutableArray< NSValue * > * extraVertices
Definition: NvsARSceneManipulate.h:155
NvsARSceneDetectionMode_SingleThread
@ NvsARSceneDetectionMode_SingleThread
single thread detection
Definition: NvsARSceneManipulate.h:31
NvsRect
Rectangle.
Definition: NvsCommonDef.h:361
NvsARSceneDetectionMode_Image
@ NvsARSceneDetectionMode_Image
image detection mode
Definition: NvsARSceneManipulate.h:29
NvsFaceFeatureInfo::yaw
float yaw
Definition: NvsARSceneManipulate.h:148
NvsARSceneDetectionMode
NvsARSceneDetectionMode
Definition: NvsARSceneManipulate.h:27
NvsFaceFeatureInfo::translation
NvsPosition3D translation
Definition: NvsARSceneManipulate.h:153
NvsFaceFeatureInfo::extraVisibilities
NSMutableArray< NSNumber * > * extraVisibilities
Definition: NvsARSceneManipulate.h:147
NvsARSceneManipulateDelegate-p
Definition: NvsARSceneManipulate.h:191
NvsPosition3D
3D coordinate structure
Definition: NvsCommonDef.h:423
NvsFaceFeatureInfo::faceActions
NSMutableArray< NSNumber * > * faceActions
Definition: NvsARSceneManipulate.h:157
NvsARSceneDetectionMode_SemiImage
@ NvsARSceneDetectionMode_SemiImage
Semi-image detection mode.
Definition: NvsARSceneManipulate.h:30
NvsARSceneDetectionMode_Video
@ NvsARSceneDetectionMode_Video
video detection mode
Definition: NvsARSceneManipulate.h:28
NvsFaceFeatureInfo::pitch
float pitch
Definition: NvsARSceneManipulate.h:149
NvsFaceFeatureInfo::avatarExpressions
NSMutableArray< NSNumber * > * avatarExpressions
Definition: NvsARSceneManipulate.h:158
NvsFaceFeatureInfo::vertices
NSMutableArray< NSValue * > * vertices
Definition: NvsARSceneManipulate.h:151
NvsARSceneDetectionMode_MultiThread
@ NvsARSceneDetectionMode_MultiThread
multi-thread detection
Definition: NvsARSceneManipulate.h:32
NvsFaceFeatureInfo::rotation
NvsPosition3D rotation
Definition: NvsARSceneManipulate.h:152
NvsFaceFeatureInfo::landmarks
NSMutableArray< NSValue * > * landmarks
Definition: NvsARSceneManipulate.h:144
NvsFaceFeatureInfo::roll
float roll
Definition: NvsARSceneManipulate.h:150
NvsFaceFeatureInfo::boundingBox
NvsRect boundingBox
Definition: NvsARSceneManipulate.h:143
NS_ENUM
typedef NS_ENUM(NSInteger, NvsFaceActionType)
Definition: NvsARSceneManipulate.h:45
NvsFaceFeatureInfo
Face feature info, landmarks is an array of CGPoints, visibilities is an array of float.
Definition: NvsARSceneManipulate.h:141
NvsCommonDef.h
NvsFaceFeatureInfo::extraPoints
NSMutableArray< NSValue * > * extraPoints
Definition: NvsARSceneManipulate.h:146
NvsHandFeatureInfo
Definition: NvsARSceneManipulate.h:184