2014 snapchat source code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.3 KiB

  1. //
  2. // SCManagedStillImageCapturer_Protected.h
  3. // Snapchat
  4. //
  5. // Created by Chao Pang on 10/4/16.
  6. // Copyright © 2016 Snapchat, Inc. All rights reserved.
  7. //
  8. SC_EXTERN_C_BEGIN
  9. extern NSDictionary *cameraInfoForBuffer(CMSampleBufferRef imageDataSampleBuffer);
  10. SC_EXTERN_C_END
  11. extern NSString *const kSCManagedStillImageCapturerErrorDomain;
  12. #if !TARGET_IPHONE_SIMULATOR
  13. extern NSInteger const kSCManagedStillImageCapturerNoStillImageConnection;
  14. #endif
  15. extern NSInteger const kSCManagedStillImageCapturerApplicationStateBackground;
  16. // We will do the image capture regardless if these is still camera adjustment in progress after 0.4 seconds.
  17. extern NSTimeInterval const kSCManagedStillImageCapturerDeadline;
  18. extern NSTimeInterval const kSCCameraRetryInterval;
  19. @protocol SCManagedCapturerLensAPI;
  20. @interface SCManagedStillImageCapturer () {
  21. @protected
  22. id<SCManagedCapturerLensAPI> _lensAPI;
  23. id<SCPerforming> _performer;
  24. AVCaptureSession *_session;
  25. id<SCManagedStillImageCapturerDelegate> __weak _delegate;
  26. NSString *_captureSessionID;
  27. SCCapturerLightingConditionType _lightingConditionType;
  28. }
  29. - (instancetype)initWithSession:(AVCaptureSession *)session
  30. performer:(id<SCPerforming>)performer
  31. lensProcessingCore:(id<SCManagedCapturerLensAPI>)lensProcessingCore
  32. delegate:(id<SCManagedStillImageCapturerDelegate>)delegate;
  33. - (UIImage *)imageFromData:(NSData *)data
  34. currentZoomFactor:(float)currentZoomFactor
  35. targetAspectRatio:(CGFloat)targetAspectRatio
  36. fieldOfView:(float)fieldOfView
  37. state:(SCManagedCapturerState *)state
  38. sampleBuffer:(CMSampleBufferRef)sampleBuffer;
  39. - (UIImage *)imageFromData:(NSData *)data
  40. currentZoomFactor:(float)currentZoomFactor
  41. targetAspectRatio:(CGFloat)targetAspectRatio
  42. fieldOfView:(float)fieldOfView
  43. state:(SCManagedCapturerState *)state
  44. metadata:(NSDictionary *)metadata;
  45. - (UIImage *)imageFromImage:(UIImage *)image
  46. currentZoomFactor:(float)currentZoomFactor
  47. targetAspectRatio:(CGFloat)targetAspectRatio
  48. fieldOfView:(float)fieldOfView
  49. state:(SCManagedCapturerState *)state;
  50. - (CMTime)adjustedExposureDurationForNightModeWithCurrentExposureDuration:(CMTime)exposureDuration;
  51. @end