-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCameraScrollView.h
More file actions
86 lines (72 loc) · 2.93 KB
/
CameraScrollView.h
File metadata and controls
86 lines (72 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//
// CameraScrollView.h
// CellScope
//
// Created by Frankie Myers on 11/7/13.
// Copyright (c) 2013 UC Berkeley Fletcher Lab. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <ImageIO/ImageIO.h>
#import "NSMutableDictionary+ImageMetadata.h"
#import "UIImage+Transform.h"
#import "ScrollBarView.h"
#import "MoviePlayerView.h"
@interface CameraScrollView : UIScrollView <UIScrollViewDelegate, AVCaptureFileOutputRecordingDelegate>
typedef NS_ENUM(NSInteger, CSCaptureMode) {
CSCaptureModePhoto,
CSCaptureModeVideo,
CSCaptureModeTimelapse
};
typedef void (^VideoLoadCompletionBlock)(void);
@property (nonatomic, strong) AVCaptureSession *session;
@property (nonatomic, strong) AVCaptureDevice *device;
@property (nonatomic, strong) AVCaptureDeviceInput *input;
@property (nonatomic, strong) AVCaptureStillImageOutput *stillOutput;
@property (nonatomic, strong) AVCaptureMovieFileOutput *movieOutput;
//stuff for movie playback
@property (nonatomic) AVPlayer *player;
@property (nonatomic) AVPlayerItem *playerItem;
@property (nonatomic,strong) VideoLoadCompletionBlock videoCompletionBlock;
@property (strong,nonatomic) ScrollBarView* scrollBarView;
@property (strong,nonatomic) UIView* previewLayerView;
@property (strong,atomic) UIImage* lastCapturedImage;
@property (strong,atomic) NSMutableDictionary* lastImageMetadata;
@property (strong,atomic) NSURL* lastCapturedVideoURL;
@property (nonatomic) AVCaptureVideoOrientation orientation;
@property (nonatomic) CGAffineTransform transform;
@property (nonatomic) BOOL isRecording;
@property (nonatomic) BOOL isPlaying;
@property (nonatomic) BOOL previewRunning;
@property (nonatomic) BOOL isFocusLocked;
@property (nonatomic) BOOL isExposureLocked;
@property (nonatomic) BOOL doPlaybackLoop;
@property (nonatomic) CSCaptureMode captureMode;
- (void) setupCameraWithMode:(CSCaptureMode)mode
Orientation:(AVCaptureVideoOrientation)orientation
transform:(CGAffineTransform)transform;
- (void) zoomExtentsWithAnimation:(BOOL)animated;
- (void) startPreview;
- (void) stopPreview;
- (void) grabImage;
- (void) startVideoRecording;
- (void) stopVideoRecording;
- (void) showImage:(UIImage*)image;
- (void) setExposureLock:(BOOL)locked;
- (void) setFocusLock:(BOOL)locked;
- (void) addScaleBarWithLocation:(CGPoint)location
minLength:(float)minLength
maxLength:(float)maxLength
pixelsPerMM:(float)pixelsPerMM
snapLengthsInMM:(NSArray*)snaps
color:(UIColor*)color
lineWidth:(float)lineWidth
fontSize:(float)fontSize
showMicrons:(BOOL)showMicrons;
//methods for movie playback
- (void)loadVideoFromFile:(NSURL*)fileURL
completionAction:(VideoLoadCompletionBlock)completionBlock;
- (void)playVideo;
- (void)pauseVideo;
- (void)seekToTime:(CMTime)time;
@end