-
Notifications
You must be signed in to change notification settings - Fork 5
/
IS.py
456 lines (456 loc) · 12 KB
/
IS.py
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
COLORMODE_INVALID = 0
COLORMODE_MONOCHROME = 1
COLORMODE_BAYER = 2
KODAK_KAI1020M_NAME = unicode("D1024G23M\0")
KODAK_KAI1020C_NAME = unicode("D1024G23C\0")
SENSOR_INVALID = 0x0000
SENSOR_C0640R13M = 0x0001
SENSOR_C0640R13C = 0x0002
SENSOR_C1280R23M = 0x0003
SENSOR_C1280R23C = 0x0004
SENSOR_C1600R12C = 0x0008
SENSOR_C2048R12C = 0x000a
SENSOR_C2592R12C = 0x000c
SENSOR_C0640G12M = 0x0010
SENSOR_C0640G12C = 0x0011
SENSOR_C0752G13M = 0x0012
SENSOR_C0752G13C = 0x0013
SENSOR_C1282R13C = 0x0015
SENSOR_C1601R13C = 0x0017
SENSOR_C0753G13M = 0x0018
SENSOR_C0753G13C = 0x0019
SENSOR_C0754G13M = 0x0022
SENSOR_C0754G13C = 0x0023
SENSOR_C1284R13C = 0x0025
SENSOR_C1604R13C = 0x0027
SENSOR_C1285R12M = 0x0028
SENSOR_C1285R12C = 0x0029
SENSOR_C1605R12C = 0x002B
SENSOR_C2055R12C = 0x002D
SENSOR_C2595R12C = 0x002F
SENSOR_C1280R12M = 0x0030
SENSOR_C1280R12C = 0x0031
SENSOR_C1283R12M = 0x0032
SENSOR_C1283R12C = 0x0033
SENSOR_C1603R12C = 0x0035
SENSOR_C2053R12C = 0x0037
SENSOR_C2593R12C = 0x0039
SENSOR_C1286R12C = 0x003B
SENSOR_D1024G13M = 0x0080
SENSOR_D1024G13C = 0x0081
SENSOR_D0640G13M = 0x0082
SENSOR_D0640G13C = 0x0083
SENSOR_D1281G12M = 0x0084
SENSOR_D1281G12C = 0x0085
SENSOR_D1024G23M = 0x0086
SENSOR_D1024G23C = 0x0087
SENSOR_D0640G12M = 0x0088
SENSOR_D0640G12C = 0x0089
SENSOR_D0640G14M = 0x0090
SENSOR_D0640G14C = 0x0091
SENSOR_D0768G12M = 0x0092
SENSOR_D0768G12C = 0x0093
SENSOR_D1280G12M = 0x0096
SENSOR_D1280G12C = 0x0097
SENSOR_D1600G12M = 0x0098
SENSOR_D1600G12C = 0x0099
NO_SUCCESS = -1
SUCCESS = 0
INVALID_CAMERA_HANDLE = 1
INVALID_HANDLE = 1
IO_REQUEST_FAILED = 2
CANT_OPEN_DEVICE = 3
CANT_CLOSE_DEVICE = 4
CANT_SETUP_MEMORY = 5
NO_HWND_FOR_ERROR_REPORT = 6
ERROR_MESSAGE_NOT_CREATED = 7
ERROR_STRING_NOT_FOUND = 8
HOOK_NOT_CREATED = 9
TIMER_NOT_CREATED = 10
CANT_OPEN_REGISTRY = 11
CANT_READ_REGISTRY = 12
CANT_VALIDATE_BOARD = 13
CANT_GIVE_BOARD_ACCESS = 14
NO_IMAGE_MEM_ALLOCATED = 15
CANT_CLEANUP_MEMORY = 16
CANT_COMMUNICATE_WITH_DRIVER = 17
FUNCTION_NOT_SUPPORTED_YET = 18
OPERATING_SYSTEM_NOT_SUPPORTED = 19
INVALID_VIDEO_IN = 20
INVALID_IMG_SIZE = 21
INVALID_ADDRESS = 22
INVALID_VIDEO_MODE = 23
INVALID_AGC_MODE = 24
INVALID_GAMMA_MODE = 25
INVALID_SYNC_LEVEL = 26
INVALID_CBARS_MODE = 27
INVALID_COLOR_MODE = 28
INVALID_SCALE_FACTOR = 29
INVALID_IMAGE_SIZE = 30
INVALID_IMAGE_POS = 31
INVALID_CAPTURE_MODE = 32
INVALID_RISC_PROGRAM = 33
INVALID_BRIGHTNESS = 34
INVALID_CONTRAST = 35
INVALID_SATURATION_U = 36
INVALID_SATURATION_V = 37
INVALID_HUE = 38
INVALID_HOR_FILTER_STEP = 39
INVALID_VERT_FILTER_STEP = 40
INVALID_EEPROM_READ_ADDRESS = 41
INVALID_EEPROM_WRITE_ADDRESS = 42
INVALID_EEPROM_READ_LENGTH = 43
INVALID_EEPROM_WRITE_LENGTH = 44
INVALID_BOARD_INFO_POINTER = 45
INVALID_DISPLAY_MODE = 46
INVALID_ERR_REP_MODE = 47
INVALID_BITS_PIXEL = 48
INVALID_MEMORY_POINTER = 49
FILE_WRITE_OPEN_ERROR = 50
FILE_READ_OPEN_ERROR = 51
FILE_READ_INVALID_BMP_ID = 52
FILE_READ_INVALID_BMP_SIZE = 53
FILE_READ_INVALID_BIT_COUNT = 54
WRONG_KERNEL_VERSION = 55
RISC_INVALID_XLENGTH = 60
RISC_INVALID_YLENGTH = 61
RISC_EXCEED_IMG_SIZE = 62
DD_MAIN_FAILED = 70
DD_PRIMSURFACE_FAILED = 71
DD_SCRN_SIZE_NOT_SUPPORTED = 72
DD_CLIPPER_FAILED = 73
DD_CLIPPER_HWND_FAILED = 74
DD_CLIPPER_CONNECT_FAILED = 75
DD_BACKSURFACE_FAILED = 76
DD_BACKSURFACE_IN_SYSMEM = 77
DD_MDL_MALLOC_ERR = 78
DD_MDL_SIZE_ERR = 79
DD_CLIP_NO_CHANGE = 80
DD_PRIMMEM_NULL = 81
DD_BACKMEM_NULL = 82
DD_BACKOVLMEM_NULL = 83
DD_OVERLAYSURFACE_FAILED = 84
DD_OVERLAYSURFACE_IN_SYSMEM = 85
DD_OVERLAY_NOT_ALLOWED = 86
DD_OVERLAY_COLKEY_ERR = 87
DD_OVERLAY_NOT_ENABLED = 88
DD_GET_DC_ERROR = 89
DD_DDRAW_DLL_NOT_LOADED = 90
DD_THREAD_NOT_CREATED = 91
DD_CANT_GET_CAPS = 92
DD_NO_OVERLAYSURFACE = 93
DD_NO_OVERLAYSTRETCH = 94
DD_CANT_CREATE_OVERLAYSURFACE = 95
DD_CANT_UPDATE_OVERLAYSURFACE = 96
DD_INVALID_STRETCH = 97
EV_INVALID_EVENT_NUMBER = 100
INVALID_MODE = 101
CANT_FIND_HOOK = 102
CANT_GET_HOOK_PROC_ADDR = 103
CANT_CHAIN_HOOK_PROC = 104
CANT_SETUP_WND_PROC = 105
HWND_NULL = 106
IMG_BMP = 0
IMG_JPG = 1
IMG_PNG = 2
IMG_RAW = 4
IMG_TIF = 8
INVALID_UPDATE_MODE = 107
NO_ACTIVE_IMG_MEM = 108
CANT_INIT_EVENT = 109
FUNC_NOT_AVAIL_IN_OS = 110
CAMERA_NOT_CONNECTED = 111
SEQUENCE_LIST_EMPTY = 112
CANT_ADD_TO_SEQUENCE = 113
LOW_OF_SEQUENCE_RISC_MEM = 114
IMGMEM2FREE_USED_IN_SEQ = 115
IMGMEM_NOT_IN_SEQUENCE_LIST = 116
SEQUENCE_BUF_ALREADY_LOCKED = 117
INVALID_DEVICE_ID = 118
INVALID_BOARD_ID = 119
ALL_DEVICES_BUSY = 120
HOOK_BUSY = 121
TIMED_OUT = 122
NULL_POINTER = 123
WRONG_HOOK_VERSION = 124
INVALID_PARAMETER = 125
NOT_ALLOWED = 126
OUT_OF_MEMORY = 127
INVALID_WHILE_LIVE = 128
ACCESS_VIOLATION = 129
UNKNOWN_ROP_EFFECT = 130
INVALID_RENDER_MODE = 131
INVALID_THREAD_CONTEXT = 132
NO_HARDWARE_INSTALLED = 133
INVALID_WATCHDOG_TIME = 134
INVALID_WATCHDOG_MODE = 135
INVALID_PASSTHROUGH_IN = 136
ERROR_SETTING_PASSTHROUGH_IN = 137
FAILURE_ON_SETTING_WATCHDOG = 138
NO_USB20 = 139
CAPTURE_RUNNING = 140
MEMORY_BOARD_ACTIVATED = 141
MEMORY_BOARD_DEACTIVATED = 142
NO_MEMORY_BOARD_CONNECTED = 143
TOO_LESS_MEMORY = 144
IMAGE_NOT_PRESENT = 145
MEMORY_MODE_RUNNING = 146
MEMORYBOARD_DISABLED = 147
TRIGGER_ACTIVATED = 148
WRONG_KEY = 150
CRC_ERROR = 151
NOT_YET_RELEASED = 152
NOT_CALIBRATED = 153
WAITING_FOR_KERNEL = 154
NOT_SUPPORTED = 155
TRIGGER_NOT_ACTIVATED = 156
OPERATION_ABORTED = 157
BAD_STRUCTURE_SIZE = 158
INVALID_BUFFER_SIZE = 159
INVALID_PIXEL_CLOCK = 160
INVALID_EXPOSURE_TIME = 161
AUTO_EXPOSURE_RUNNING = 162
CANNOT_CREATE_BB_SURF = 163
CANNOT_CREATE_BB_MIX = 164
BB_OVLMEM_NULL = 165
CANNOT_CREATE_BB_OVL = 166
NOT_SUPP_IN_OVL_SURF_MODE = 167
INVALID_SURFACE = 168
SURFACE_LOST = 169
RELEASE_BB_OVL_DC = 170
BB_TIMER_NOT_CREATED = 171
BB_OVL_NOT_EN = 172
ONLY_IN_BB_MODE = 173
INVALID_COLOR_FORMAT = 174
INVALID_WB_BINNING_MODE = 175
INVALID_I2C_DEVICE_ADDRESS = 176
COULD_NOT_CONVERT = 177
TRANSFER_ERROR = 178
OFF = 0
ON = 1
IGNORE_PARAMETER = -1
USE_DEVICE_ID = 0x8000L
GET_AUTO_EXIT_ENABLED = 0x8000
DISABLE_AUTO_EXIT = 0
ENABLE_AUTO_EXIT = 1
GET_LIVE = 0x8000
WAIT = 0x0001
DONT_WAIT = 0x0000
FORCE_VIDEO_STOP = 0x4000
FORCE_VIDEO_START = 0x4000
USE_NEXT_MEM = 0x8000
VIDEO_NOT_FINISH = 0
VIDEO_FINISH = 1
GET_RENDER_MODE = 0x8000
RENDER_DISABLED = 0
RENDER_NORMAL = 1
RENDER_FIT_TO_WINDOW = 2
RENDER_DOWNSCALE_1_2 = 4
RENDER_MIRROR_UPDOWN = 16
RENDER_DOUBLE_HEIGHT = 32
RENDER_HALF_HEIGHT = 64
GET_EXTERNALTRIGGER = 0x8000
GET_TRIGGER_STATUS = 0x8001
GET_TRIGGER_MASK = 0x8002
GET_TRIGGER_INPUTS = 0x8003
GET_SUPPORTED_TRIGGER_MODE = 0x8004
GET_TRIGGER_COUNTER = 0x8000
SET_TRIG_OFF = 0x000
SET_TRIG_HI_LO = 0x001
SET_TRIG_LO_HI = 0x002
SET_TRIG_SOFTWARE = 0x008
SET_TRIG_MASK = 0x100
GET_TRIGGER_DELAY = 0x8000
GET_MIN_TRIGGER_DELAY = 0x8001
GET_MAX_TRIGGER_DELAY = 0x8002
GET_TRIGGER_DELAY_GRANULARITY = 0x8003
GET_PIXEL_CLOCK = 0x8000
GET_DEFAULT_PIXEL_CLK = 0x8001
GET_FRAMERATE = 0x8000
GET_DEFAULT_FRAMERATE = 0x8001
GET_EXPOSURE_TIME = 0x8000
GET_DEFAULT_EXPOSURE = 0x8001
GET_MASTER_GAIN = 0x8000
GET_RED_GAIN = 0x8001
GET_GREEN_GAIN = 0x8002
GET_BLUE_GAIN = 0x8003
GET_DEFAULT_MASTER = 0x8004
GET_DEFAULT_RED = 0x8005
GET_DEFAULT_GREEN = 0x8006
GET_DEFAULT_BLUE = 0x8007
GET_GAINBOOST = 0x8008
SET_GAINBOOST_ON = 0x0001
SET_GAINBOOST_OFF = 0x0000
GET_SUPPORTED_GAINBOOST = 0x0002
GET_MASTER_GAIN_FACTOR = 0x8000
GET_RED_GAIN_FACTOR = 0x8001
GET_GREEN_GAIN_FACTOR = 0x8002
GET_BLUE_GAIN_FACTOR = 0x8003
SET_MASTER_GAIN_FACTOR = 0x8004
SET_RED_GAIN_FACTOR = 0x8005
SET_GREEN_GAIN_FACTOR = 0x8006
SET_BLUE_GAIN_FACTOR = 0x8007
GET_DEFAULT_MASTER_GAIN_FACTOR = 0x8008
GET_DEFAULT_RED_GAIN_FACTOR = 0x8009
GET_DEFAULT_GREEN_GAIN_FACTOR = 0x800a
GET_DEFAULT_BLUE_GAIN_FACTOR = 0x800b
INQUIRE_MASTER_GAIN_FACTOR = 0x800c
INQUIRE_RED_GAIN_FACTOR = 0x800d
INQUIRE_GREEN_GAIN_FACTOR = 0x800e
INQUIRE_BLUE_GAIN_FACTOR = 0x800f
SET_GLOBAL_SHUTTER_ON = 0x0001
SET_GLOBAL_SHUTTER_OFF = 0x0000
GET_GLOBAL_SHUTTER = 0x0010
GET_SUPPORTED_GLOBAL_SHUTTER = 0x0020
GET_BL_COMPENSATION = 0x8000
GET_BL_OFFSET = 0x8001
GET_BL_DEFAULT_MODE = 0x8002
GET_BL_DEFAULT_OFFSET = 0x8003
GET_BL_SUPPORTED_MODE = 0x8004
BL_COMPENSATION_DISABLE = 0
BL_COMPENSATION_ENABLE = 1
BL_COMPENSATION_OFFSET = 32
GET_HW_GAMMA = 0x8000
GET_HW_SUPPORTED_GAMMA = 0x8001
SET_HW_GAMMA_OFF = 0x0000
SET_HW_GAMMA_ON = 0x0001
GET_BRIGHTNESS = 0x8000
MIN_BRIGHTNESS = 0
MAX_BRIGHTNESS = 255
DEFAULT_BRIGHTNESS = -1
GET_CONTRAST = 0x8000
MIN_CONTRAST = 0
MAX_CONTRAST = 511
DEFAULT_CONTRAST = -1
GET_GAMMA = 0x8000
MIN_GAMMA = 1
MAX_GAMMA = 1000
DEFAULT_GAMMA = -1
GET_SATURATION_U = 0x8000
MIN_SATURATION_U = 0
MAX_SATURATION_U = 511
DEFAULT_SATURATION_U = 254
GET_SATURATION_V = 0x8001
MIN_SATURATION_V = 0
MAX_SATURATION_V = 511
DEFAULT_SATURATION_V = 180
GET_HUE = 0x8000
MIN_HUE = 0
MAX_HUE = 255
DEFAULT_HUE = 128
GET_IMAGE_SIZE_X = 0x8000
GET_IMAGE_SIZE_Y = 0x8001
GET_IMAGE_SIZE_X_INC = 0x8002
GET_IMAGE_SIZE_Y_INC = 0x8003
GET_IMAGE_SIZE_X_MIN = 0x8004
GET_IMAGE_SIZE_Y_MIN = 0x8005
GET_IMAGE_SIZE_X_MAX = 0x8006
GET_IMAGE_SIZE_Y_MAX = 0x8007
GET_IMAGE_POS_X = 0x8001
GET_IMAGE_POS_Y = 0x8002
GET_IMAGE_POS_X_ABS = 0xC001
GET_IMAGE_POS_Y_ABS = 0xC002
GET_IMAGE_POS_X_INC = 0xC003
GET_IMAGE_POS_Y_INC = 0xC004
GET_IMAGE_POS_X_MIN = 0xC005
GET_IMAGE_POS_Y_MIN = 0xC006
GET_IMAGE_POS_X_MAX = 0xC007
GET_IMAGE_POS_Y_MAX = 0xC008
SET_IMAGE_POS_X_ABS = 0x00010000
SET_IMAGE_POS_Y_ABS = 0x00010000
SET_IMAGEPOS_X_ABS = 0x8000
SET_IMAGEPOS_Y_ABS = 0x8000
GET_ROP_EFFECT = 0x8000
SET_ROP_NONE = 0
SET_ROP_MIRROR_UPDOWN = 8
SET_ROP_MIRROR_UPDOWN_ODD = 16
SET_ROP_MIRROR_UPDOWN_EVEN = 32
SET_ROP_MIRROR_LEFTRIGHT = 64
GET_SUBSAMPLING = 0x8000
GET_SUPPORTED_SUBSAMPLING = 0x8001
GET_SUBSAMPLING_TYPE = 0x8002
SUBSAMPLING_DISABLE = 0x00
SUBSAMPLING_2X_VERTICAL = 0x01
SUBSAMPLING_2X_HORIZONTAL = 0x02
SUBSAMPLING_4X_VERTICAL = 0x04
SUBSAMPLING_4X_HORIZONTAL = 0x08
SUBSAMPLING_COLOR = 0x01
SUBSAMPLING_MONO = 0x02
SUBSAMPLING_VERT = 1
SUBSAMPLING_HOR = 2
GET_BINNING = 0x8000
GET_SUPPORTED_BINNING = 0x8001
GET_BINNING_TYPE = 0x8002
BINNING_DISABLE = 0x00
BINNING_2X_VERTICAL = 0x01
BINNING_2X_HORIZONTAL = 0x02
BINNING_4X_VERTICAL = 0x04
BINNING_4X_HORIZONTAL = 0x08
BINNING_COLOR = 0x01
BINNING_MONO = 0x02
BINNING_VERT = 1
BINNING_HOR = 2
SET_ENABLE_AUTO_GAIN = 0x8800
GET_ENABLE_AUTO_GAIN = 0x8801
SET_ENABLE_AUTO_SHUTTER = 0x8802
GET_ENABLE_AUTO_SHUTTER = 0x8803
SET_ENABLE_AUTO_WHITEBALANCE = 0x8804
GET_ENABLE_AUTO_WHITEBALANCE = 0x8805
SET_ENABLE_AUTO_FRAMERATE = 0x8806
GET_ENABLE_AUTO_FRAMERATE = 0x8807
SET_AUTO_REFERENCE = 0x8000
GET_AUTO_REFERENCE = 0x8001
SET_AUTO_GAIN_MAX = 0x8002
GET_AUTO_GAIN_MAX = 0x8003
SET_AUTO_SHUTTER_MAX = 0x8004
GET_AUTO_SHUTTER_MAX = 0x8005
SET_AUTO_SPEED = 0x8006
GET_AUTO_SPEED = 0x8007
SET_AUTO_WB_OFFSET = 0x8008
GET_AUTO_WB_OFFSET = 0x8009
SET_AUTO_WB_GAIN_RANGE = 0x800A
GET_AUTO_WB_GAIN_RANGE = 0x800B
SET_AUTO_WB_SPEED = 0x800C
GET_AUTO_WB_SPEED = 0x800D
SET_AUTO_WB_ONCE = 0x800E
GET_AUTO_WB_ONCE = 0x800F
SET_AUTO_BRIGHTNESS_ONCE = 0x8010
GET_AUTO_BRIGHTNESS_ONCE = 0x8011
MIN_AUTO_BRIGHT_REFERENCE = 0
MAX_AUTO_BRIGHT_REFERENCE = 255
DEFAULT_AUTO_BRIGHT_REFERENCE = 128
MIN_AUTO_SPEED = 0
MAX_AUTO_SPEED = 100
DEFAULT_AUTO_SPEED = 50
DEFAULT_AUTO_WB_OFFSET = 0
MIN_AUTO_WB_OFFSET = -50
MAX_AUTO_WB_OFFSET = 50
DEFAULT_AUTO_WB_SPEED = 50
MIN_AUTO_WB_SPEED = 0
MAX_AUTO_WB_SPEED = 100
MIN_AUTO_WB_REFERENCE = 0
MAX_AUTO_WB_REFERENCE = 255
SET_AUTO_BRIGHT_AOI = 0x8000
GET_AUTO_BRIGHT_AOI = 0x8001
SET_IMAGE_AOI = 0x8002
GET_IMAGE_AOI = 0x8003
SET_AUTO_WB_AOI = 0x8004
GET_AUTO_WB_AOI = 0x8005
GET_COLOR_MODE = 0x8000
SET_CM_RGB32 = 0
SET_CM_RGB24 = 1
SET_CM_RGB16 = 2
SET_CM_RGB15 = 3
SET_CM_Y8 = 6
SET_CM_BAYER = 11
SET_CM_UYVY = 12
SET_CM_UYVY_MONO = 13
SET_CM_UYVY_BAYER = 14
GET_BPC_MODE = 0x8000
GET_BPC_THRESHOLD = 0x8001
GET_BPC_SUPPORTED_MODE = 0x8002
BPC_DISABLE = 0
BPC_ENABLE_LEVEL_1 = 1
BPC_ENABLE_LEVEL_2 = 2
BPC_ENABLE_USER = 4
BPC_ENABLE_SOFTWARE = 2