LenStitcher.h 2.1 KB

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