forked from HBehrens/CamHolderApp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUVCCameraControl.h
93 lines (75 loc) · 2.68 KB
/
UVCCameraControl.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#import <Foundation/Foundation.h>
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOMessage.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/usb/IOUSBLib.h>
#define UVC_INPUT_TERMINAL_ID 0x01
#define UVC_PROCESSING_UNIT_ID 0x02
#define UVC_CONTROL_INTERFACE_CLASS 14
#define UVC_CONTROL_INTERFACE_SUBCLASS 1
#define UVC_SET_CUR 0x01
#define UVC_GET_CUR 0x81
#define UVC_GET_MIN 0x82
#define UVC_GET_MAX 0x83
typedef struct {
int min, max;
} uvc_range_t;
typedef struct {
int unit;
int selector;
int size;
} uvc_control_info_t;
typedef struct {
uvc_control_info_t autoExposure;
uvc_control_info_t exposure;
uvc_control_info_t brightness;
uvc_control_info_t contrast;
uvc_control_info_t gain;
uvc_control_info_t saturation;
uvc_control_info_t sharpness;
uvc_control_info_t whiteBalance;
uvc_control_info_t autoWhiteBalance;
uvc_control_info_t absoluteFocus;
uvc_control_info_t autoFocus;
} uvc_controls_t ;
@interface UVCCameraControl : NSObject {
long dataBuffer;
IOUSBInterfaceInterface190 **interface;
NSArray *_discreteExposureValues;
}
@property(readonly, copy)NSArray *discreteExposureValues;
- (id)initWithLocationID:(UInt32)locationID;
- (id)initWithVendorID:(long)vendorID productID:(long)productID;
- (IOUSBInterfaceInterface190 **)getControlInferaceWithDeviceInterface:(IOUSBDeviceInterface **)deviceInterface;
- (BOOL)sendControlRequest:(IOUSBDevRequest)controlRequest;
- (BOOL)setData:(long)value withLength:(int)length forSelector:(int)selector at:(int)unitID;
- (long)getDataFor:(int)type withLength:(int)length fromSelector:(int)selector at:(int)unitID;
- (uvc_range_t)getRangeForControl:(const uvc_control_info_t *)control;
- (float)mapValue:(float)value fromMin:(float)fromMin max:(float)fromMax toMin:(float)toMin max:(float)toMax;
- (float)getValueForControl:(const uvc_control_info_t *)control;
- (BOOL)setDiscreteValue:(float)value fromSet:(NSArray*)discreteValues forControl:(uvc_control_info_t *)control;
- (BOOL)setValue:(float)value forControl:(const uvc_control_info_t *)control;
- (BOOL)setAutoExposure:(BOOL)enabled;
- (BOOL)getAutoExposure;
- (BOOL)setExposure:(float)value;
- (float)getExposure;
- (BOOL)setGain:(float)value;
- (float)getGain;
- (BOOL)setBrightness:(float)value;
- (float)getBrightness;
- (BOOL)setContrast:(float)value;
- (float)getContrast;
- (BOOL)setSaturation:(float)value;
- (float)getSaturation;
- (BOOL)setSharpness:(float)value;
- (float)getSharpness;
- (BOOL)setAutoWhiteBalance:(BOOL)enabled;
- (BOOL)getAutoWhiteBalance;
- (BOOL)setWhiteBalance:(float)value;
- (float)getWhiteBalance;
- (BOOL)setAbsoluteFocus:(float)value;
- (float)getAbsoluteFocus;
- (BOOL)getAutoFocus;
- (BOOL)setAutoFocus:(BOOL)enabled;
@end