OperationNodeAIPanorama.m 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // OperationNodeAIPanorama.m
  3. // LenzCameraNativeModuleForRN
  4. //
  5. // Created by 王昭威 on 2023/1/31.
  6. //
  7. #import "OperationNodeAIPanorama.h"
  8. #import "LenzSDKConstant.h"
  9. #import "PanoramaGuideView.h"
  10. #import "PanoramaOrientationView.h"
  11. @implementation OperationNodeAIPanorama
  12. @synthesize controller = _controller;
  13. - (SDKCaptureModeIndex)modeIndex{
  14. return SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA;
  15. }
  16. - (NSString *)modeItemString{
  17. return @"智能全景";
  18. }
  19. - (NSString *)modeTitleString{
  20. return LOCALIZATION_STRING_KEY_MODE_TITLE_AI_PANORAMIC;
  21. }
  22. - (void)updateUI{
  23. // self.controller.numberOfImagesLabel.hidden = NO;
  24. // self.controller.numberOfImagesLabel.text = [[NSString alloc] initWithString:LOCALIZATION_STRING_KEY_TIP_FOR_AI_PANORAMA];
  25. }
  26. - (nonnull instancetype)initWithController:(nonnull PCSBaseViewController *)controller {
  27. self = [super init];
  28. if(self){
  29. _controller = controller;
  30. }
  31. return self;
  32. }
  33. - (void)save {
  34. }
  35. - (void)takePhotoButtonTouched {
  36. if (self.AIType == OperationAITypeTap) {
  37. [self.controller takeStillPhoto];
  38. } else {
  39. [super takePhotoButtonTouched];
  40. }
  41. }
  42. - (BOOL)start{
  43. [super start];
  44. BOOL ret = [self.controller startVideoDataOutputing];
  45. if(ret){
  46. self.controller.panoramaGuideView.hidden = NO;
  47. self.controller.panoramOrientationGuideView.selectedItemIndex = PanoramaOrientationViewLeft;
  48. if ([self.controller.panoramOrientationGuideView.delegate respondsToSelector:@selector(panoramaOrientationViewslt:)]) {
  49. [self.controller.panoramOrientationGuideView.delegate panoramaOrientationViewslt:PanoramaOrientationViewLeft];
  50. }
  51. // [self.controller panoramaOrientationViewslt:PanoramaOrientationViewLeft];
  52. // self.controller.panoramOrientationGuideView.hidden = NO;
  53. }
  54. return ret;
  55. }
  56. - (void)stop{
  57. if (!NSThread.isMainThread) {
  58. __weak typeof(self) weakSelf = self;
  59. dispatch_async(dispatch_get_main_queue(), ^{
  60. // weakSelf.controller.switchButton.hidden = NO;
  61. // weakSelf.controller.panoramaGuideView.hidden = YES;
  62. // weakSelf.controller.panoramOrientationGuideView.hidden = YES;
  63. });
  64. } else {
  65. // self.controller.switchButton.hidden = NO;
  66. // self.controller.panoramaGuideView.hidden = YES;
  67. // self.controller.panoramOrientationGuideView.hidden = YES;
  68. }
  69. [super stop];
  70. dispatch_async(dispatch_get_main_queue(), ^{
  71. [self.controller stopVideoDataOutputing];
  72. });
  73. }
  74. - (void)triggered {
  75. [self stop];
  76. // self.controller.panoramOrientationGuideView.selectedItemIndex = PanoramaOrientationViewUp;
  77. }
  78. - (void)willQuitOnCompletion:(nonnull WillQuitCompletionBlockType)block {
  79. self.controller.panoramaGuideView.hidden = YES;
  80. self.controller.panoramOrientationGuideView.hidden = YES;
  81. }
  82. - (void)discardPhotoResultButtonTouchUpInside{
  83. }
  84. @end