LenStitcher.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // LenStitcher.h
  3. // LenzCameraNativeModuleForRN
  4. //
  5. // Created by lr on 2023/2/9.
  6. //
  7. #import "lenz_stitch_jni.hpp"
  8. #import <Foundation/Foundation.h>
  9. #import <CoreMedia/CoreMedia.h>
  10. #import <UIKit/UIKit.h>
  11. typedef NS_ENUM(NSInteger, LenVideoStitchResult) {
  12. LenVideoStitchResultStitchFail = -1, // -1 拍摄完成后拼接大图失败
  13. LenVideoStitchResultFail, //0: 拍摄过程中产生拼接缩略图失败
  14. LenVideoStitchResultSuccess, //1: 视频拼接成功
  15. LenVideoStitchResultSlowMore, // 2:特征点变少,放慢速度
  16. LenVideoStitchResultSlow, //3 : 特征点极少,即将失败
  17. LenVideoStitchResultDirectError, // 4:当前拍摄固定了方向,请勿往反方向移动
  18. LenVideoStitchResultModerate, // 5:请减速拍摄
  19. LenVideoStitchResultParallel, // 6:请正对目标物平行拍摄
  20. };
  21. typedef NS_ENUM(NSInteger, LenVideoStitchNeedSave) {
  22. LenVideoStitchUnNeedSaveImage, //拼接结果不需要保存
  23. LenVideoStitchNeedSaveImage, //需要保存
  24. };
  25. typedef NS_ENUM(NSInteger, LenVideoPathRestResult) {
  26. LenVideoPathRestResultFail,
  27. LenVideoPathRestResultSuccess,
  28. };
  29. typedef NS_ENUM(int, LenVideoStitchDirction) {
  30. LenVideoStitchDirctionAny,
  31. LenVideoStitchDirctionUp,
  32. LenVideoStitchDirctionDown,
  33. LenVideoStitchDirctionLeft,
  34. LenVideoStitchDirctionRight,
  35. };
  36. NS_ASSUME_NONNULL_BEGIN
  37. @interface LenStitcher : NSObject
  38. /// videostitch with default path,
  39. + (void)videoStitchWith:(CMSampleBufferRef)sampleBuffer
  40. dirction:(LenVideoStitchDirction)dirction
  41. isStop:(BOOL)isStop
  42. complete:(void (^)(LenVideoStitchResult result, LenVideoStitchNeedSave needSave))complete;
  43. /// video reset path with default path
  44. + (LenVideoPathRestResult)videoResetPath;
  45. /// video current stitch local path
  46. + (NSString *)getCurrentPanoramaShow;
  47. /// show last stitch image
  48. + (UIImage *)getCurrentPanoramaShowImage;
  49. /// reset video path with custom path
  50. /// @param path image local path
  51. + (LenVideoPathRestResult)videoResetPathWith:(NSString *)path;
  52. /// just for test
  53. + (UIImage *)testImageWith:(CMSampleBufferRef)sampleBuffer;
  54. + (NSString *)getTestCurrentPanoramaShow;
  55. @end
  56. NS_ASSUME_NONNULL_END