-
Notifications
You must be signed in to change notification settings - Fork 50
/
ImageSnap.h
62 lines (49 loc) · 1.6 KB
/
ImageSnap.h
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
//
// ImageSnap.h
// ImageSnap
//
// Created by Robert Harder on 9/10/09.
//
#import <AVFoundation/AVFoundation.h>
#import <Cocoa/Cocoa.h>
#include "ImageSnap.h"
#define error(...) (fprintf(stderr, __VA_ARGS__) && fflush(stderr))
#define console(...) (!g_quiet && printf(__VA_ARGS__) && fflush(stdout))
#define verbose(...) (g_verbose && !g_quiet && fprintf(stderr, __VA_ARGS__) && fflush(stderr))
static BOOL g_verbose = NO;
static BOOL g_quiet = NO;
static uint DEFAULT_WARMUP = 3;
FOUNDATION_EXPORT NSString *const VERSION;
@interface ImageSnap : NSObject
+ (void)setVerbose:(BOOL)verbose;
+ (void)setQuiet:(BOOL)quiet;
/**
* Returns all attached QTCaptureDevice objects that have video.
* This includes video-only devices (QTMediaTypeVideo) and
* audio/video devices (QTMediaTypeMuxed).
*
* @return array of video devices
*/
+ (NSArray *)videoDevices;
/**
* Returns the default QTCaptureDevice object for video
* or nil if none is found.
*/
+ (AVCaptureDevice *)defaultVideoDevice;
/**
* Returns the QTCaptureDevice with the given name
* or nil if the device cannot be found.
*/
+ (AVCaptureDevice *)deviceNamed:(NSString *)name;
- (void)setUpSessionWithDevice:(AVCaptureDevice *)device;
/**
* Primary one-stop-shopping message for capturing an image.
* Activates the video source, saves a frame, stops the source,
* and saves the file.
*/
- (void)saveSingleSnapshotFrom:(AVCaptureDevice *)device
toFile:(NSString *)path
withWarmup:(NSNumber *)warmup
withTimelapse:(NSNumber *)timelapse
withLimit:(NSNumber *)limit;
@end