MeiCam SDK For iOS  3.16.4
NvsEffectSdkContext.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: Sep 6. 2018
11 // Author: Meishe video team
12 //================================================================================
13 #pragma once
14 
15 #import <Foundation/Foundation.h>
17 #import "NvsVideoEffect.h"
22 #import "NvsEffectRenderCore.h"
23 #import "NvsEffectCommonDef.h"
24 
31 typedef enum {
34 
41 typedef enum {
62 
71 #define HUMAN_DETECTION_OPTIONS_FACE_DETECT_THREAD_NUM @"Face Detect Thread Num"
73 #define HUMAN_DETECTION_OPTIONS_FACE_LANDMARK_THREAD_NUM @"Face Landmark Thread Num"
74 #define HUMAN_DETECTION_OPTIONS_FACE_TRACK_THREAD_NUM @"Face Track Thread Num"
75 #define HUMAN_DETECTION_OPTIONS_SKY_SEGMENTATION_THREAD_NUM @"Sky Segmentation Thread Num"
76 #define HUMAN_DETECTION_OPTIONS_HUMAN_SEGMENTATION_THREAD_NUM @"Human Segmentation Thread Num"
77 
79 
85 typedef enum {
92  NvsEffectSdkHumanDetectionDataType_Makeup2, // deprecated, replaced by NvsHumanDetectionDataType_FaceCommon
96 
98 @optional
99 
111 - (void)onDebugLogArrived:(int)level logStr:(NSString*)logStr;
112 @end
113 
120 NVS_EXPORT @interface NvsEffectSdkContext : NSObject
121 
123 
134 + (BOOL)verifySdkLicenseFile:(NSString *)sdkLicenseFilePath;
135 
136 + (void)setDebugLogDelegate:(id<NvsEffectSdkContextDebugLogDelegate>)debugLogDelegate;
146 + (NvsEffectSdkContext *)sharedInstance:(NvsEffectSdkContextFlag)flags;
147 
155 + (void)destroyInstance;
156 
166 + (int)hasARModule;
167 
183 + (BOOL)initHumanDetection:(NSString *)modelFilePath
184  licenseFilePath:(NSString *)licenseFilePath
185  features:(int)features;
186 
203 + (BOOL)initHumanDetection:(NSString *)modelFilePath
204  licenseFilePath:(NSString *)licenseFilePath
205  features:(int)features
206  options:(NSMutableDictionary *)options;
207 
221 + (BOOL)initHumanDetectionExt:(NSString *)modelFilePath
222  licenseFilePath:(NSString *)licenseFilePath
223  features:(int)features;
224 
240 + (BOOL)initHumanDetectionExt:(NSString *)modelFilePath
241  licenseFilePath:(NSString *)licenseFilePath
242  features:(int)features
243  options:(NSMutableDictionary *)options;
244 
258 + (BOOL)setupHumanDetectionData:(int)dataType
259  dataFilePath:(NSString *)dataFilePath;
260 
268 + (void)closeHumanDetection;
269 
283 + (void)getSdkVersion:(int *)majorVersion minorVersion:(int *)minorVersion revisionNumber:(int *)revisionNumber;
284 
293 - (NSArray *)getAllBuiltinVideoFxNames;
294 
307 - (NvsVideoEffect *)createVideoEffect:(NSString *)effectId aspectRatio:(NvsEffectRational)aspectRatio;
308 
323 - (NvsVideoEffect *)createVideoEffect:(NSString *)effectId aspectRatio:(NvsEffectRational)aspectRatio realTime:(BOOL)realTime;
324 
338 - (NvsVideoEffectTransition *)createVideoTransition:(NSString *)transitionId aspectRatio:(NvsEffectRational)aspectRatio;
339 
358 - (NvsVideoEffectAnimatedSticker *)createAnimatedSticker:(int64_t)inPoint duration:(int64_t)duration isPanoramic:(bool)isPanoramic packageId:(NSString *)packageId aspectRatio:(NvsEffectRational)aspectRatio;
359 
380 - (NvsVideoEffectAnimatedSticker *)createCustomAnimatedSticker:(int64_t)inPoint duration:(int64_t)duration isPanoramic:(bool)isPanoramic packageId:(NSString *)packageId customImageFilePath:(NSString *)customImageFilePath aspectRatio:(NvsEffectRational)aspectRatio;
381 
398 - (NvsVideoEffectCompoundCaption *)createCompoundCaption:(int64_t)inPoint duration:(int64_t)duration packageId:(NSString *)packageId aspectRatio:(NvsEffectRational)aspectRatio;
399 
416 - (NvsVideoEffectCompoundCaption *)createPanoramicCompoundCaption:(int64_t)inPoint duration:(int64_t)duration packageId:(NSString *)packageId aspectRatio:(NvsEffectRational)aspectRatio;
417 
443 - (NvsVideoEffectCaption *)createCaption:(NSString *)captionText inPoint:(int64_t)inPoint duration:(int64_t)duration captionStylePackageId:(NSString *)captionStylePackageId aspectRatio:(NvsEffectRational)aspectRatio;
444 
470 - (NvsVideoEffectCaption *)createPanoramicCaption:(NSString *)captionText inPoint:(int64_t)inPoint duration:(int64_t)duration captionStylePackageId:(NSString *)captionStylePackageId aspectRatio:(NvsEffectRational)aspectRatio;
471 
495 - (NvsVideoEffectCaption *)createModularCaption:(NSString *)captionText inPoint:(int64_t)inPoint duration:(int64_t)duration aspectRatio:(NvsEffectRational)aspectRatio;
496 
520 - (NvsVideoEffectCaption *)createPanoramicModularCaption:(NSString *)captionText inPoint:(int64_t)inPoint duration:(int64_t)duration aspectRatio:(NvsEffectRational)aspectRatio;
521 
531 
542 - (NSArray*)getFontInfoByFilePath:(NSString *)fontFilePath;
543 
553 - (NSString *)registerFontByFilePath:(NSString *)filePath;
554 
562 - (void)UnregisterFontByFilePath:(NSString *)filePath;
563 
576 + (BOOL)functionalityAuthorised:(NSString *)sdkFunctionName;
579 @end
NvsVideoEffect.h
NvsEffectSdkHumanDetectionFeature_HandAction
@ NvsEffectSdkHumanDetectionFeature_HandAction
Definition: NvsEffectSdkContext.h:53
NvsVideoEffectAnimatedSticker
Animated sticker class.
Definition: NvsVideoEffectAnimatedSticker.h:35
NvsEffectSdkHumanDetectionDataType_SkinColor
@ NvsEffectSdkHumanDetectionDataType_SkinColor
Definition: NvsEffectSdkContext.h:88
NvsEffectSdkHumanDetectionFeature_MultiDetect
@ NvsEffectSdkHumanDetectionFeature_MultiDetect
Definition: NvsEffectSdkContext.h:56
NvsVideoEffectTransition.h
NvsEffectSdkHumanDetectionDataType_Makeup2
@ NvsEffectSdkHumanDetectionDataType_Makeup2
Definition: NvsEffectSdkContext.h:92
NvsVideoEffectCaption
captions.
Definition: NvsVideoEffectCaption.h:119
NvsEffectSdkHumanDetectionFeature_FaceAttriShape
@ NvsEffectSdkHumanDetectionFeature_FaceAttriShape
Definition: NvsEffectSdkContext.h:60
NvsEffectRenderCore.h
-[NvsEffectSdkContext getAllBuiltinVideoFxNames]
NSArray * getAllBuiltinVideoFxNames()
Gets a list of all build-in video effects' names.
NvsEffectRational
Rational value.
Definition: NvsEffectCommonDef.h:28
NvsEffectSdkContextDebugLogDelegate-p
Definition: NvsEffectSdkContext.h:97
NvsEffectSdkHumanDetectionDataType_FaceCommon
@ NvsEffectSdkHumanDetectionDataType_FaceCommon
Definition: NvsEffectSdkContext.h:93
NvsEffectSdkHumanDetectionFeature_AvatarExpression
@ NvsEffectSdkHumanDetectionFeature_AvatarExpression
Definition: NvsEffectSdkContext.h:44
NvsVideoEffectTransition
Video transition is a effect of switching between clips.
Definition: NvsVideoEffectTransition.h:50
NvsEffectSdkHumanDetectionFeature_Background
@ NvsEffectSdkHumanDetectionFeature_Background
Definition: NvsEffectSdkContext.h:51
NvsVideoEffect
Video effect.
Definition: NvsVideoEffect.h:44
NvsEffectSdkContextFlag
NvsEffectSdkContextFlag
Effect SDK context creation flag.
Definition: NvsEffectSdkContext.h:31
NvsEffectSdkHumanDetectionFeature_HalfBody
@ NvsEffectSdkHumanDetectionFeature_HalfBody
Definition: NvsEffectSdkContext.h:58
NvsEffectSdkHumanDetectionFeature_Extra
@ NvsEffectSdkHumanDetectionFeature_Extra
Definition: NvsEffectSdkContext.h:50
-[NvsEffectSdkContext createEffectRenderCore]
NvsEffectRenderCore * createEffectRenderCore()
Creates a special effect rendering object.
+[NvsEffectSdkContext hasARModule]
int hasARModule()
Checks if the current SDK contains an AR module.
NvsEffectSdkContext::assetPackageManager
NvsAssetPackageManager * assetPackageManager
Asset package manager.
Definition: NvsEffectSdkContext.h:122
NvsEffectSdkHumanDetectionFeature_FaceAttri
@ NvsEffectSdkHumanDetectionFeature_FaceAttri
Definition: NvsEffectSdkContext.h:59
NvsEffectSdkHumanDetectionFeature_MultiThread
@ NvsEffectSdkHumanDetectionFeature_MultiThread
Definition: NvsEffectSdkContext.h:48
+[NvsEffectSdkContext closeHumanDetection]
void closeHumanDetection()
Turns off the human detection mechanism.
NvsEffectSdkHumanDetectionFeature_SemiImageMode
@ NvsEffectSdkHumanDetectionFeature_SemiImageMode
Definition: NvsEffectSdkContext.h:47
NvsEffectSdkHumanDetectionFeature_HandBone
@ NvsEffectSdkHumanDetectionFeature_HandBone
Definition: NvsEffectSdkContext.h:54
NvsEffectSdkHumanDetectionDataType_Makeup
@ NvsEffectSdkHumanDetectionDataType_Makeup
Definition: NvsEffectSdkContext.h:87
NvsEffectSdkHumanDetectionFeature_EyeballLandmark
@ NvsEffectSdkHumanDetectionFeature_EyeballLandmark
Definition: NvsEffectSdkContext.h:55
NvsEffectSdkHumanDetectionFeature_FaceLandmark
@ NvsEffectSdkHumanDetectionFeature_FaceLandmark
Definition: NvsEffectSdkContext.h:42
NvsEffectSdkHumanDetectionDataType_CustomAvatar
@ NvsEffectSdkHumanDetectionDataType_CustomAvatar
Definition: NvsEffectSdkContext.h:91
NvsVideoEffectCaption.h
NvsVideoEffectAnimatedSticker.h
NvsEffectSdkHumanDetectionFeature_FaceAction
@ NvsEffectSdkHumanDetectionFeature_FaceAction
Definition: NvsEffectSdkContext.h:43
NvsEffectSdkHumanDetectionFeature_HandLandmark
@ NvsEffectSdkHumanDetectionFeature_HandLandmark
Definition: NvsEffectSdkContext.h:52
NvsEffectSdkContext
Effect SDK context class.
Definition: NvsEffectSdkContext.h:121
NvsEffectSdkHumanDetectionDataType_AdvancedBeauty
@ NvsEffectSdkHumanDetectionDataType_AdvancedBeauty
Definition: NvsEffectSdkContext.h:94
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
NvsVideoEffectCompoundCaption
Definition: NvsVideoEffectCompoundCaption.h:53
NvsEffectSdkHumanDetectionFeatureFlag
NvsEffectSdkHumanDetectionFeatureFlag
Human detection feature.
Definition: NvsEffectSdkContext.h:41
NvsEffectSdkHumanDetectionDataTypeFlag
NvsEffectSdkHumanDetectionDataTypeFlag
Human detection data packet type.
Definition: NvsEffectSdkContext.h:85
NvsEffectCommonDef.h
NvsEffectSdkHumanDetectionDataType_FakeFace
@ NvsEffectSdkHumanDetectionDataType_FakeFace
Definition: NvsEffectSdkContext.h:86
NvsEffectSdkHumanDetectionDataType_PE106
@ NvsEffectSdkHumanDetectionDataType_PE106
Definition: NvsEffectSdkContext.h:89
+[NvsEffectSdkContext destroyInstance]
void destroyInstance()
Destroys the effect sdk context instance.
NvsEffectSdkContextFlag_NoFlag
@ NvsEffectSdkContextFlag_NoFlag
Definition: NvsEffectSdkContext.h:32
NvsEffectRenderCore
Class for special effects rendering.
Definition: NvsEffectRenderCore.h:124
NvsEffectSdkHumanDetectionFeature_VideoMode
@ NvsEffectSdkHumanDetectionFeature_VideoMode
Definition: NvsEffectSdkContext.h:45
NvsAssetPackageManager.h
NvsEffectSdkHumanDetectionFeature_SingleThread
@ NvsEffectSdkHumanDetectionFeature_SingleThread
Definition: NvsEffectSdkContext.h:49
NvsVideoEffectCompoundCaption.h
NvsEffectSdkHumanDetectionFeature_ImageMode
@ NvsEffectSdkHumanDetectionFeature_ImageMode
Definition: NvsEffectSdkContext.h:46
NvsAssetPackageManager
Asset package manager for managing assets in video.
Definition: NvsAssetPackageManager.h:350
NvsEffectSdkHumanDetectionDataType_PE240
@ NvsEffectSdkHumanDetectionDataType_PE240
Definition: NvsEffectSdkContext.h:90
NvsEffectSdkHumanDetectionFeature_SegmentationSky
@ NvsEffectSdkHumanDetectionFeature_SegmentationSky
Definition: NvsEffectSdkContext.h:57