OliveappVerificationController.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // VerificationController.h
  3. // LivenessDetectionViewSDK
  4. //
  5. // Created by Jiteng Hao on 16/1/11.
  6. // Copyright © 2016年 Oliveapp. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "OliveappAsyncLivenessDetectorDelegate.h"
  10. #import "OliveappAsyncPrestartValidatorDelegate.h"
  11. #import "OliveappCameraPreviewDelegate.h"
  12. #import "OliveappPrestartValidator.h"
  13. #import "OliveappLivenessDetector.h"
  14. #import "OliveappViewUpdateEventDelegate.h"
  15. #import "OliveappVerificationDelegate.h"
  16. @interface OliveappVerificationController: NSObject <OliveappAsyncLivenessDetectorDelegate, OliveappAsyncPrestartValidatorDelegate, OliveappCameraPreviewDelegate, OliveappVerificationFilterDelegate>
  17. /**
  18. * 构造函数(依赖注入方式,主要用于测试). 注意: 所有参数不能为null
  19. * @param prestartValidator 预检模块实现
  20. * @param livenessDetector 活体检测模块实现
  21. * @param viewDelegate 更新UI的事件响应回调
  22. * @param error 错误码
  23. */
  24. - (BOOL) setConfigWithPrestartValidator: (OliveappPrestartValidator *) prestartValidator
  25. WithLivenessDetector: (OliveappLivenessDetector *) livenessDetector
  26. withViewDelegate: (id<OliveappViewUpdateEventDelegate>) viewDelegate
  27. withError: (NSError **) error;
  28. /**
  29. * 异步构造函数,内部会启动后台线程进行初始化, 初始化结束后会调用onInitializeSucc或onInitializeFail
  30. * 注意: 所有参数不能为null
  31. * @param config 初始化的配置
  32. * @param delegate 回调的代理对象
  33. * @param error 错误码
  34. */
  35. - (BOOL) setConfig: (OliveappSessionManagerConfig *) config
  36. withDelegate: (id<OliveappViewUpdateEventDelegate>)delegate
  37. withError: (NSError **) error;
  38. /**
  39. * 进入状态机的下一个步骤。其中READY和FINISH步骤是不做任何事情的
  40. * READY -> PRESTART -> LIVENESS -> FINISH
  41. * 准备 -> 预检 -> 活检 -> 结束
  42. */
  43. - (void) nextVerificationStep;
  44. - (NSUInteger) getCurrentStep;
  45. /*
  46. * 进入活检流程
  47. */
  48. - (void) enterLivenessDetection;
  49. /**
  50. 根据UI交互调整人脸框的位置,采用百分比,请务必设置正确
  51. @param xPercent 需要检测人脸左上角坐标x占全宽的百分比
  52. @param yPercent 需要检测人脸左上角坐标y占全宽的百分比
  53. @param widthPercent 需要检测人脸宽度占全宽的百分比
  54. @param heightPercent 需要检测人脸高度占全宽的百分比
  55. */
  56. - (void) setFaceLocation:(float) xPercent
  57. withYpercent:(float) yPercent
  58. withWidthPercent:(float) widthPercent
  59. withHeightPercent:(float) heightPercent;
  60. // 仅供测试,请不要直接调用
  61. - (void) onPreviewFrame:(OliveappPhotoImage *)image;
  62. - (BOOL) unInit;
  63. @end