LenStitcher.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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, // 当前拍摄固定了方向,请勿往反方向移动
  18. };
  19. typedef NS_ENUM(NSInteger, LenVideoStitchNeedSave) {
  20. LenVideoStitchUnNeedSaveImage, //拼接结果不需要保存
  21. LenVideoStitchNeedSaveImage, //需要保存
  22. };
  23. typedef NS_ENUM(NSInteger, LenVideoPathRestResult) {
  24. LenVideoPathRestResultFail,
  25. LenVideoPathRestResultSuccess,
  26. };
  27. typedef NS_ENUM(int, LenVideoStitchDirction) {
  28. LenVideoStitchDirctionAny,
  29. LenVideoStitchDirctionUp,
  30. LenVideoStitchDirctionDown,
  31. LenVideoStitchDirctionLeft,
  32. LenVideoStitchDirctionRight,
  33. };
  34. NS_ASSUME_NONNULL_BEGIN
  35. @interface LenStitcher : NSObject
  36. /// videostitch with default path,
  37. + (void)videoStitchWith:(CMSampleBufferRef)sampleBuffer
  38. dirction:(LenVideoStitchDirction)dirction
  39. isStop:(BOOL)isStop
  40. complete:(void (^)(LenVideoStitchResult result, LenVideoStitchNeedSave needSave))complete;
  41. /// video reset path with default path
  42. + (LenVideoPathRestResult)videoResetPath;
  43. /// video current stitch local path
  44. + (NSString *)getCurrentPanoramaShow;
  45. /// show last stitch image
  46. + (UIImage *)getCurrentPanoramaShowImage;
  47. /// reset video path with custom path
  48. /// @param path image local path
  49. + (LenVideoPathRestResult)videoResetPathWith:(NSString *)path;
  50. /// just for test
  51. + (UIImage *)testImageWith:(CMSampleBufferRef)sampleBuffer;
  52. + (NSString *)getTestCurrentPanoramaShow;
  53. @end
  54. NS_ASSUME_NONNULL_END