OliveappVerificationControllerWithoutPrestart.h 2.8 KB

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