documentation

 
Loading...
Searching...
No Matches
vlSDK_Apple.h
Go to the documentation of this file.
1//
2// vlSDK_Apple.h
3// VisionLib Objective-C Interface
4//
5// Created by Timo Engelke on 02.11.16.
6// Copyright © 2016-2018 Visometry GmbH. All rights reserved.
7//
8// Version 0.4
9//
10
34#ifndef vlSDK_APPLE_h
35#define vlSDK_APPLE_h
36
37#include "vlSDKDef.h"
38
39#import <Foundation/Foundation.h>
40
41#include <TargetConditionals.h>
42
43#if TARGET_OS_IOS
44#import <UIKit/UIKit.h>
45#import <ARKit/ARKit.h>
46#endif
47
48#import <Metal/Metal.h>
49#import <CoreImage/CoreImage.h>
50
51#if TARGET_OS_IOS
52typedef void(*ARSessionCompletionHandler)(ARSession * _Nullable session);
53#endif
54
55/*
56@interface vlCameraDevice:NSObject {
57@public
58 NSString *deviceID;
59 NSString *internalID;
60 NSString *cameraName;
61 NSString *position;
62}
63@end
64
65@interface vlDeviceInfo:NSObject {
66@public
67 NSArray<vlCameraDevice *> *availableCameras;
68}
69 @end
70*/
71
72FOUNDATION_EXPORT VL_SDK_API @interface vlTrackingObjectState:NSObject {
73@public
74 NSString* name;
75 NSString* state;
76 float quality;
77 float _InitInlierRatio;
78 int _InitNumOfCorresp;
79 float _TrackingInlierRatio;
80 int _TrackingNumOfCorresp;
81 float _SFHFrameDist;
82 int _NumberOfPatternRecognitions;
83 int _NumberOfTemplates;
84 int _NumberOfTemplatesDynamic;
85 int _NumberOfTemplatesStatic;
86 int _NumberOfLineModels;
87 float _AutoInitSetupProgress;
88 int _TrackingImageWidth;
89 int _TrackingImageHeight;
90 double timeStamp;
91}
92@end
93
94FOUNDATION_EXPORT VL_SDK_API @interface vlTrackingDeviceState:NSObject {
95@public
96 NSString* name;
97 NSString* _WorldMappingStatus;
98}
99@end
100
101FOUNDATION_EXPORT VL_SDK_API @interface vlTrackingState:NSObject {
102@public
103 NSArray<vlTrackingObjectState*>* objects;
104 NSArray<vlTrackingDeviceState*>* inputs;
105}
106@end
107
115FOUNDATION_EXPORT VL_SDK_API @interface vlModelProperties:NSObject {
116@public
117
120
122 NSString *modelHash;
123
125 NSString *name;
126
128 NSString *uri;
129
132
135
138}
139/*@property (atomic, assign) bool enabled;
140@property (nonatomic, retain) NSString * _Nonnull modelHash;
141@property (nonatomic, retain) NSString *_Nonnull name;
142@property (nonatomic, assign) bool occluder;
143@property (nonatomic, assign) int subMeshCount;
144@property (nonatomic, assign) int triangleCount;
145@property (nonatomic, retain) NSString *_Nonnull uri;
146*/
147- (NSString * _Nullable)toString;
148@end
149
150FOUNDATION_EXPORT VL_SDK_API @interface VLIssue:NSObject {
151@public
152 NSString *info;
153 int code;
154 NSString *message;
155}
156@end
157
158FOUNDATION_EXPORT VL_SDK_API @interface VLIssues:NSObject {
159@public
160 NSArray<VLIssue *> *issues;
161}
163-(BOOL)hasCode:(int)code;
164
165@end
166
174FOUNDATION_EXPORT VL_SDK_API @protocol vlFrameListenerInterface <NSObject>
175
176@optional
177
178//
179
186-(NSMutableData * _Nonnull )onGetDebugImageBufferWithWidth:(int)width andHeight:(int)height andBytesPerPixel:(int)bytesPerPixel;
187
196-(void)onRawDebugImageBuffer:(NSData * _Nonnull)data withWidth:(int)width andHeight:(int)height andBytesPerPixel:(int)bytesPerPixel;
197
204-(void)onMetalDebugImageTexture:(_Nonnull id<MTLTexture>)texture withRotationMatrix:(float * _Nonnull)m;
205
212-(void)onCGDebugImageRef:(CGImageRef _Nonnull)texture withRotationMatrix:(float * _Nonnull)m;
213
214
215
223-(NSMutableData * _Nonnull )onGetImageBufferWithWidth:(int)width andHeight:(int)height andBytesPerPixel:(int)bytesPerPixel;
224
233-(void)onRawImageBuffer:(NSData * _Nonnull)data withWidth:(int)width andHeight:(int)height andBytesPerPixel:(int)bytesPerPixel;
234
241-(void)onMetalImageTexture:(_Nonnull id<MTLTexture>)texture withRotationMatrix:(float * _Nonnull)m;
242
249-(void)onCGImageRef:(CGImageRef _Nonnull)texture withRotationMatrix:(float * _Nonnull)m;
250
251
253
258-(void)onTrackerInitialized:(bool)worked;
259
268-(void)onIssuesTriggered:(VLIssues* _Nullable)warnings andErrors:(VLIssues* _Nullable)errors;
269
275-(void)onExtrinsicData:(float * _Nonnull)data isValid:(bool)valid;
276
281-(void)onIntrinsicData:(float * _Nonnull)data;
282
292-(void)onIntrinsicDataWithWidth:(float)width height:(float)height cx:(float)cx cy:(float)cy fx:(float)fx fy:(float)fy;
293
300-(void)onLog:(NSString * _Nonnull)logString;
301
306-(void)onTrackingPaused:(BOOL)worked;
307
311-(void)onSteppedFrame;
312
334-(void)onTrackingInformation:(vlTrackingState* _Nonnull)state;
335
339-(void)onInitPose:(float * _Nonnull)t andQ:(float* _Nonnull)q;
340
344-(void)onInitPoseMatrix:(float * _Nonnull)m;
345
350-(void)onResetTracking:(BOOL)hard;
351
352
354
359-(void) onCalibrationResults:(NSString * _Nullable)json;
360
361
367-(void) onGetAttribute:(NSString *_Nonnull)name withValue:(NSString *_Nonnull)value;
368
369
370-(void)onModelProperties:(NSArray<vlModelProperties*>* _Nonnull)info;
371-(void)onModelRemoved:(NSString * _Nullable)json withError:(NSString * _Nullable)errorJson;
372-(void)onRawModelAdded:(NSString * _Nullable)json withError:(NSString * _Nullable)errorJson;
373@end
374
375
380FOUNDATION_EXPORT VL_SDK_API @interface vlSDK : NSObject {
381}
382
383#if TARGET_OS_IOS
384- (void)getARSession:(_Nonnull ARSessionCompletionHandler)callback;
385#endif
386
393-(id _Nonnull) initTrackerWithURI:(NSString* _Nonnull)uri andDelegate:(id _Nullable)delegate __attribute((deprecated("Use functions that also set licensePath or licenseData")));
394
402-(id _Nonnull) initTrackerWithURI:(NSString* _Nonnull)uri andLicensePath:(NSString* _Nonnull)licensePath andDelegate:(id _Nullable)delegate;
403
411-(id _Nonnull) initTrackerWithURI:(NSString* _Nonnull)uri andLicenseData:(NSString* _Nonnull)licenseData andDelegate:(id _Nullable)delegate;
412
422-(id _Nonnull) initTrackerWithURI:(NSString* _Nonnull)uri andDelegate:(_Nullable id)delegate withOptions:(NSDictionary * _Nullable)options __attribute((deprecated("Use functions that also set licensePath or licenseData")));
423
434-(id _Nonnull) initTrackerWithURI:(NSString* _Nonnull)uri andLicensePath:(NSString* _Nonnull)licensePath andDelegate:(_Nullable id)delegate withOptions:(NSDictionary * _Nullable)options;
435
446-(id _Nonnull) initTrackerWithURI:(NSString* _Nonnull)uri andLicenseData:(NSString* _Nonnull)licenseData andDelegate:(_Nullable id)delegate withOptions:(NSDictionary * _Nullable)options;
447
448
452- (void) dealloc;
453
460-(void) process;
461
466-(void)step;
467
472-(BOOL) isPaused;
473
474
479-(void) pause:(BOOL)enable;
480
484-(void) run;
485
489-(void) stop;
490-(void) start;
491
492#if !TARGET_OS_IOS
493
497-(void) windowResized:(CGSize)size;
498
499#endif
500
505-(void) setLogLevel:(int)level;
506
511-(void) setFPS:(unsigned int)fps;
512
519-(void) setNearPlane:(float)near andFarPlane:(float)far;
520
526-(void) setInitPose:(float * _Nonnull)t andQ:(float* _Nonnull)q;
527
532-(void) setInitPoseFromMatrix:(float * _Nonnull)m;
533
535
540-(void) configureExtrinsicCameraInverted:(BOOL)invert;
541
545-(void) resetSoft;
546
552-(void) resetHard;
553
557-(void) getInitPose;
558
564-(BOOL) getLastExtrinsic:(float * _Nonnull)m;
565
572-(BOOL) enableDebugImage;
573
577-(BOOL) disableDebugImage;
578
579#if TARGET_OS_IOS
580
584-(UIImage * _Nullable)getLastImage;
585#else
586
590-(NSImage * _Nullable) getLastImage;
591
592#endif
593
600-(void)setAttributeCommand:(NSString * _Nonnull)attribute withFloatValue:(float)value;
601
608-(void)setAttributeCommand:(NSString * _Nonnull)attribute withStringValue:(NSString * _Nonnull)value;
609
615-(void)getAttributeRequest:(NSString * _Nonnull)attribute;
616
617
623-(void)setCalibrationCommand:(NSString * _Nonnull)command;
624
630-(void)writeCalibrationDB:(NSString * _Nonnull)uri;
631
638-(NSString * _Nullable)getTrackerType;
639
646-(NSString * _Nullable)getDeviceType;
647
659-(void)writeInitData:(NSString *_Nonnull)uri;
660
661
662
663
671-(void)readInitData:(NSString *_Nonnull)uri;
672
676-(void)resetInitData;
677
678
682-(void)setModel:(NSString *_Nonnull)name property:(NSString *_Nonnull)property state:(bool)enable;
683
684
685
689-(void)requestModelProperties;
690
694-(void)requestModelData:(NSString*_Nonnull)name withOptions:(NSString *_Nonnull)options;
695
696
700-(void)removeModel:(NSString*_Nonnull)nameURI;
701
738-(BOOL)addRawModelWithStruct:(NSString *_Nonnull)struc andData:(NSData*_Nonnull)data;
739
740
741-(void)pushJsonAndBinaryCommand:(NSString *_Nonnull)struc andData:(NSData*_Nonnull)data;
742-(void)pushJsonCommand:(NSString *_Nonnull)json;
743-(void)writeLineModelData:(NSString *_Nonnull)uri;
744-(void)readLineModelData:(NSString *_Nonnull)uri;
745
746@end
747
748
749#endif /* vlSDK_APPLE_h */
750
Definition vlSDK_Apple.h:150
Definition vlSDK_Apple.h:158
Properties of models managed by the visionlib. The model properties can be queried by calling request...
Definition vlSDK_Apple.h:115
NSString * modelHash
The model hash code for licensing of the model.
Definition vlSDK_Apple.h:122
NSString * name
The name which has either been automatically assigned, or is coming from the model definitions,...
Definition vlSDK_Apple.h:125
int subMeshCount
Stats of the model regarding the number of mehes.
Definition vlSDK_Apple.h:134
int triangleCount
Stats of the model regarding the number of triangles used.
Definition vlSDK_Apple.h:137
bool occluder
If the model will occlude other parts as an invisible part.
Definition vlSDK_Apple.h:131
NSString * uri
The URI of the object that has been referenced.
Definition vlSDK_Apple.h:128
bool enabled
If the model is expected to be shown.
Definition vlSDK_Apple.h:119
Convenient function for using the vlSDK in a simple manner. @discussion The vlSDK wrapper uses the C-...
Definition vlSDK_Apple.h:380
Definition vlSDK_Apple.h:94
Definition vlSDK_Apple.h:72
Definition vlSDK_Apple.h:101