framesource 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- frame_processors/__init__.py +37 -0
- frame_source/__init__.py +50 -0
- framesource/__init__.py +93 -0
- framesource/_msmf_config.py +26 -0
- framesource/_version.py +24 -0
- framesource/discovery.py +109 -0
- framesource/errors.py +82 -0
- framesource/factory.py +290 -0
- framesource/processors/__init__.py +34 -0
- framesource/processors/equirectangular360_processor.py +577 -0
- framesource/processors/fisheye2equirectangular_processor.py +328 -0
- framesource/processors/frame_processor.py +30 -0
- framesource/processors/hyperspectral_processor.py +23 -0
- framesource/processors/realsense_depth_processor.py +90 -0
- framesource/py.typed +0 -0
- framesource/sources/__init__.py +40 -0
- framesource/sources/audiospectrogram_capture.py +1068 -0
- framesource/sources/basler_capture.py +477 -0
- framesource/sources/folder_capture.py +920 -0
- framesource/sources/genicam_capture.py +681 -0
- framesource/sources/huateng_capture.py +245 -0
- framesource/sources/ipcamera_capture.py +254 -0
- framesource/sources/mvsdk.py +2454 -0
- framesource/sources/realsense_capture.py +565 -0
- framesource/sources/screen_capture.py +800 -0
- framesource/sources/video_capture_base.py +560 -0
- framesource/sources/video_file_capture.py +259 -0
- framesource/sources/webcam_capture.py +511 -0
- framesource/sources/ximea_capture.py +299 -0
- framesource/threading_utils.py +790 -0
- framesource-0.3.0.dist-info/METADATA +787 -0
- framesource-0.3.0.dist-info/RECORD +37 -0
- framesource-0.3.0.dist-info/WHEEL +5 -0
- framesource-0.3.0.dist-info/licenses/LICENSE +21 -0
- framesource-0.3.0.dist-info/scm_file_list.json +276 -0
- framesource-0.3.0.dist-info/scm_version.json +8 -0
- framesource-0.3.0.dist-info/top_level.txt +3 -0
|
@@ -0,0 +1,2454 @@
|
|
|
1
|
+
#coding=utf-8
|
|
2
|
+
import platform
|
|
3
|
+
from ctypes import *
|
|
4
|
+
from threading import local
|
|
5
|
+
|
|
6
|
+
# Return function type
|
|
7
|
+
CALLBACK_FUNC_TYPE = None
|
|
8
|
+
|
|
9
|
+
# SDK dynamic library
|
|
10
|
+
_sdk = None
|
|
11
|
+
|
|
12
|
+
def _Init():
|
|
13
|
+
global _sdk
|
|
14
|
+
global CALLBACK_FUNC_TYPE
|
|
15
|
+
|
|
16
|
+
is_win = (platform.system() == "Windows")
|
|
17
|
+
is_x86 = (platform.architecture()[0] == '32bit')
|
|
18
|
+
|
|
19
|
+
if is_win:
|
|
20
|
+
_sdk = windll.MVCAMSDK if is_x86 else windll.MVCAMSDK_X64
|
|
21
|
+
CALLBACK_FUNC_TYPE = WINFUNCTYPE
|
|
22
|
+
else:
|
|
23
|
+
_sdk = cdll.LoadLibrary("libMVSDK.so")
|
|
24
|
+
CALLBACK_FUNC_TYPE = CFUNCTYPE
|
|
25
|
+
|
|
26
|
+
_Init()
|
|
27
|
+
|
|
28
|
+
#-------------------------------------------Type definition--------------------------------------------------
|
|
29
|
+
|
|
30
|
+
# Status definition
|
|
31
|
+
CAMERA_STATUS_SUCCESS = 0 # Successful operation
|
|
32
|
+
CAMERA_STATUS_FAILED = -1 # operation failed
|
|
33
|
+
CAMERA_STATUS_INTERNAL_ERROR = -2 # internal error
|
|
34
|
+
CAMERA_STATUS_UNKNOW = -3 # unknown mistake
|
|
35
|
+
CAMERA_STATUS_NOT_SUPPORTED = -4 # This function is not supported
|
|
36
|
+
CAMERA_STATUS_NOT_INITIALIZED = -5 # Unexplicable initialization
|
|
37
|
+
CAMERA_STATUS_PARAMETER_INVALID = -6 # Invalid argument
|
|
38
|
+
CAMERA_STATUS_PARAMETER_OUT_OF_BOUND = -7 # Parameter cross -border
|
|
39
|
+
CAMERA_STATUS_UNENABLED = -8 # Fail to make
|
|
40
|
+
CAMERA_STATUS_USER_CANCEL = -9 # The user is canceled manually, such as the ROI panel click to cancel, and return
|
|
41
|
+
CAMERA_STATUS_PATH_NOT_FOUND = -10 # No corresponding path is found in the registry
|
|
42
|
+
CAMERA_STATUS_SIZE_DISMATCH = -11 # Do not match the size of the image data and definition
|
|
43
|
+
CAMERA_STATUS_TIME_OUT = -12 # Timeout
|
|
44
|
+
CAMERA_STATUS_IO_ERROR = -13 # Hardware IO error
|
|
45
|
+
CAMERA_STATUS_COMM_ERROR = -14 # Communication error
|
|
46
|
+
CAMERA_STATUS_BUS_ERROR = -15 # Bus error
|
|
47
|
+
CAMERA_STATUS_NO_DEVICE_FOUND = -16 # No device
|
|
48
|
+
CAMERA_STATUS_NO_LOGIC_DEVICE_FOUND = -17 # No logic device is found
|
|
49
|
+
CAMERA_STATUS_DEVICE_IS_OPENED = -18 # The equipment has been opened
|
|
50
|
+
CAMERA_STATUS_DEVICE_IS_CLOSED = -19 # The equipment has been closed
|
|
51
|
+
CAMERA_STATUS_DEVICE_VEDIO_CLOSED = -20 # When the device video is not turned on, when the video -related functions call the video, if the camera video is not opened, the error will be returned.
|
|
52
|
+
CAMERA_STATUS_NO_MEMORY = -21 # There is no enough system memory
|
|
53
|
+
CAMERA_STATUS_FILE_CREATE_FAILED = -22 # Failure to create files
|
|
54
|
+
CAMERA_STATUS_FILE_INVALID = -23 # File format is invalid
|
|
55
|
+
CAMERA_STATUS_WRITE_PROTECTED = -24 # Write protection, do not write
|
|
56
|
+
CAMERA_STATUS_GRAB_FAILED = -25 # Data collection failure
|
|
57
|
+
CAMERA_STATUS_LOST_DATA = -26 # Data loss, incomplete
|
|
58
|
+
CAMERA_STATUS_EOF_ERROR = -27 # Not received the frame ending of the frame
|
|
59
|
+
CAMERA_STATUS_BUSY = -28 # He is busy(The last operation was still in progress), This operation cannot be performed
|
|
60
|
+
CAMERA_STATUS_WAIT = -29 # need to wait(The conditions for operation are not established)You can try again
|
|
61
|
+
CAMERA_STATUS_IN_PROCESS = -30 # Standing, have been operated
|
|
62
|
+
CAMERA_STATUS_IIC_ERROR = -31 # IIC transmission error
|
|
63
|
+
CAMERA_STATUS_SPI_ERROR = -32 # SPI transmission error
|
|
64
|
+
CAMERA_STATUS_USB_CONTROL_ERROR = -33 # USB control transmission error
|
|
65
|
+
CAMERA_STATUS_USB_BULK_ERROR = -34 # USB Bulk transmission error
|
|
66
|
+
CAMERA_STATUS_SOCKET_INIT_ERROR = -35 # The initialization of network transmission kit failed
|
|
67
|
+
CAMERA_STATUS_GIGE_FILTER_INIT_ERROR = -36 # The network camera kernel filtering driver was initialized, please check whether the driver was installed correctly, or reinstalled.
|
|
68
|
+
CAMERA_STATUS_NET_SEND_ERROR = -37 # Network data sending error
|
|
69
|
+
CAMERA_STATUS_DEVICE_LOST = -38 # Lost connection with the network camera, the heartbeat detection timeout
|
|
70
|
+
CAMERA_STATUS_DATA_RECV_LESS = -39 # The number of bytes received is less than requests
|
|
71
|
+
CAMERA_STATUS_FUNCTION_LOAD_FAILED = -40 # Loading program from the file failed
|
|
72
|
+
CAMERA_STATUS_CRITICAL_FILE_LOST = -41 # The files necessary for the program are lost.
|
|
73
|
+
CAMERA_STATUS_SENSOR_ID_DISMATCH = -42 # The firmware and programs do not match, because the wrong firmware is downloaded.
|
|
74
|
+
CAMERA_STATUS_OUT_OF_RANGE = -43 # The parameters exceed the effective range.
|
|
75
|
+
CAMERA_STATUS_REGISTRY_ERROR = -44 # Installation program registration error.Please reinstall the program, or run the installation directory setup/Installer.exe
|
|
76
|
+
CAMERA_STATUS_ACCESS_DENY = -45 # No Access.When the designated camera has been occupied by other programs, apply for the camera and return to the state.(A camera cannot be accessed by multiple programs at the same time)
|
|
77
|
+
#AIA's standard compatibility error code
|
|
78
|
+
CAMERA_AIA_PACKET_RESEND = 0x0100 #The frame needs to be re -transmitted
|
|
79
|
+
CAMERA_AIA_NOT_IMPLEMENTED = 0x8001 #Command that does not support the device
|
|
80
|
+
CAMERA_AIA_INVALID_PARAMETER = 0x8002 #Command parameters illegal
|
|
81
|
+
CAMERA_AIA_INVALID_ADDRESS = 0x8003 #Unacceptable address
|
|
82
|
+
CAMERA_AIA_WRITE_PROTECT = 0x8004 #The object of access cannot be written
|
|
83
|
+
CAMERA_AIA_BAD_ALIGNMENT = 0x8005 #The access address is not aligned as required
|
|
84
|
+
CAMERA_AIA_ACCESS_DENIED = 0x8006 #No access authority
|
|
85
|
+
CAMERA_AIA_BUSY = 0x8007 #Command is being processed
|
|
86
|
+
CAMERA_AIA_DEPRECATED = 0x8008 #0x8008-0x0800B 0x800F This instruction has been abandoned
|
|
87
|
+
CAMERA_AIA_PACKET_UNAVAILABLE = 0x800C #Invalid
|
|
88
|
+
CAMERA_AIA_DATA_OVERRUN = 0x800D #Data overflow, usually more data received than required
|
|
89
|
+
CAMERA_AIA_INVALID_HEADER = 0x800E #Some areas in the packet head are not matched with the agreement
|
|
90
|
+
CAMERA_AIA_PACKET_NOT_YET_AVAILABLE = 0x8010 #The image subcontracting data is not prepared, mostly used for trigger mode, application access timeout
|
|
91
|
+
CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY = 0x8011 #The subcontracting that needs to be visited no longer exists.Mostly used when the data is no longer in the buffer area
|
|
92
|
+
CAMERA_AIA_PACKET_REMOVED_FROM_MEMORY = 0x8012 #CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY
|
|
93
|
+
CAMERA_AIA_NO_REF_TIME = 0x0813 #No reference clock source.During the execution of the command of time synchronization
|
|
94
|
+
CAMERA_AIA_PACKET_TEMPORARILY_UNAVAILABLE = 0x0814 #Due to the channel bandwidth problem, the current subcontracting is temporarily unavailable, you need to visit later
|
|
95
|
+
CAMERA_AIA_OVERFLOW = 0x0815 #The data of the device overflows, usually the queue is full
|
|
96
|
+
CAMERA_AIA_ACTION_LATE = 0x0816 #The command execution has exceeded the effective specified time
|
|
97
|
+
CAMERA_AIA_ERROR = 0x8FFF #mistake
|
|
98
|
+
|
|
99
|
+
# Image format definition
|
|
100
|
+
CAMERA_MEDIA_TYPE_MONO = 0x01000000
|
|
101
|
+
CAMERA_MEDIA_TYPE_RGB = 0x02000000
|
|
102
|
+
CAMERA_MEDIA_TYPE_COLOR = 0x02000000
|
|
103
|
+
CAMERA_MEDIA_TYPE_OCCUPY1BIT = 0x00010000
|
|
104
|
+
CAMERA_MEDIA_TYPE_OCCUPY2BIT = 0x00020000
|
|
105
|
+
CAMERA_MEDIA_TYPE_OCCUPY4BIT = 0x00040000
|
|
106
|
+
CAMERA_MEDIA_TYPE_OCCUPY8BIT = 0x00080000
|
|
107
|
+
CAMERA_MEDIA_TYPE_OCCUPY10BIT = 0x000A0000
|
|
108
|
+
CAMERA_MEDIA_TYPE_OCCUPY12BIT = 0x000C0000
|
|
109
|
+
CAMERA_MEDIA_TYPE_OCCUPY16BIT = 0x00100000
|
|
110
|
+
CAMERA_MEDIA_TYPE_OCCUPY24BIT = 0x00180000
|
|
111
|
+
CAMERA_MEDIA_TYPE_OCCUPY32BIT = 0x00200000
|
|
112
|
+
CAMERA_MEDIA_TYPE_OCCUPY36BIT = 0x00240000
|
|
113
|
+
CAMERA_MEDIA_TYPE_OCCUPY48BIT = 0x00300000
|
|
114
|
+
CAMERA_MEDIA_TYPE_EFFECTIVE_PIXEL_SIZE_MASK = 0x00FF0000
|
|
115
|
+
CAMERA_MEDIA_TYPE_EFFECTIVE_PIXEL_SIZE_SHIFT = 16
|
|
116
|
+
CAMERA_MEDIA_TYPE_ID_MASK = 0x0000FFFF
|
|
117
|
+
CAMERA_MEDIA_TYPE_COUNT = 0x46
|
|
118
|
+
|
|
119
|
+
#mono
|
|
120
|
+
CAMERA_MEDIA_TYPE_MONO1P = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY1BIT | 0x0037)
|
|
121
|
+
CAMERA_MEDIA_TYPE_MONO2P = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY2BIT | 0x0038)
|
|
122
|
+
CAMERA_MEDIA_TYPE_MONO4P = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY4BIT | 0x0039)
|
|
123
|
+
CAMERA_MEDIA_TYPE_MONO8 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0001)
|
|
124
|
+
CAMERA_MEDIA_TYPE_MONO8S = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0002)
|
|
125
|
+
CAMERA_MEDIA_TYPE_MONO10 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0003)
|
|
126
|
+
CAMERA_MEDIA_TYPE_MONO10_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0004)
|
|
127
|
+
CAMERA_MEDIA_TYPE_MONO12 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0005)
|
|
128
|
+
CAMERA_MEDIA_TYPE_MONO12_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0006)
|
|
129
|
+
CAMERA_MEDIA_TYPE_MONO14 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0025)
|
|
130
|
+
CAMERA_MEDIA_TYPE_MONO16 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0007)
|
|
131
|
+
|
|
132
|
+
# Bayer
|
|
133
|
+
CAMERA_MEDIA_TYPE_BAYGR8 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0008)
|
|
134
|
+
CAMERA_MEDIA_TYPE_BAYRG8 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0009)
|
|
135
|
+
CAMERA_MEDIA_TYPE_BAYGB8 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x000A)
|
|
136
|
+
CAMERA_MEDIA_TYPE_BAYBG8 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x000B)
|
|
137
|
+
|
|
138
|
+
CAMERA_MEDIA_TYPE_BAYGR10_MIPI = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0026)
|
|
139
|
+
CAMERA_MEDIA_TYPE_BAYRG10_MIPI = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0027)
|
|
140
|
+
CAMERA_MEDIA_TYPE_BAYGB10_MIPI = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0028)
|
|
141
|
+
CAMERA_MEDIA_TYPE_BAYBG10_MIPI = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0029)
|
|
142
|
+
|
|
143
|
+
CAMERA_MEDIA_TYPE_BAYGR10 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000C)
|
|
144
|
+
CAMERA_MEDIA_TYPE_BAYRG10 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000D)
|
|
145
|
+
CAMERA_MEDIA_TYPE_BAYGB10 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000E)
|
|
146
|
+
CAMERA_MEDIA_TYPE_BAYBG10 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000F)
|
|
147
|
+
|
|
148
|
+
CAMERA_MEDIA_TYPE_BAYGR12 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0010)
|
|
149
|
+
CAMERA_MEDIA_TYPE_BAYRG12 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0011)
|
|
150
|
+
CAMERA_MEDIA_TYPE_BAYGB12 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0012)
|
|
151
|
+
CAMERA_MEDIA_TYPE_BAYBG12 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0013)
|
|
152
|
+
|
|
153
|
+
CAMERA_MEDIA_TYPE_BAYGR10_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0026)
|
|
154
|
+
CAMERA_MEDIA_TYPE_BAYRG10_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0027)
|
|
155
|
+
CAMERA_MEDIA_TYPE_BAYGB10_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0028)
|
|
156
|
+
CAMERA_MEDIA_TYPE_BAYBG10_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0029)
|
|
157
|
+
|
|
158
|
+
CAMERA_MEDIA_TYPE_BAYGR12_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002A)
|
|
159
|
+
CAMERA_MEDIA_TYPE_BAYRG12_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002B)
|
|
160
|
+
CAMERA_MEDIA_TYPE_BAYGB12_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002C)
|
|
161
|
+
CAMERA_MEDIA_TYPE_BAYBG12_PACKED = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002D)
|
|
162
|
+
|
|
163
|
+
CAMERA_MEDIA_TYPE_BAYGR16 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x002E)
|
|
164
|
+
CAMERA_MEDIA_TYPE_BAYRG16 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x002F)
|
|
165
|
+
CAMERA_MEDIA_TYPE_BAYGB16 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0030)
|
|
166
|
+
CAMERA_MEDIA_TYPE_BAYBG16 = (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0031)
|
|
167
|
+
|
|
168
|
+
# RGB
|
|
169
|
+
CAMERA_MEDIA_TYPE_RGB8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0014)
|
|
170
|
+
CAMERA_MEDIA_TYPE_BGR8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0015)
|
|
171
|
+
CAMERA_MEDIA_TYPE_RGBA8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x0016)
|
|
172
|
+
CAMERA_MEDIA_TYPE_BGRA8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x0017)
|
|
173
|
+
CAMERA_MEDIA_TYPE_RGB10 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0018)
|
|
174
|
+
CAMERA_MEDIA_TYPE_BGR10 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0019)
|
|
175
|
+
CAMERA_MEDIA_TYPE_RGB12 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x001A)
|
|
176
|
+
CAMERA_MEDIA_TYPE_BGR12 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x001B)
|
|
177
|
+
CAMERA_MEDIA_TYPE_RGB16 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0033)
|
|
178
|
+
CAMERA_MEDIA_TYPE_RGB10V1_PACKED = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x001C)
|
|
179
|
+
CAMERA_MEDIA_TYPE_RGB10P32 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x001D)
|
|
180
|
+
CAMERA_MEDIA_TYPE_RGB12V1_PACKED = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY36BIT | 0X0034)
|
|
181
|
+
CAMERA_MEDIA_TYPE_RGB565P = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0035)
|
|
182
|
+
CAMERA_MEDIA_TYPE_BGR565P = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0X0036)
|
|
183
|
+
|
|
184
|
+
# YUV and YCbCr
|
|
185
|
+
CAMERA_MEDIA_TYPE_YUV411_8_UYYVYY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x001E)
|
|
186
|
+
CAMERA_MEDIA_TYPE_YUV422_8_UYVY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x001F)
|
|
187
|
+
CAMERA_MEDIA_TYPE_YUV422_8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0032)
|
|
188
|
+
CAMERA_MEDIA_TYPE_YUV8_UYV = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0020)
|
|
189
|
+
CAMERA_MEDIA_TYPE_YCBCR8_CBYCR = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x003A)
|
|
190
|
+
#CAMERA_MEDIA_TYPE_YCBCR422_8 : YYYYCbCrCbCr
|
|
191
|
+
CAMERA_MEDIA_TYPE_YCBCR422_8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x003B)
|
|
192
|
+
CAMERA_MEDIA_TYPE_YCBCR422_8_CBYCRY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0043)
|
|
193
|
+
CAMERA_MEDIA_TYPE_YCBCR411_8_CBYYCRYY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x003C)
|
|
194
|
+
CAMERA_MEDIA_TYPE_YCBCR601_8_CBYCR = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x003D)
|
|
195
|
+
CAMERA_MEDIA_TYPE_YCBCR601_422_8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x003E)
|
|
196
|
+
CAMERA_MEDIA_TYPE_YCBCR601_422_8_CBYCRY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0044)
|
|
197
|
+
CAMERA_MEDIA_TYPE_YCBCR601_411_8_CBYYCRYY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x003F)
|
|
198
|
+
CAMERA_MEDIA_TYPE_YCBCR709_8_CBYCR = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0040)
|
|
199
|
+
CAMERA_MEDIA_TYPE_YCBCR709_422_8 = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0041)
|
|
200
|
+
CAMERA_MEDIA_TYPE_YCBCR709_422_8_CBYCRY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0045)
|
|
201
|
+
CAMERA_MEDIA_TYPE_YCBCR709_411_8_CBYYCRYY = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0042)
|
|
202
|
+
|
|
203
|
+
# RGB Planar
|
|
204
|
+
CAMERA_MEDIA_TYPE_RGB8_PLANAR = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0021)
|
|
205
|
+
CAMERA_MEDIA_TYPE_RGB10_PLANAR = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0022)
|
|
206
|
+
CAMERA_MEDIA_TYPE_RGB12_PLANAR = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0023)
|
|
207
|
+
CAMERA_MEDIA_TYPE_RGB16_PLANAR = (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0024)
|
|
208
|
+
|
|
209
|
+
# Preservation format
|
|
210
|
+
FILE_JPG = 1
|
|
211
|
+
FILE_BMP = 2
|
|
212
|
+
FILE_RAW = 4
|
|
213
|
+
FILE_PNG = 8
|
|
214
|
+
FILE_BMP_8BIT = 16
|
|
215
|
+
FILE_PNG_8BIT = 32
|
|
216
|
+
FILE_RAW_16BIT = 64
|
|
217
|
+
|
|
218
|
+
# Trigger signal
|
|
219
|
+
EXT_TRIG_LEADING_EDGE = 0
|
|
220
|
+
EXT_TRIG_TRAILING_EDGE = 1
|
|
221
|
+
EXT_TRIG_HIGH_LEVEL = 2
|
|
222
|
+
EXT_TRIG_LOW_LEVEL = 3
|
|
223
|
+
EXT_TRIG_DOUBLE_EDGE = 4
|
|
224
|
+
|
|
225
|
+
# IO mode
|
|
226
|
+
IOMODE_TRIG_INPUT = 0
|
|
227
|
+
IOMODE_STROBE_OUTPUT = 1
|
|
228
|
+
IOMODE_GP_INPUT = 2
|
|
229
|
+
IOMODE_GP_OUTPUT = 3
|
|
230
|
+
IOMODE_PWM_OUTPUT = 4
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
# Camera operation abnormal information
|
|
234
|
+
class CameraException(Exception):
|
|
235
|
+
"""docstring for CameraException"""
|
|
236
|
+
def __init__(self, error_code):
|
|
237
|
+
super(CameraException, self).__init__()
|
|
238
|
+
self.error_code = error_code
|
|
239
|
+
self.message = CameraGetErrorString(error_code)
|
|
240
|
+
|
|
241
|
+
def __str__(self):
|
|
242
|
+
return 'error_code:{} message:{}'.format(self.error_code, self.message)
|
|
243
|
+
|
|
244
|
+
class MvStructure(Structure):
|
|
245
|
+
def __str__(self):
|
|
246
|
+
strs = []
|
|
247
|
+
for field in self._fields_:
|
|
248
|
+
name = field[0]
|
|
249
|
+
value = getattr(self, name)
|
|
250
|
+
if isinstance(value, type(b'')):
|
|
251
|
+
value = _string_buffer_to_str(value)
|
|
252
|
+
strs.append("{}:{}".format(name, value))
|
|
253
|
+
return '\n'.join(strs)
|
|
254
|
+
|
|
255
|
+
def __repr__(self):
|
|
256
|
+
return self.__str__()
|
|
257
|
+
|
|
258
|
+
def clone(self):
|
|
259
|
+
obj = type(self)()
|
|
260
|
+
memmove(byref(obj), byref(self), sizeof(self))
|
|
261
|
+
return obj
|
|
262
|
+
|
|
263
|
+
# The equipment information of the camera, read only the information, please do not modify
|
|
264
|
+
class tSdkCameraDevInfo(MvStructure):
|
|
265
|
+
_fields_ = [("acProductSeries", c_char * 32), #Product Series
|
|
266
|
+
("acProductName", c_char * 32), #product name
|
|
267
|
+
("acFriendlyName", c_char * 32), #Product nickname
|
|
268
|
+
("acLinkName", c_char * 32), #The kernel symbol connection name, internal use
|
|
269
|
+
("acDriverVersion", c_char * 32), #Drive version
|
|
270
|
+
("acSensorType", c_char * 32), #Sensor type
|
|
271
|
+
("acPortType", c_char * 32), #Interface Type
|
|
272
|
+
("acSn", c_char * 32), #Product unique sequence number
|
|
273
|
+
("uInstance", c_uint)] #This model camera's instance index number on the computer is used to distinguish the same model multi -camera
|
|
274
|
+
|
|
275
|
+
def GetProductSeries(self):
|
|
276
|
+
return _string_buffer_to_str(self.acProductSeries)
|
|
277
|
+
def GetProductName(self):
|
|
278
|
+
return _string_buffer_to_str(self.acProductName)
|
|
279
|
+
def GetFriendlyName(self):
|
|
280
|
+
return _string_buffer_to_str(self.acFriendlyName)
|
|
281
|
+
def GetLinkName(self):
|
|
282
|
+
return _string_buffer_to_str(self.acLinkName)
|
|
283
|
+
def GetDriverVersion(self):
|
|
284
|
+
return _string_buffer_to_str(self.acDriverVersion)
|
|
285
|
+
def GetSensorType(self):
|
|
286
|
+
return _string_buffer_to_str(self.acSensorType)
|
|
287
|
+
def GetPortType(self):
|
|
288
|
+
return _string_buffer_to_str(self.acPortType)
|
|
289
|
+
def GetSn(self):
|
|
290
|
+
return _string_buffer_to_str(self.acSn)
|
|
291
|
+
|
|
292
|
+
# Camera resolution setting range
|
|
293
|
+
class tSdkResolutionRange(MvStructure):
|
|
294
|
+
_fields_ = [("iHeightMax", c_int), #Grand height of the image
|
|
295
|
+
("iHeightMin", c_int), #The minimum image
|
|
296
|
+
("iWidthMax", c_int), #Maximum image
|
|
297
|
+
("iWidthMin", c_int), #Minimum image
|
|
298
|
+
("uSkipModeMask", c_uint), #SKIP mode mask, 0, indicates that SKIP does not support SKIP Essencebit0 is 1,Indicates supporting SKIP 2x2 Bit1 is 1, which means supporting SKIP 3x3....
|
|
299
|
+
("uBinSumModeMask", c_uint), #BIN(Context)Model mask, 0, indicates that BIN does not support BIN Essencebit0 is 1,Indicates supporting bin 2x2 bit1 as 1, indicating supporting BIN 3x3....
|
|
300
|
+
("uBinAverageModeMask", c_uint),#BIN(Sequential value)Model mask, 0, indicates that BIN does not support BIN Essencebit0 is 1,Indicates support Bin 2x2 Bit1 is 1, which means supporting Bin 3x3....
|
|
301
|
+
("uResampleMask", c_uint)] #Hard with hardware sampling
|
|
302
|
+
|
|
303
|
+
#Camera resolution description
|
|
304
|
+
class tSdkImageResolution(MvStructure):
|
|
305
|
+
_fields_ = [
|
|
306
|
+
("iIndex", c_int), # The index number,[0,N]Indicates the preset resolution(N The maximum number of preset resolution, generally does not exceed 20),OXFF Indicates custom resolution(ROI)
|
|
307
|
+
("acDescription", c_char * 32), # Description information of this resolution.The information is effective when the resolution is preset.Custom resolution can ignore this information
|
|
308
|
+
("uBinSumMode", c_uint), # BIN(Context)Mode,Do not exceed Ubinsummodemask in TSDKResolutionRange
|
|
309
|
+
("uBinAverageMode", c_uint), # BIN(Sequential value)Mode,Do not exceed the UbinaverageModeMask in TSDKResolutionwork
|
|
310
|
+
("uSkipMode", c_uint), # Whether the size of the SKIP is 0 indicating that the SKIP mode is prohibited, and the range cannot exceed the USKIPMODEMASK in TSDKResolutionRage
|
|
311
|
+
("uResampleMask", c_uint), # Hard with hardware sampling
|
|
312
|
+
("iHOffsetFOV", c_int), # Relative to the vertical offset from the upper left corner of Sensor's maximum viewing field
|
|
313
|
+
("iVOffsetFOV", c_int), # Relative to the horizontal offset of the maximum view of Sensor's maximum viewing field
|
|
314
|
+
("iWidthFOV", c_int), # Collect the width of the field of view
|
|
315
|
+
("iHeightFOV", c_int), # Collect the height of the field of view
|
|
316
|
+
("iWidth", c_int), # The width of the image of the camera's final output
|
|
317
|
+
("iHeight", c_int), # The height of the image of the final output of the camera
|
|
318
|
+
("iWidthZoomHd", c_int), # Hardware scaling width,No need to perform the resolution of this operation. This variable is set to 0.
|
|
319
|
+
("iHeightZoomHd", c_int), # Highness of hardware scaling,No need to perform the resolution of this operation. This variable is set to 0.
|
|
320
|
+
("iWidthZoomSw", c_int), # Software scaling width,No need to perform the resolution of this operation. This variable is set to 0.
|
|
321
|
+
("iHeightZoomSw", c_int), # Software scaling height,No need to perform the resolution of this operation. This variable is set to 0.
|
|
322
|
+
]
|
|
323
|
+
|
|
324
|
+
def GetDescription(self):
|
|
325
|
+
return _string_buffer_to_str(self.acDescription)
|
|
326
|
+
|
|
327
|
+
#Camera white balance mode description information
|
|
328
|
+
class tSdkColorTemperatureDes(MvStructure):
|
|
329
|
+
_fields_ = [
|
|
330
|
+
("iIndex", c_int), # Model Index Number
|
|
331
|
+
("acDescription", c_char * 32), # Description
|
|
332
|
+
]
|
|
333
|
+
|
|
334
|
+
def GetDescription(self):
|
|
335
|
+
return _string_buffer_to_str(self.acDescription)
|
|
336
|
+
|
|
337
|
+
#Camera frame rate description information
|
|
338
|
+
class tSdkFrameSpeed(MvStructure):
|
|
339
|
+
_fields_ = [
|
|
340
|
+
("iIndex", c_int), # Frame rate index sessions generally correspond to low -speed mode, 1 corresponds to normal mode, 2 corresponds to high -speed mode
|
|
341
|
+
("acDescription", c_char * 32), # Description
|
|
342
|
+
]
|
|
343
|
+
|
|
344
|
+
def GetDescription(self):
|
|
345
|
+
return _string_buffer_to_str(self.acDescription)
|
|
346
|
+
|
|
347
|
+
#Camera exposure function definition
|
|
348
|
+
class tSdkExpose(MvStructure):
|
|
349
|
+
_fields_ = [
|
|
350
|
+
("uiTargetMin", c_uint), #Automatic exposure brightness target minimum value
|
|
351
|
+
("uiTargetMax", c_uint), #Automatic exposure of brightness target maximum value
|
|
352
|
+
("uiAnalogGainMin", c_uint), #The minimum value of analog gain is defined in FANALOGAINSTEP
|
|
353
|
+
("uiAnalogGainMax", c_uint), #The maximum value of analog gain is defined in FANALOGAINSTEP
|
|
354
|
+
("fAnalogGainStep", c_float), #Each analog gain increases by 1, the corresponding increase of magnification.For example, Uiaanaloggainmin is generally 16, and FANALOGAINSTEP is generally 0.125, then the minimum amplification multiple is 16*0.125 = 2 times
|
|
355
|
+
("uiExposeTimeMin", c_uint), #In manual mode, the minimum value of the exposure time, unit:OK.You can get a line of corresponding time based(Microstatic),So as to get the exposure time of the entire frame
|
|
356
|
+
("uiExposeTimeMax", c_uint), #In manual mode, the maximum value of the exposure time, unit:OK
|
|
357
|
+
]
|
|
358
|
+
|
|
359
|
+
#Trigger mode description
|
|
360
|
+
class tSdkTrigger(MvStructure):
|
|
361
|
+
_fields_ = [
|
|
362
|
+
("iIndex", c_int), # Model Index Number
|
|
363
|
+
("acDescription", c_char * 32), # Description
|
|
364
|
+
]
|
|
365
|
+
|
|
366
|
+
def GetDescription(self):
|
|
367
|
+
return _string_buffer_to_str(self.acDescription)
|
|
368
|
+
|
|
369
|
+
#Transfer subcontracting description(It is mainly for the effective network camera)
|
|
370
|
+
class tSdkPackLength(MvStructure):
|
|
371
|
+
_fields_ = [
|
|
372
|
+
("iIndex", c_int), # Model Index Number
|
|
373
|
+
("acDescription", c_char * 32), # Description
|
|
374
|
+
("iPackSize", c_uint),
|
|
375
|
+
]
|
|
376
|
+
|
|
377
|
+
def GetDescription(self):
|
|
378
|
+
return _string_buffer_to_str(self.acDescription)
|
|
379
|
+
|
|
380
|
+
#Preset LUT table description
|
|
381
|
+
class tSdkPresetLut(MvStructure):
|
|
382
|
+
_fields_ = [
|
|
383
|
+
("iIndex", c_int), # serial number
|
|
384
|
+
("acDescription", c_char * 32), # Description
|
|
385
|
+
]
|
|
386
|
+
|
|
387
|
+
def GetDescription(self):
|
|
388
|
+
return _string_buffer_to_str(self.acDescription)
|
|
389
|
+
|
|
390
|
+
#AE algorithm description
|
|
391
|
+
class tSdkAeAlgorithm(MvStructure):
|
|
392
|
+
_fields_ = [
|
|
393
|
+
("iIndex", c_int), # serial number
|
|
394
|
+
("acDescription", c_char * 32), # Description
|
|
395
|
+
]
|
|
396
|
+
|
|
397
|
+
def GetDescription(self):
|
|
398
|
+
return _string_buffer_to_str(self.acDescription)
|
|
399
|
+
|
|
400
|
+
#RAW to RGB algorithm description
|
|
401
|
+
class tSdkBayerDecodeAlgorithm(MvStructure):
|
|
402
|
+
_fields_ = [
|
|
403
|
+
("iIndex", c_int), # serial number
|
|
404
|
+
("acDescription", c_char * 32), # Description
|
|
405
|
+
]
|
|
406
|
+
|
|
407
|
+
def GetDescription(self):
|
|
408
|
+
return _string_buffer_to_str(self.acDescription)
|
|
409
|
+
|
|
410
|
+
#Frame rate statistics information
|
|
411
|
+
class tSdkFrameStatistic(MvStructure):
|
|
412
|
+
_fields_ = [
|
|
413
|
+
("iTotal", c_int), #The currently collected total frame number (including error frames)
|
|
414
|
+
("iCapture", c_int), #The number of effective frames currently collected
|
|
415
|
+
("iLost", c_int), #The current number of frame loss
|
|
416
|
+
]
|
|
417
|
+
|
|
418
|
+
#Image data format of camera output
|
|
419
|
+
class tSdkMediaType(MvStructure):
|
|
420
|
+
_fields_ = [
|
|
421
|
+
("iIndex", c_int), # Format type number
|
|
422
|
+
("acDescription", c_char * 32), # Description
|
|
423
|
+
("iMediaType", c_uint), # The corresponding image format encoding, such as Camera_Media_type_baygr8.
|
|
424
|
+
]
|
|
425
|
+
|
|
426
|
+
def GetDescription(self):
|
|
427
|
+
return _string_buffer_to_str(self.acDescription)
|
|
428
|
+
|
|
429
|
+
#Gamma's setting range
|
|
430
|
+
class tGammaRange(MvStructure):
|
|
431
|
+
_fields_ = [
|
|
432
|
+
("iMin", c_int), #Minimum
|
|
433
|
+
("iMax", c_int), #Maximum
|
|
434
|
+
]
|
|
435
|
+
|
|
436
|
+
#The setting range of contrast
|
|
437
|
+
class tContrastRange(MvStructure):
|
|
438
|
+
_fields_ = [
|
|
439
|
+
("iMin", c_int), #Minimum
|
|
440
|
+
("iMax", c_int), #Maximum
|
|
441
|
+
]
|
|
442
|
+
|
|
443
|
+
#RGB three -channel digital gain setting range
|
|
444
|
+
class tRgbGainRange(MvStructure):
|
|
445
|
+
_fields_ = [
|
|
446
|
+
("iRGainMin", c_int), #The minimum value of red gain
|
|
447
|
+
("iRGainMax", c_int), #The maximum value of red gain
|
|
448
|
+
("iGGainMin", c_int), #The minimum value of green gain
|
|
449
|
+
("iGGainMax", c_int), #The maximum value of green gain
|
|
450
|
+
("iBGainMin", c_int), #The minimum value of blue gain
|
|
451
|
+
("iBGainMax", c_int), #The maximum value of blue gain
|
|
452
|
+
]
|
|
453
|
+
|
|
454
|
+
#The range of saturation settings
|
|
455
|
+
class tSaturationRange(MvStructure):
|
|
456
|
+
_fields_ = [
|
|
457
|
+
("iMin", c_int), #Minimum
|
|
458
|
+
("iMax", c_int), #Maximum
|
|
459
|
+
]
|
|
460
|
+
|
|
461
|
+
#Specific setting range
|
|
462
|
+
class tSharpnessRange(MvStructure):
|
|
463
|
+
_fields_ = [
|
|
464
|
+
("iMin", c_int), #Minimum
|
|
465
|
+
("iMax", c_int), #Maximum
|
|
466
|
+
]
|
|
467
|
+
|
|
468
|
+
#The enable information of the ISP module
|
|
469
|
+
class tSdkIspCapacity(MvStructure):
|
|
470
|
+
_fields_ = [
|
|
471
|
+
("bMonoSensor", c_int), #Indicates whether the camera is a black and white camera,If it is a black and white camera, the color -related function cannot be adjusted
|
|
472
|
+
("bWbOnce", c_int), #Indicates whether the camera supports the manual white balance function
|
|
473
|
+
("bAutoWb", c_int), #Indicates whether the camera supports the automatic white balance function
|
|
474
|
+
("bAutoExposure", c_int), #It means whether the camera supports the automatic exposure function
|
|
475
|
+
("bManualExposure", c_int), #Indicates whether the camera supports the manual exposure function
|
|
476
|
+
("bAntiFlick", c_int), #Indicates whether the camera supports the anti -frequency flash function
|
|
477
|
+
("bDeviceIsp", c_int), #Indicates whether the camera supports the hardware ISP function
|
|
478
|
+
("bForceUseDeviceIsp", c_int), #When BDEVICEISP and BFORCEUSEDEVICEISP are True, it means that forced to use hardware ISP and not be canceled.
|
|
479
|
+
("bZoomHD", c_int), #Whether the camera hardware supports image zoom output(It can only be reduced)。
|
|
480
|
+
]
|
|
481
|
+
|
|
482
|
+
# Define the integrated device description information, this information can be used to dynamically build UI
|
|
483
|
+
class tSdkCameraCapbility(MvStructure):
|
|
484
|
+
_fields_ = [
|
|
485
|
+
("pTriggerDesc", POINTER(tSdkTrigger)),
|
|
486
|
+
("iTriggerDesc", c_int), #The number of triggers, that is, the size of the PtriggerDesc array
|
|
487
|
+
("pImageSizeDesc", POINTER(tSdkImageResolution)),
|
|
488
|
+
("iImageSizeDesc", c_int), #The number of preset resolution, that is, the size of the PIMAGESIZEDESC array
|
|
489
|
+
("pClrTempDesc", POINTER(tSdkColorTemperatureDes)),
|
|
490
|
+
("iClrTempDesc", c_int), #Preset color temperature
|
|
491
|
+
("pMediaTypeDesc", POINTER(tSdkMediaType)),
|
|
492
|
+
("iMediaTypeDesc", c_int), #The number of types of the camera output image format, the size of the PMediaTypeSc array.
|
|
493
|
+
("pFrameSpeedDesc", POINTER(tSdkFrameSpeed)), #Adjustable frame speed type, corresponding to the corresponding interface high speed And super three speed settings
|
|
494
|
+
("iFrameSpeedDesc", c_int), #The number of frame speed types, the size of the PFRESPEEDESC array.
|
|
495
|
+
("pPackLenDesc", POINTER(tSdkPackLength)), #The length of the transmission package is generally used in network equipment
|
|
496
|
+
("iPackLenDesc", c_int), #The number of transmitted subcontracting lengths available, that is, the size of the PPACKLENDESC array.
|
|
497
|
+
("iOutputIoCounts", c_int), #The number of programming output IO
|
|
498
|
+
("iInputIoCounts", c_int), #The number of IOs that can be programmed in input
|
|
499
|
+
("pPresetLutDesc", POINTER(tSdkPresetLut)), #Lut watch preset camera
|
|
500
|
+
("iPresetLut", c_int), #The number of Lut table presets of the camera, that is, the size of the PPRESETLUTDESC array
|
|
501
|
+
("iUserDataMaxLen", c_int), #Instructed the camera to save the maximum length of the user data area.For 0, there is no.
|
|
502
|
+
("bParamInDevice", c_int), #Instructed whether the device supports reading and writing parameter groups from the device.1 is support, 0 does not support.
|
|
503
|
+
("pAeAlmSwDesc", POINTER(tSdkAeAlgorithm)),#Software automatic exposure algorithm description
|
|
504
|
+
("iAeAlmSwDesc", c_int), #Software automatic exposure algorithm number
|
|
505
|
+
("pAeAlmHdDesc", POINTER(tSdkAeAlgorithm)),#Hardware automatic exposure algorithm description, for NULL to indicate that it does not support automatic hardware exposure
|
|
506
|
+
("iAeAlmHdDesc", c_int), #The number of hardware automatic exposure algorithms, for 0 indicates that it does not support automatic hardware exposure
|
|
507
|
+
("pBayerDecAlmSwDesc", POINTER(tSdkBayerDecodeAlgorithm)),#Software Bayer convert to RGB data algorithm description
|
|
508
|
+
("iBayerDecAlmSwDesc", c_int), #Software bayer converts to the number of algorithms of RGB data
|
|
509
|
+
("pBayerDecAlmHdDesc", POINTER(tSdkBayerDecodeAlgorithm)),#The algorithm description of the hardware Bayer converts to RGB data, which means that NULL does not support
|
|
510
|
+
("iBayerDecAlmHdDesc", c_int), #The number of algorithms of hardware bayer convert to RGB data, which does not support 0 for 0
|
|
511
|
+
|
|
512
|
+
# Definition of adjustment range of image parameters,Used to dynamically build UI
|
|
513
|
+
("sExposeDesc", tSdkExpose), #The scope value of exposure
|
|
514
|
+
("sResolutionRange", tSdkResolutionRange), #Resolution range description
|
|
515
|
+
("sRgbGainRange", tRgbGainRange), #Description of image digital gain range
|
|
516
|
+
("sSaturationRange", tSaturationRange), #Saturation range description
|
|
517
|
+
("sGammaRange", tGammaRange), #Gamma range description
|
|
518
|
+
("sContrastRange", tContrastRange), #Comparison range description
|
|
519
|
+
("sSharpnessRange", tSharpnessRange), #Specification range description
|
|
520
|
+
("sIspCapacity", tSdkIspCapacity), #ISP ability description
|
|
521
|
+
]
|
|
522
|
+
|
|
523
|
+
#Image frame head information
|
|
524
|
+
class tSdkFrameHead(MvStructure):
|
|
525
|
+
_fields_ = [
|
|
526
|
+
("uiMediaType", c_uint), # Image format,Image Format
|
|
527
|
+
("uBytes", c_uint), # Image data byte number,Total bytes
|
|
528
|
+
("iWidth", c_int), # width Image height
|
|
529
|
+
("iHeight", c_int), # high Image width
|
|
530
|
+
("iWidthZoomSw", c_int), # Software scaling width,There is no need for software cutting. This variable is set to 0.
|
|
531
|
+
("iHeightZoomSw", c_int), # Software scaling height,There is no need for software cutting. This variable is set to 0.
|
|
532
|
+
("bIsTrigger", c_int), # Indicate whether it is a trigger frame is trigger
|
|
533
|
+
("uiTimeStamp", c_uint), # The collection time of this frame, unit 0.1 millisecond
|
|
534
|
+
("uiExpTime", c_uint), # The exposure value of the current image, the unit is microsecond US
|
|
535
|
+
("fAnalogGain", c_float), # The simulation gain multiple of the current image
|
|
536
|
+
("iGamma", c_int), # The Gamma setting value of this frame image is effective when the LUT mode is generated when the dynamic parameters are generated.-1
|
|
537
|
+
("iContrast", c_int), # The comparison setting value of this frame image is effective when the LUT mode is generated when the dynamic parameters are generated.-1
|
|
538
|
+
("iSaturation", c_int), # The saturation setting of this frame image is not meaningful for black and white cameras. It is 0
|
|
539
|
+
("fRgain", c_float), # The red digital gain multiples of this frame image processing are meaningless for black and white cameras. It is 1
|
|
540
|
+
("fGgain", c_float), # The green digital gain multiple of this frame image processing is meaningless for black and white cameras. It is 1
|
|
541
|
+
("fBgain", c_float), # The blue digital gain multiples of this frame image processing are meaningless for black and white cameras. It is 1
|
|
542
|
+
]
|
|
543
|
+
|
|
544
|
+
# Grabber statistics information
|
|
545
|
+
class tSdkGrabberStat(MvStructure):
|
|
546
|
+
_fields_ = [
|
|
547
|
+
("Width", c_int), # Frame image size
|
|
548
|
+
("Height", c_int), # Frame image size
|
|
549
|
+
("Disp", c_int), # Display quantity
|
|
550
|
+
("Capture", c_int), # The number of effective frames collected
|
|
551
|
+
("Lost", c_int), # The number of frame loss
|
|
552
|
+
("Error", c_int), # Number of wrong frames
|
|
553
|
+
("DispFps", c_float), # Display frame rate
|
|
554
|
+
("CapFps", c_float), # Capture frame rate
|
|
555
|
+
]
|
|
556
|
+
|
|
557
|
+
# Method back -callback auxiliary category
|
|
558
|
+
class method(object):
|
|
559
|
+
def __init__(self, FuncType):
|
|
560
|
+
super(method, self).__init__()
|
|
561
|
+
self.FuncType = FuncType
|
|
562
|
+
self.cache = {}
|
|
563
|
+
|
|
564
|
+
def __call__(self, cb):
|
|
565
|
+
self.cb = cb
|
|
566
|
+
return self
|
|
567
|
+
|
|
568
|
+
def __get__(self, obj, objtype):
|
|
569
|
+
try:
|
|
570
|
+
return self.cache[obj]
|
|
571
|
+
except KeyError as e:
|
|
572
|
+
def cl(*args):
|
|
573
|
+
return self.cb(obj, *args)
|
|
574
|
+
r = self.cache[obj] = self.FuncType(cl)
|
|
575
|
+
return r
|
|
576
|
+
|
|
577
|
+
# The definition of the callback function of image capture
|
|
578
|
+
CAMERA_SNAP_PROC = CALLBACK_FUNC_TYPE(None, c_int, c_void_p, POINTER(tSdkFrameHead), c_void_p)
|
|
579
|
+
|
|
580
|
+
# Camera connection status callback
|
|
581
|
+
CAMERA_CONNECTION_STATUS_CALLBACK = CALLBACK_FUNC_TYPE(None, c_int, c_uint, c_uint, c_void_p)
|
|
582
|
+
|
|
583
|
+
# Asynchronous grasping pictures complete the callback
|
|
584
|
+
pfnCameraGrabberSaveImageComplete = CALLBACK_FUNC_TYPE(None, c_void_p, c_void_p, c_int, c_void_p)
|
|
585
|
+
|
|
586
|
+
# Frame Supervisor
|
|
587
|
+
pfnCameraGrabberFrameListener = CALLBACK_FUNC_TYPE(c_int, c_void_p, c_int, c_void_p, POINTER(tSdkFrameHead), c_void_p)
|
|
588
|
+
|
|
589
|
+
# The recovery of the collector image capture
|
|
590
|
+
pfnCameraGrabberFrameCallback = CALLBACK_FUNC_TYPE(None, c_void_p, c_void_p, POINTER(tSdkFrameHead), c_void_p)
|
|
591
|
+
|
|
592
|
+
#-----------------------------------Function interface------------------------------------------
|
|
593
|
+
|
|
594
|
+
# Local storage of thread
|
|
595
|
+
_tls = local()
|
|
596
|
+
|
|
597
|
+
# Store the error code returned to the last SDK call
|
|
598
|
+
def GetLastError():
|
|
599
|
+
try:
|
|
600
|
+
return _tls.last_error
|
|
601
|
+
except AttributeError as e:
|
|
602
|
+
_tls.last_error = 0
|
|
603
|
+
return 0
|
|
604
|
+
|
|
605
|
+
def SetLastError(err_code):
|
|
606
|
+
_tls.last_error = err_code
|
|
607
|
+
|
|
608
|
+
def _string_buffer_to_str(buf):
|
|
609
|
+
s = buf if isinstance(buf, type(b'')) else buf.value
|
|
610
|
+
|
|
611
|
+
for codec in ('gbk', 'utf-8'):
|
|
612
|
+
try:
|
|
613
|
+
s = s.decode(codec)
|
|
614
|
+
break
|
|
615
|
+
except UnicodeDecodeError as e:
|
|
616
|
+
continue
|
|
617
|
+
|
|
618
|
+
if isinstance(s, str):
|
|
619
|
+
return s
|
|
620
|
+
else:
|
|
621
|
+
return s.encode('utf-8')
|
|
622
|
+
|
|
623
|
+
def _str_to_string_buffer(str):
|
|
624
|
+
if type(str) is type(u''):
|
|
625
|
+
s = str.encode('gbk')
|
|
626
|
+
else:
|
|
627
|
+
s = str.decode('utf-8').encode('gbk')
|
|
628
|
+
return create_string_buffer(s)
|
|
629
|
+
|
|
630
|
+
def CameraSdkInit(iLanguageSel):
|
|
631
|
+
err_code = _sdk.CameraSdkInit(iLanguageSel)
|
|
632
|
+
SetLastError(err_code)
|
|
633
|
+
return err_code
|
|
634
|
+
|
|
635
|
+
def CameraSetSysOption(optionName, value):
|
|
636
|
+
err_code = _sdk.CameraSetSysOption(_str_to_string_buffer(optionName), _str_to_string_buffer(str(value)))
|
|
637
|
+
SetLastError(err_code)
|
|
638
|
+
return err_code
|
|
639
|
+
|
|
640
|
+
def CameraEnumerateDevice(MaxCount = 32):
|
|
641
|
+
Nums = c_int(MaxCount)
|
|
642
|
+
pCameraList = (tSdkCameraDevInfo * Nums.value)()
|
|
643
|
+
err_code = _sdk.CameraEnumerateDevice(pCameraList, byref(Nums))
|
|
644
|
+
SetLastError(err_code)
|
|
645
|
+
return pCameraList[0:Nums.value]
|
|
646
|
+
|
|
647
|
+
def CameraEnumerateDeviceEx():
|
|
648
|
+
return _sdk.CameraEnumerateDeviceEx()
|
|
649
|
+
|
|
650
|
+
def CameraIsOpened(pCameraInfo):
|
|
651
|
+
pOpened = c_int()
|
|
652
|
+
err_code = _sdk.CameraIsOpened(byref(pCameraInfo), byref(pOpened) )
|
|
653
|
+
SetLastError(err_code)
|
|
654
|
+
return pOpened.value != 0
|
|
655
|
+
|
|
656
|
+
def CameraInit(pCameraInfo, emParamLoadMode = -1, emTeam = -1):
|
|
657
|
+
pCameraHandle = c_int()
|
|
658
|
+
err_code = _sdk.CameraInit(byref(pCameraInfo), emParamLoadMode, emTeam, byref(pCameraHandle))
|
|
659
|
+
SetLastError(err_code)
|
|
660
|
+
if err_code != 0:
|
|
661
|
+
raise CameraException(err_code)
|
|
662
|
+
return pCameraHandle.value
|
|
663
|
+
|
|
664
|
+
def CameraInitEx(iDeviceIndex, emParamLoadMode = -1, emTeam = -1):
|
|
665
|
+
pCameraHandle = c_int()
|
|
666
|
+
err_code = _sdk.CameraInitEx(iDeviceIndex, emParamLoadMode, emTeam, byref(pCameraHandle))
|
|
667
|
+
SetLastError(err_code)
|
|
668
|
+
if err_code != 0:
|
|
669
|
+
raise CameraException(err_code)
|
|
670
|
+
return pCameraHandle.value
|
|
671
|
+
|
|
672
|
+
def CameraInitEx2(CameraName):
|
|
673
|
+
pCameraHandle = c_int()
|
|
674
|
+
err_code = _sdk.CameraInitEx2(_str_to_string_buffer(CameraName), byref(pCameraHandle))
|
|
675
|
+
SetLastError(err_code)
|
|
676
|
+
if err_code != 0:
|
|
677
|
+
raise CameraException(err_code)
|
|
678
|
+
return pCameraHandle.value
|
|
679
|
+
|
|
680
|
+
def CameraSetCallbackFunction(hCamera, pCallBack, pContext = 0):
|
|
681
|
+
err_code = _sdk.CameraSetCallbackFunction(hCamera, pCallBack, c_void_p(pContext), None)
|
|
682
|
+
SetLastError(err_code)
|
|
683
|
+
return err_code
|
|
684
|
+
|
|
685
|
+
def CameraUnInit(hCamera):
|
|
686
|
+
err_code = _sdk.CameraUnInit(hCamera)
|
|
687
|
+
SetLastError(err_code)
|
|
688
|
+
return err_code
|
|
689
|
+
|
|
690
|
+
def CameraGetInformation(hCamera):
|
|
691
|
+
pbuffer = c_char_p()
|
|
692
|
+
err_code = _sdk.CameraGetInformation(hCamera, byref(pbuffer) )
|
|
693
|
+
SetLastError(err_code)
|
|
694
|
+
if err_code == 0 and pbuffer.value is not None:
|
|
695
|
+
return _string_buffer_to_str(pbuffer)
|
|
696
|
+
return ''
|
|
697
|
+
|
|
698
|
+
def CameraImageProcess(hCamera, pbyIn, pbyOut, pFrInfo):
|
|
699
|
+
err_code = _sdk.CameraImageProcess(hCamera, c_void_p(pbyIn), c_void_p(pbyOut), byref(pFrInfo))
|
|
700
|
+
SetLastError(err_code)
|
|
701
|
+
return err_code
|
|
702
|
+
|
|
703
|
+
def CameraImageProcessEx(hCamera, pbyIn, pbyOut, pFrInfo, uOutFormat, uReserved):
|
|
704
|
+
err_code = _sdk.CameraImageProcessEx(hCamera, c_void_p(pbyIn), c_void_p(pbyOut), byref(pFrInfo), uOutFormat, uReserved)
|
|
705
|
+
SetLastError(err_code)
|
|
706
|
+
return err_code
|
|
707
|
+
|
|
708
|
+
def CameraDisplayInit(hCamera, hWndDisplay):
|
|
709
|
+
err_code = _sdk.CameraDisplayInit(hCamera, hWndDisplay)
|
|
710
|
+
SetLastError(err_code)
|
|
711
|
+
return err_code
|
|
712
|
+
|
|
713
|
+
def CameraDisplayRGB24(hCamera, pFrameBuffer, pFrInfo):
|
|
714
|
+
err_code = _sdk.CameraDisplayRGB24(hCamera, c_void_p(pFrameBuffer), byref(pFrInfo) )
|
|
715
|
+
SetLastError(err_code)
|
|
716
|
+
return err_code
|
|
717
|
+
|
|
718
|
+
def CameraSetDisplayMode(hCamera, iMode):
|
|
719
|
+
err_code = _sdk.CameraSetDisplayMode(hCamera, iMode)
|
|
720
|
+
SetLastError(err_code)
|
|
721
|
+
return err_code
|
|
722
|
+
|
|
723
|
+
def CameraSetDisplayOffset(hCamera, iOffsetX, iOffsetY):
|
|
724
|
+
err_code = _sdk.CameraSetDisplayOffset(hCamera, iOffsetX, iOffsetY)
|
|
725
|
+
SetLastError(err_code)
|
|
726
|
+
return err_code
|
|
727
|
+
|
|
728
|
+
def CameraSetDisplaySize(hCamera, iWidth, iHeight):
|
|
729
|
+
err_code = _sdk.CameraSetDisplaySize(hCamera, iWidth, iHeight)
|
|
730
|
+
SetLastError(err_code)
|
|
731
|
+
return err_code
|
|
732
|
+
|
|
733
|
+
def CameraGetImageBuffer(hCamera, wTimes):
|
|
734
|
+
pbyBuffer = c_void_p()
|
|
735
|
+
pFrameInfo = tSdkFrameHead()
|
|
736
|
+
err_code = _sdk.CameraGetImageBuffer(hCamera, byref(pFrameInfo), byref(pbyBuffer), wTimes)
|
|
737
|
+
SetLastError(err_code)
|
|
738
|
+
if err_code != 0:
|
|
739
|
+
raise CameraException(err_code)
|
|
740
|
+
return (pbyBuffer.value, pFrameInfo)
|
|
741
|
+
|
|
742
|
+
def CameraGetImageBufferEx(hCamera, wTimes):
|
|
743
|
+
_sdk.CameraGetImageBufferEx.restype = c_void_p
|
|
744
|
+
piWidth = c_int()
|
|
745
|
+
piHeight = c_int()
|
|
746
|
+
pFrameBuffer = _sdk.CameraGetImageBufferEx(hCamera, byref(piWidth), byref(piHeight), wTimes)
|
|
747
|
+
err_code = CAMERA_STATUS_SUCCESS if pFrameBuffer else CAMERA_STATUS_TIME_OUT
|
|
748
|
+
SetLastError(err_code)
|
|
749
|
+
if pFrameBuffer:
|
|
750
|
+
return (pFrameBuffer, piWidth.value, piHeight.value)
|
|
751
|
+
else:
|
|
752
|
+
raise CameraException(err_code)
|
|
753
|
+
|
|
754
|
+
def CameraSnapToBuffer(hCamera, wTimes):
|
|
755
|
+
pbyBuffer = c_void_p()
|
|
756
|
+
pFrameInfo = tSdkFrameHead()
|
|
757
|
+
err_code = _sdk.CameraSnapToBuffer(hCamera, byref(pFrameInfo), byref(pbyBuffer), wTimes)
|
|
758
|
+
SetLastError(err_code)
|
|
759
|
+
if err_code != 0:
|
|
760
|
+
raise CameraException(err_code)
|
|
761
|
+
return (pbyBuffer.value, pFrameInfo)
|
|
762
|
+
|
|
763
|
+
def CameraReleaseImageBuffer(hCamera, pbyBuffer):
|
|
764
|
+
err_code = _sdk.CameraReleaseImageBuffer(hCamera, c_void_p(pbyBuffer) )
|
|
765
|
+
SetLastError(err_code)
|
|
766
|
+
return err_code
|
|
767
|
+
|
|
768
|
+
def CameraPlay(hCamera):
|
|
769
|
+
err_code = _sdk.CameraPlay(hCamera)
|
|
770
|
+
SetLastError(err_code)
|
|
771
|
+
return err_code
|
|
772
|
+
|
|
773
|
+
def CameraPause(hCamera):
|
|
774
|
+
err_code = _sdk.CameraPause(hCamera)
|
|
775
|
+
SetLastError(err_code)
|
|
776
|
+
return err_code
|
|
777
|
+
|
|
778
|
+
def CameraStop(hCamera):
|
|
779
|
+
err_code = _sdk.CameraStop(hCamera)
|
|
780
|
+
SetLastError(err_code)
|
|
781
|
+
return err_code
|
|
782
|
+
|
|
783
|
+
def CameraInitRecord(hCamera, iFormat, pcSavePath, b2GLimit, dwQuality, iFrameRate):
|
|
784
|
+
err_code = _sdk.CameraInitRecord(hCamera, iFormat, _str_to_string_buffer(pcSavePath), b2GLimit, dwQuality, iFrameRate)
|
|
785
|
+
SetLastError(err_code)
|
|
786
|
+
return err_code
|
|
787
|
+
|
|
788
|
+
def CameraStopRecord(hCamera):
|
|
789
|
+
err_code = _sdk.CameraStopRecord(hCamera)
|
|
790
|
+
SetLastError(err_code)
|
|
791
|
+
return err_code
|
|
792
|
+
|
|
793
|
+
def CameraPushFrame(hCamera, pbyImageBuffer, pFrInfo):
|
|
794
|
+
err_code = _sdk.CameraPushFrame(hCamera, c_void_p(pbyImageBuffer), byref(pFrInfo) )
|
|
795
|
+
SetLastError(err_code)
|
|
796
|
+
return err_code
|
|
797
|
+
|
|
798
|
+
def CameraSaveImage(hCamera, lpszFileName, pbyImageBuffer, pFrInfo, byFileType, byQuality):
|
|
799
|
+
err_code = _sdk.CameraSaveImage(hCamera, _str_to_string_buffer(lpszFileName), c_void_p(pbyImageBuffer), byref(pFrInfo), byFileType, byQuality)
|
|
800
|
+
SetLastError(err_code)
|
|
801
|
+
return err_code
|
|
802
|
+
|
|
803
|
+
def CameraSaveImageEx(hCamera, lpszFileName, pbyImageBuffer, uImageFormat, iWidth, iHeight, byFileType, byQuality):
|
|
804
|
+
err_code = _sdk.CameraSaveImageEx(hCamera, _str_to_string_buffer(lpszFileName), c_void_p(pbyImageBuffer), uImageFormat, iWidth, iHeight, byFileType, byQuality)
|
|
805
|
+
SetLastError(err_code)
|
|
806
|
+
return err_code
|
|
807
|
+
|
|
808
|
+
def CameraGetImageResolution(hCamera):
|
|
809
|
+
psCurVideoSize = tSdkImageResolution()
|
|
810
|
+
err_code = _sdk.CameraGetImageResolution(hCamera, byref(psCurVideoSize) )
|
|
811
|
+
SetLastError(err_code)
|
|
812
|
+
return psCurVideoSize
|
|
813
|
+
|
|
814
|
+
def CameraSetImageResolution(hCamera, pImageResolution):
|
|
815
|
+
err_code = _sdk.CameraSetImageResolution(hCamera, byref(pImageResolution) )
|
|
816
|
+
SetLastError(err_code)
|
|
817
|
+
return err_code
|
|
818
|
+
|
|
819
|
+
def CameraSetImageResolutionEx(hCamera, iIndex, Mode, ModeSize, x, y, width, height, ZoomWidth, ZoomHeight):
|
|
820
|
+
err_code = _sdk.CameraSetImageResolutionEx(hCamera, iIndex, Mode, ModeSize, x, y, width, height, ZoomWidth, ZoomHeight)
|
|
821
|
+
SetLastError(err_code)
|
|
822
|
+
return err_code
|
|
823
|
+
|
|
824
|
+
def CameraGetMediaType(hCamera):
|
|
825
|
+
piMediaType = c_int()
|
|
826
|
+
err_code = _sdk.CameraGetMediaType(hCamera, byref(piMediaType) )
|
|
827
|
+
SetLastError(err_code)
|
|
828
|
+
return piMediaType.value
|
|
829
|
+
|
|
830
|
+
def CameraSetMediaType(hCamera, iMediaType):
|
|
831
|
+
err_code = _sdk.CameraSetMediaType(hCamera, iMediaType)
|
|
832
|
+
SetLastError(err_code)
|
|
833
|
+
return err_code
|
|
834
|
+
|
|
835
|
+
def CameraSetAeState(hCamera, bAeState):
|
|
836
|
+
err_code = _sdk.CameraSetAeState(hCamera, bAeState)
|
|
837
|
+
SetLastError(err_code)
|
|
838
|
+
return err_code
|
|
839
|
+
|
|
840
|
+
def CameraGetAeState(hCamera):
|
|
841
|
+
pAeState = c_int()
|
|
842
|
+
err_code = _sdk.CameraGetAeState(hCamera, byref(pAeState) )
|
|
843
|
+
SetLastError(err_code)
|
|
844
|
+
return pAeState.value
|
|
845
|
+
|
|
846
|
+
def CameraSetSharpness(hCamera, iSharpness):
|
|
847
|
+
err_code = _sdk.CameraSetSharpness(hCamera, iSharpness)
|
|
848
|
+
SetLastError(err_code)
|
|
849
|
+
return err_code
|
|
850
|
+
|
|
851
|
+
def CameraGetSharpness(hCamera):
|
|
852
|
+
piSharpness = c_int()
|
|
853
|
+
err_code = _sdk.CameraGetSharpness(hCamera, byref(piSharpness) )
|
|
854
|
+
SetLastError(err_code)
|
|
855
|
+
return piSharpness.value
|
|
856
|
+
|
|
857
|
+
def CameraSetLutMode(hCamera, emLutMode):
|
|
858
|
+
err_code = _sdk.CameraSetLutMode(hCamera, emLutMode)
|
|
859
|
+
SetLastError(err_code)
|
|
860
|
+
return err_code
|
|
861
|
+
|
|
862
|
+
def CameraGetLutMode(hCamera):
|
|
863
|
+
pemLutMode = c_int()
|
|
864
|
+
err_code = _sdk.CameraGetLutMode(hCamera, byref(pemLutMode) )
|
|
865
|
+
SetLastError(err_code)
|
|
866
|
+
return pemLutMode.value
|
|
867
|
+
|
|
868
|
+
def CameraSelectLutPreset(hCamera, iSel):
|
|
869
|
+
err_code = _sdk.CameraSelectLutPreset(hCamera, iSel)
|
|
870
|
+
SetLastError(err_code)
|
|
871
|
+
return err_code
|
|
872
|
+
|
|
873
|
+
def CameraGetLutPresetSel(hCamera):
|
|
874
|
+
piSel = c_int()
|
|
875
|
+
err_code = _sdk.CameraGetLutPresetSel(hCamera, byref(piSel) )
|
|
876
|
+
SetLastError(err_code)
|
|
877
|
+
return piSel.value
|
|
878
|
+
|
|
879
|
+
def CameraSetCustomLut(hCamera, iChannel, pLut):
|
|
880
|
+
pLutNative = (c_ushort * 4096)(*pLut)
|
|
881
|
+
err_code = _sdk.CameraSetCustomLut(hCamera, iChannel, pLutNative)
|
|
882
|
+
SetLastError(err_code)
|
|
883
|
+
return err_code
|
|
884
|
+
|
|
885
|
+
def CameraGetCustomLut(hCamera, iChannel):
|
|
886
|
+
pLutNative = (c_ushort * 4096)()
|
|
887
|
+
err_code = _sdk.CameraGetCustomLut(hCamera, iChannel, pLutNative)
|
|
888
|
+
SetLastError(err_code)
|
|
889
|
+
return pLutNative[:]
|
|
890
|
+
|
|
891
|
+
def CameraGetCurrentLut(hCamera, iChannel):
|
|
892
|
+
pLutNative = (c_ushort * 4096)()
|
|
893
|
+
err_code = _sdk.CameraGetCurrentLut(hCamera, iChannel, pLutNative)
|
|
894
|
+
SetLastError(err_code)
|
|
895
|
+
return pLutNative[:]
|
|
896
|
+
|
|
897
|
+
def CameraSetWbMode(hCamera, bAuto):
|
|
898
|
+
err_code = _sdk.CameraSetWbMode(hCamera, bAuto)
|
|
899
|
+
SetLastError(err_code)
|
|
900
|
+
return err_code
|
|
901
|
+
|
|
902
|
+
def CameraGetWbMode(hCamera):
|
|
903
|
+
pbAuto = c_int()
|
|
904
|
+
err_code = _sdk.CameraGetWbMode(hCamera, byref(pbAuto) )
|
|
905
|
+
SetLastError(err_code)
|
|
906
|
+
return pbAuto.value
|
|
907
|
+
|
|
908
|
+
def CameraSetPresetClrTemp(hCamera, iSel):
|
|
909
|
+
err_code = _sdk.CameraSetPresetClrTemp(hCamera, iSel)
|
|
910
|
+
SetLastError(err_code)
|
|
911
|
+
return err_code
|
|
912
|
+
|
|
913
|
+
def CameraGetPresetClrTemp(hCamera):
|
|
914
|
+
piSel = c_int()
|
|
915
|
+
err_code = _sdk.CameraGetPresetClrTemp(hCamera, byref(piSel) )
|
|
916
|
+
SetLastError(err_code)
|
|
917
|
+
return piSel.value
|
|
918
|
+
|
|
919
|
+
def CameraSetUserClrTempGain(hCamera, iRgain, iGgain, iBgain):
|
|
920
|
+
err_code = _sdk.CameraSetUserClrTempGain(hCamera, iRgain, iGgain, iBgain)
|
|
921
|
+
SetLastError(err_code)
|
|
922
|
+
return err_code
|
|
923
|
+
|
|
924
|
+
def CameraGetUserClrTempGain(hCamera):
|
|
925
|
+
piRgain = c_int()
|
|
926
|
+
piGgain = c_int()
|
|
927
|
+
piBgain = c_int()
|
|
928
|
+
err_code = _sdk.CameraGetUserClrTempGain(hCamera, byref(piRgain), byref(piGgain), byref(piBgain) )
|
|
929
|
+
SetLastError(err_code)
|
|
930
|
+
return (piRgain.value, piGgain.value, piBgain.value)
|
|
931
|
+
|
|
932
|
+
def CameraSetUserClrTempMatrix(hCamera, pMatrix):
|
|
933
|
+
pMatrixNative = (c_float * 9)(*pMatrix)
|
|
934
|
+
err_code = _sdk.CameraSetUserClrTempMatrix(hCamera, pMatrixNative)
|
|
935
|
+
SetLastError(err_code)
|
|
936
|
+
return err_code
|
|
937
|
+
|
|
938
|
+
def CameraGetUserClrTempMatrix(hCamera):
|
|
939
|
+
pMatrixNative = (c_float * 9)()
|
|
940
|
+
err_code = _sdk.CameraGetUserClrTempMatrix(hCamera, pMatrixNative)
|
|
941
|
+
SetLastError(err_code)
|
|
942
|
+
return pMatrixNative[:]
|
|
943
|
+
|
|
944
|
+
def CameraSetClrTempMode(hCamera, iMode):
|
|
945
|
+
err_code = _sdk.CameraSetClrTempMode(hCamera, iMode)
|
|
946
|
+
SetLastError(err_code)
|
|
947
|
+
return err_code
|
|
948
|
+
|
|
949
|
+
def CameraGetClrTempMode(hCamera):
|
|
950
|
+
piMode = c_int()
|
|
951
|
+
err_code = _sdk.CameraGetClrTempMode(hCamera, byref(piMode) )
|
|
952
|
+
SetLastError(err_code)
|
|
953
|
+
return piMode.value
|
|
954
|
+
|
|
955
|
+
def CameraSetOnceWB(hCamera):
|
|
956
|
+
err_code = _sdk.CameraSetOnceWB(hCamera)
|
|
957
|
+
SetLastError(err_code)
|
|
958
|
+
return err_code
|
|
959
|
+
|
|
960
|
+
def CameraSetOnceBB(hCamera):
|
|
961
|
+
err_code = _sdk.CameraSetOnceBB(hCamera)
|
|
962
|
+
SetLastError(err_code)
|
|
963
|
+
return err_code
|
|
964
|
+
|
|
965
|
+
def CameraSetAeTarget(hCamera, iAeTarget):
|
|
966
|
+
err_code = _sdk.CameraSetAeTarget(hCamera, iAeTarget)
|
|
967
|
+
SetLastError(err_code)
|
|
968
|
+
return err_code
|
|
969
|
+
|
|
970
|
+
def CameraGetAeTarget(hCamera):
|
|
971
|
+
piAeTarget = c_int()
|
|
972
|
+
err_code = _sdk.CameraGetAeTarget(hCamera, byref(piAeTarget) )
|
|
973
|
+
SetLastError(err_code)
|
|
974
|
+
return piAeTarget.value
|
|
975
|
+
|
|
976
|
+
def CameraSetAeExposureRange(hCamera, fMinExposureTime, fMaxExposureTime):
|
|
977
|
+
err_code = _sdk.CameraSetAeExposureRange(hCamera, c_double(fMinExposureTime), c_double(fMaxExposureTime) )
|
|
978
|
+
SetLastError(err_code)
|
|
979
|
+
return err_code
|
|
980
|
+
|
|
981
|
+
def CameraGetAeExposureRange(hCamera):
|
|
982
|
+
fMinExposureTime = c_double()
|
|
983
|
+
fMaxExposureTime = c_double()
|
|
984
|
+
err_code = _sdk.CameraGetAeExposureRange(hCamera, byref(fMinExposureTime), byref(fMaxExposureTime) )
|
|
985
|
+
SetLastError(err_code)
|
|
986
|
+
return (fMinExposureTime.value, fMaxExposureTime.value)
|
|
987
|
+
|
|
988
|
+
def CameraSetAeAnalogGainRange(hCamera, iMinAnalogGain, iMaxAnalogGain):
|
|
989
|
+
err_code = _sdk.CameraSetAeAnalogGainRange(hCamera, iMinAnalogGain, iMaxAnalogGain)
|
|
990
|
+
SetLastError(err_code)
|
|
991
|
+
return err_code
|
|
992
|
+
|
|
993
|
+
def CameraGetAeAnalogGainRange(hCamera):
|
|
994
|
+
iMinAnalogGain = c_int()
|
|
995
|
+
iMaxAnalogGain = c_int()
|
|
996
|
+
err_code = _sdk.CameraGetAeAnalogGainRange(hCamera, byref(iMinAnalogGain), byref(iMaxAnalogGain) )
|
|
997
|
+
SetLastError(err_code)
|
|
998
|
+
return (iMinAnalogGain.value, iMaxAnalogGain.value)
|
|
999
|
+
|
|
1000
|
+
def CameraSetAeThreshold(hCamera, iThreshold):
|
|
1001
|
+
err_code = _sdk.CameraSetAeThreshold(hCamera, iThreshold)
|
|
1002
|
+
SetLastError(err_code)
|
|
1003
|
+
return err_code
|
|
1004
|
+
|
|
1005
|
+
def CameraGetAeThreshold(hCamera):
|
|
1006
|
+
iThreshold = c_int()
|
|
1007
|
+
err_code = _sdk.CameraGetAeThreshold(hCamera, byref(iThreshold))
|
|
1008
|
+
SetLastError(err_code)
|
|
1009
|
+
return iThreshold.value
|
|
1010
|
+
|
|
1011
|
+
def CameraSetExposureTime(hCamera, fExposureTime):
|
|
1012
|
+
err_code = _sdk.CameraSetExposureTime(hCamera, c_double(fExposureTime) )
|
|
1013
|
+
SetLastError(err_code)
|
|
1014
|
+
return err_code
|
|
1015
|
+
|
|
1016
|
+
def CameraGetExposureLineTime(hCamera):
|
|
1017
|
+
pfLineTime = c_double()
|
|
1018
|
+
err_code = _sdk.CameraGetExposureLineTime(hCamera, byref(pfLineTime))
|
|
1019
|
+
SetLastError(err_code)
|
|
1020
|
+
return pfLineTime.value
|
|
1021
|
+
|
|
1022
|
+
def CameraGetExposureTime(hCamera):
|
|
1023
|
+
pfExposureTime = c_double()
|
|
1024
|
+
err_code = _sdk.CameraGetExposureTime(hCamera, byref(pfExposureTime))
|
|
1025
|
+
SetLastError(err_code)
|
|
1026
|
+
return pfExposureTime.value
|
|
1027
|
+
|
|
1028
|
+
def CameraGetExposureTimeRange(hCamera):
|
|
1029
|
+
pfMin = c_double()
|
|
1030
|
+
pfMax = c_double()
|
|
1031
|
+
pfStep = c_double()
|
|
1032
|
+
err_code = _sdk.CameraGetExposureTimeRange(hCamera, byref(pfMin), byref(pfMax), byref(pfStep))
|
|
1033
|
+
SetLastError(err_code)
|
|
1034
|
+
return (pfMin.value, pfMax.value, pfStep.value)
|
|
1035
|
+
|
|
1036
|
+
def CameraSetAnalogGain(hCamera, iAnalogGain):
|
|
1037
|
+
err_code = _sdk.CameraSetAnalogGain(hCamera, iAnalogGain)
|
|
1038
|
+
SetLastError(err_code)
|
|
1039
|
+
return err_code
|
|
1040
|
+
|
|
1041
|
+
def CameraGetAnalogGain(hCamera):
|
|
1042
|
+
piAnalogGain = c_int()
|
|
1043
|
+
err_code = _sdk.CameraGetAnalogGain(hCamera, byref(piAnalogGain))
|
|
1044
|
+
SetLastError(err_code)
|
|
1045
|
+
return piAnalogGain.value
|
|
1046
|
+
|
|
1047
|
+
def CameraSetAnalogGainX(hCamera, fGain):
|
|
1048
|
+
err_code = _sdk.CameraSetAnalogGainX(hCamera, c_float(fGain) )
|
|
1049
|
+
SetLastError(err_code)
|
|
1050
|
+
return err_code
|
|
1051
|
+
|
|
1052
|
+
def CameraGetAnalogGainX(hCamera):
|
|
1053
|
+
fGain = c_float()
|
|
1054
|
+
err_code = _sdk.CameraGetAnalogGainX(hCamera, byref(fGain))
|
|
1055
|
+
SetLastError(err_code)
|
|
1056
|
+
return fGain.value
|
|
1057
|
+
|
|
1058
|
+
def CameraGetAnalogGainXRange(hCamera):
|
|
1059
|
+
pfMin = c_float()
|
|
1060
|
+
pfMax = c_float()
|
|
1061
|
+
pfStep = c_float()
|
|
1062
|
+
err_code = _sdk.CameraGetAnalogGainXRange(hCamera, byref(pfMin), byref(pfMax), byref(pfStep))
|
|
1063
|
+
SetLastError(err_code)
|
|
1064
|
+
return (pfMin.value, pfMax.value, pfStep.value)
|
|
1065
|
+
|
|
1066
|
+
def CameraSetGain(hCamera, iRGain, iGGain, iBGain):
|
|
1067
|
+
err_code = _sdk.CameraSetGain(hCamera, iRGain, iGGain, iBGain)
|
|
1068
|
+
SetLastError(err_code)
|
|
1069
|
+
return err_code
|
|
1070
|
+
|
|
1071
|
+
def CameraGetGain(hCamera):
|
|
1072
|
+
piRGain = c_int()
|
|
1073
|
+
piGGain = c_int()
|
|
1074
|
+
piBGain = c_int()
|
|
1075
|
+
err_code = _sdk.CameraGetGain(hCamera, byref(piRGain), byref(piGGain), byref(piBGain))
|
|
1076
|
+
SetLastError(err_code)
|
|
1077
|
+
return (piRGain.value, piGGain.value, piBGain.value)
|
|
1078
|
+
|
|
1079
|
+
def CameraSetGamma(hCamera, iGamma):
|
|
1080
|
+
err_code = _sdk.CameraSetGamma(hCamera, iGamma)
|
|
1081
|
+
SetLastError(err_code)
|
|
1082
|
+
return err_code
|
|
1083
|
+
|
|
1084
|
+
def CameraGetGamma(hCamera):
|
|
1085
|
+
piGamma = c_int()
|
|
1086
|
+
err_code = _sdk.CameraGetGamma(hCamera, byref(piGamma))
|
|
1087
|
+
SetLastError(err_code)
|
|
1088
|
+
return piGamma.value
|
|
1089
|
+
|
|
1090
|
+
def CameraSetContrast(hCamera, iContrast):
|
|
1091
|
+
err_code = _sdk.CameraSetContrast(hCamera, iContrast)
|
|
1092
|
+
SetLastError(err_code)
|
|
1093
|
+
return err_code
|
|
1094
|
+
|
|
1095
|
+
def CameraGetContrast(hCamera):
|
|
1096
|
+
piContrast = c_int()
|
|
1097
|
+
err_code = _sdk.CameraGetContrast(hCamera, byref(piContrast))
|
|
1098
|
+
SetLastError(err_code)
|
|
1099
|
+
return piContrast.value
|
|
1100
|
+
|
|
1101
|
+
def CameraSetSaturation(hCamera, iSaturation):
|
|
1102
|
+
err_code = _sdk.CameraSetSaturation(hCamera, iSaturation)
|
|
1103
|
+
SetLastError(err_code)
|
|
1104
|
+
return err_code
|
|
1105
|
+
|
|
1106
|
+
def CameraGetSaturation(hCamera):
|
|
1107
|
+
piSaturation = c_int()
|
|
1108
|
+
err_code = _sdk.CameraGetSaturation(hCamera, byref(piSaturation))
|
|
1109
|
+
SetLastError(err_code)
|
|
1110
|
+
return piSaturation.value
|
|
1111
|
+
|
|
1112
|
+
def CameraSetMonochrome(hCamera, bEnable):
|
|
1113
|
+
err_code = _sdk.CameraSetMonochrome(hCamera, bEnable)
|
|
1114
|
+
SetLastError(err_code)
|
|
1115
|
+
return err_code
|
|
1116
|
+
|
|
1117
|
+
def CameraGetMonochrome(hCamera):
|
|
1118
|
+
pbEnable = c_int()
|
|
1119
|
+
err_code = _sdk.CameraGetMonochrome(hCamera, byref(pbEnable))
|
|
1120
|
+
SetLastError(err_code)
|
|
1121
|
+
return pbEnable.value
|
|
1122
|
+
|
|
1123
|
+
def CameraSetInverse(hCamera, bEnable):
|
|
1124
|
+
err_code = _sdk.CameraSetInverse(hCamera, bEnable)
|
|
1125
|
+
SetLastError(err_code)
|
|
1126
|
+
return err_code
|
|
1127
|
+
|
|
1128
|
+
def CameraGetInverse(hCamera):
|
|
1129
|
+
pbEnable = c_int()
|
|
1130
|
+
err_code = _sdk.CameraGetInverse(hCamera, byref(pbEnable))
|
|
1131
|
+
SetLastError(err_code)
|
|
1132
|
+
return pbEnable.value
|
|
1133
|
+
|
|
1134
|
+
def CameraSetAntiFlick(hCamera, bEnable):
|
|
1135
|
+
err_code = _sdk.CameraSetAntiFlick(hCamera, bEnable)
|
|
1136
|
+
SetLastError(err_code)
|
|
1137
|
+
return err_code
|
|
1138
|
+
|
|
1139
|
+
def CameraGetAntiFlick(hCamera):
|
|
1140
|
+
pbEnable = c_int()
|
|
1141
|
+
err_code = _sdk.CameraGetAntiFlick(hCamera, byref(pbEnable))
|
|
1142
|
+
SetLastError(err_code)
|
|
1143
|
+
return pbEnable.value
|
|
1144
|
+
|
|
1145
|
+
def CameraGetLightFrequency(hCamera):
|
|
1146
|
+
piFrequencySel = c_int()
|
|
1147
|
+
err_code = _sdk.CameraGetLightFrequency(hCamera, byref(piFrequencySel))
|
|
1148
|
+
SetLastError(err_code)
|
|
1149
|
+
return piFrequencySel.value
|
|
1150
|
+
|
|
1151
|
+
def CameraSetLightFrequency(hCamera, iFrequencySel):
|
|
1152
|
+
err_code = _sdk.CameraSetLightFrequency(hCamera, iFrequencySel)
|
|
1153
|
+
SetLastError(err_code)
|
|
1154
|
+
return err_code
|
|
1155
|
+
|
|
1156
|
+
def CameraSetFrameSpeed(hCamera, iFrameSpeed):
|
|
1157
|
+
err_code = _sdk.CameraSetFrameSpeed(hCamera, iFrameSpeed)
|
|
1158
|
+
SetLastError(err_code)
|
|
1159
|
+
return err_code
|
|
1160
|
+
|
|
1161
|
+
def CameraGetFrameSpeed(hCamera):
|
|
1162
|
+
piFrameSpeed = c_int()
|
|
1163
|
+
err_code = _sdk.CameraGetFrameSpeed(hCamera, byref(piFrameSpeed))
|
|
1164
|
+
SetLastError(err_code)
|
|
1165
|
+
return piFrameSpeed.value
|
|
1166
|
+
|
|
1167
|
+
def CameraSetParameterMode(hCamera, iMode):
|
|
1168
|
+
err_code = _sdk.CameraSetParameterMode(hCamera, iMode)
|
|
1169
|
+
SetLastError(err_code)
|
|
1170
|
+
return err_code
|
|
1171
|
+
|
|
1172
|
+
def CameraGetParameterMode(hCamera):
|
|
1173
|
+
piTarget = c_int()
|
|
1174
|
+
err_code = _sdk.CameraGetParameterMode(hCamera, byref(piTarget))
|
|
1175
|
+
SetLastError(err_code)
|
|
1176
|
+
return piTarget.value
|
|
1177
|
+
|
|
1178
|
+
def CameraSetParameterMask(hCamera, uMask):
|
|
1179
|
+
err_code = _sdk.CameraSetParameterMask(hCamera, uMask)
|
|
1180
|
+
SetLastError(err_code)
|
|
1181
|
+
return err_code
|
|
1182
|
+
|
|
1183
|
+
def CameraSaveParameter(hCamera, iTeam):
|
|
1184
|
+
err_code = _sdk.CameraSaveParameter(hCamera, iTeam)
|
|
1185
|
+
SetLastError(err_code)
|
|
1186
|
+
return err_code
|
|
1187
|
+
|
|
1188
|
+
def CameraSaveParameterToFile(hCamera, sFileName):
|
|
1189
|
+
err_code = _sdk.CameraSaveParameterToFile(hCamera, _str_to_string_buffer(sFileName))
|
|
1190
|
+
SetLastError(err_code)
|
|
1191
|
+
return err_code
|
|
1192
|
+
|
|
1193
|
+
def CameraReadParameterFromFile(hCamera, sFileName):
|
|
1194
|
+
err_code = _sdk.CameraReadParameterFromFile(hCamera, _str_to_string_buffer(sFileName))
|
|
1195
|
+
SetLastError(err_code)
|
|
1196
|
+
return err_code
|
|
1197
|
+
|
|
1198
|
+
def CameraLoadParameter(hCamera, iTeam):
|
|
1199
|
+
err_code = _sdk.CameraLoadParameter(hCamera, iTeam)
|
|
1200
|
+
SetLastError(err_code)
|
|
1201
|
+
return err_code
|
|
1202
|
+
|
|
1203
|
+
def CameraGetCurrentParameterGroup(hCamera):
|
|
1204
|
+
piTeam = c_int()
|
|
1205
|
+
err_code = _sdk.CameraGetCurrentParameterGroup(hCamera, byref(piTeam))
|
|
1206
|
+
SetLastError(err_code)
|
|
1207
|
+
return piTeam.value
|
|
1208
|
+
|
|
1209
|
+
def CameraSetTransPackLen(hCamera, iPackSel):
|
|
1210
|
+
err_code = _sdk.CameraSetTransPackLen(hCamera, iPackSel)
|
|
1211
|
+
SetLastError(err_code)
|
|
1212
|
+
return err_code
|
|
1213
|
+
|
|
1214
|
+
def CameraGetTransPackLen(hCamera):
|
|
1215
|
+
piPackSel = c_int()
|
|
1216
|
+
err_code = _sdk.CameraGetTransPackLen(hCamera, byref(piPackSel))
|
|
1217
|
+
SetLastError(err_code)
|
|
1218
|
+
return piPackSel.value
|
|
1219
|
+
|
|
1220
|
+
def CameraIsAeWinVisible(hCamera):
|
|
1221
|
+
pbIsVisible = c_int()
|
|
1222
|
+
err_code = _sdk.CameraIsAeWinVisible(hCamera, byref(pbIsVisible))
|
|
1223
|
+
SetLastError(err_code)
|
|
1224
|
+
return pbIsVisible.value
|
|
1225
|
+
|
|
1226
|
+
def CameraSetAeWinVisible(hCamera, bIsVisible):
|
|
1227
|
+
err_code = _sdk.CameraSetAeWinVisible(hCamera, bIsVisible)
|
|
1228
|
+
SetLastError(err_code)
|
|
1229
|
+
return err_code
|
|
1230
|
+
|
|
1231
|
+
def CameraGetAeWindow(hCamera):
|
|
1232
|
+
piHOff = c_int()
|
|
1233
|
+
piVOff = c_int()
|
|
1234
|
+
piWidth = c_int()
|
|
1235
|
+
piHeight = c_int()
|
|
1236
|
+
err_code = _sdk.CameraGetAeWindow(hCamera, byref(piHOff), byref(piVOff), byref(piWidth), byref(piHeight))
|
|
1237
|
+
SetLastError(err_code)
|
|
1238
|
+
return (piHOff.value, piVOff.value, piWidth.value, piHeight.value)
|
|
1239
|
+
|
|
1240
|
+
def CameraSetAeWindow(hCamera, iHOff, iVOff, iWidth, iHeight):
|
|
1241
|
+
err_code = _sdk.CameraSetAeWindow(hCamera, iHOff, iVOff, iWidth, iHeight)
|
|
1242
|
+
SetLastError(err_code)
|
|
1243
|
+
return err_code
|
|
1244
|
+
|
|
1245
|
+
def CameraSetMirror(hCamera, iDir, bEnable):
|
|
1246
|
+
err_code = _sdk.CameraSetMirror(hCamera, iDir, bEnable)
|
|
1247
|
+
SetLastError(err_code)
|
|
1248
|
+
return err_code
|
|
1249
|
+
|
|
1250
|
+
def CameraGetMirror(hCamera, iDir):
|
|
1251
|
+
pbEnable = c_int()
|
|
1252
|
+
err_code = _sdk.CameraGetMirror(hCamera, iDir, byref(pbEnable))
|
|
1253
|
+
SetLastError(err_code)
|
|
1254
|
+
return pbEnable.value
|
|
1255
|
+
|
|
1256
|
+
def CameraSetRotate(hCamera, iRot):
|
|
1257
|
+
err_code = _sdk.CameraSetRotate(hCamera, iRot)
|
|
1258
|
+
SetLastError(err_code)
|
|
1259
|
+
return err_code
|
|
1260
|
+
|
|
1261
|
+
def CameraGetRotate(hCamera):
|
|
1262
|
+
iRot = c_int()
|
|
1263
|
+
err_code = _sdk.CameraGetRotate(hCamera, byref(iRot))
|
|
1264
|
+
SetLastError(err_code)
|
|
1265
|
+
return iRot.value
|
|
1266
|
+
|
|
1267
|
+
def CameraGetWbWindow(hCamera):
|
|
1268
|
+
PiHOff = c_int()
|
|
1269
|
+
PiVOff = c_int()
|
|
1270
|
+
PiWidth = c_int()
|
|
1271
|
+
PiHeight = c_int()
|
|
1272
|
+
err_code = _sdk.CameraGetWbWindow(hCamera, byref(PiHOff), byref(PiVOff), byref(PiWidth), byref(PiHeight))
|
|
1273
|
+
SetLastError(err_code)
|
|
1274
|
+
return (PiHOff.value, PiVOff.value, PiWidth.value, PiHeight.value)
|
|
1275
|
+
|
|
1276
|
+
def CameraSetWbWindow(hCamera, iHOff, iVOff, iWidth, iHeight):
|
|
1277
|
+
err_code = _sdk.CameraSetWbWindow(hCamera, iHOff, iVOff, iWidth, iHeight)
|
|
1278
|
+
SetLastError(err_code)
|
|
1279
|
+
return err_code
|
|
1280
|
+
|
|
1281
|
+
def CameraIsWbWinVisible(hCamera):
|
|
1282
|
+
pbShow = c_int()
|
|
1283
|
+
err_code = _sdk.CameraIsWbWinVisible(hCamera, byref(pbShow))
|
|
1284
|
+
SetLastError(err_code)
|
|
1285
|
+
return pbShow.value
|
|
1286
|
+
|
|
1287
|
+
def CameraSetWbWinVisible(hCamera, bShow):
|
|
1288
|
+
err_code = _sdk.CameraSetWbWinVisible(hCamera, bShow)
|
|
1289
|
+
SetLastError(err_code)
|
|
1290
|
+
return err_code
|
|
1291
|
+
|
|
1292
|
+
def CameraImageOverlay(hCamera, pRgbBuffer, pFrInfo):
|
|
1293
|
+
err_code = _sdk.CameraImageOverlay(hCamera, c_void_p(pRgbBuffer), byref(pFrInfo))
|
|
1294
|
+
SetLastError(err_code)
|
|
1295
|
+
return err_code
|
|
1296
|
+
|
|
1297
|
+
def CameraSetCrossLine(hCamera, iLine, x, y, uColor, bVisible):
|
|
1298
|
+
err_code = _sdk.CameraSetCrossLine(hCamera, iLine, x, y, uColor, bVisible)
|
|
1299
|
+
SetLastError(err_code)
|
|
1300
|
+
return err_code
|
|
1301
|
+
|
|
1302
|
+
def CameraGetCrossLine(hCamera, iLine):
|
|
1303
|
+
px = c_int()
|
|
1304
|
+
py = c_int()
|
|
1305
|
+
pcolor = c_uint()
|
|
1306
|
+
pbVisible = c_int()
|
|
1307
|
+
err_code = _sdk.CameraGetCrossLine(hCamera, iLine, byref(px), byref(py), byref(pcolor), byref(pbVisible))
|
|
1308
|
+
SetLastError(err_code)
|
|
1309
|
+
return (px.value, py.value, pcolor.value, pbVisible.value)
|
|
1310
|
+
|
|
1311
|
+
def CameraGetCapability(hCamera):
|
|
1312
|
+
pCameraInfo = tSdkCameraCapbility()
|
|
1313
|
+
err_code = _sdk.CameraGetCapability(hCamera, byref(pCameraInfo))
|
|
1314
|
+
SetLastError(err_code)
|
|
1315
|
+
return pCameraInfo
|
|
1316
|
+
|
|
1317
|
+
def CameraWriteSN(hCamera, pbySN, iLevel):
|
|
1318
|
+
err_code = _sdk.CameraWriteSN(hCamera, _str_to_string_buffer(pbySN), iLevel)
|
|
1319
|
+
SetLastError(err_code)
|
|
1320
|
+
return err_code
|
|
1321
|
+
|
|
1322
|
+
def CameraReadSN(hCamera, iLevel):
|
|
1323
|
+
pbySN = create_string_buffer(64)
|
|
1324
|
+
err_code = _sdk.CameraReadSN(hCamera, pbySN, iLevel)
|
|
1325
|
+
SetLastError(err_code)
|
|
1326
|
+
return _string_buffer_to_str(pbySN)
|
|
1327
|
+
|
|
1328
|
+
def CameraSetTriggerDelayTime(hCamera, uDelayTimeUs):
|
|
1329
|
+
err_code = _sdk.CameraSetTriggerDelayTime(hCamera, uDelayTimeUs)
|
|
1330
|
+
SetLastError(err_code)
|
|
1331
|
+
return err_code
|
|
1332
|
+
|
|
1333
|
+
def CameraGetTriggerDelayTime(hCamera):
|
|
1334
|
+
puDelayTimeUs = c_uint()
|
|
1335
|
+
err_code = _sdk.CameraGetTriggerDelayTime(hCamera, byref(puDelayTimeUs))
|
|
1336
|
+
SetLastError(err_code)
|
|
1337
|
+
return puDelayTimeUs.value
|
|
1338
|
+
|
|
1339
|
+
def CameraSetTriggerCount(hCamera, iCount):
|
|
1340
|
+
err_code = _sdk.CameraSetTriggerCount(hCamera, iCount)
|
|
1341
|
+
SetLastError(err_code)
|
|
1342
|
+
return err_code
|
|
1343
|
+
|
|
1344
|
+
def CameraGetTriggerCount(hCamera):
|
|
1345
|
+
piCount = c_int()
|
|
1346
|
+
err_code = _sdk.CameraGetTriggerCount(hCamera, byref(piCount))
|
|
1347
|
+
SetLastError(err_code)
|
|
1348
|
+
return piCount.value
|
|
1349
|
+
|
|
1350
|
+
def CameraSoftTrigger(hCamera):
|
|
1351
|
+
err_code = _sdk.CameraSoftTrigger(hCamera)
|
|
1352
|
+
SetLastError(err_code)
|
|
1353
|
+
return err_code
|
|
1354
|
+
|
|
1355
|
+
def CameraSetTriggerMode(hCamera, iModeSel):
|
|
1356
|
+
err_code = _sdk.CameraSetTriggerMode(hCamera, iModeSel)
|
|
1357
|
+
SetLastError(err_code)
|
|
1358
|
+
return err_code
|
|
1359
|
+
|
|
1360
|
+
def CameraGetTriggerMode(hCamera):
|
|
1361
|
+
piModeSel = c_int()
|
|
1362
|
+
err_code = _sdk.CameraGetTriggerMode(hCamera, byref(piModeSel))
|
|
1363
|
+
SetLastError(err_code)
|
|
1364
|
+
return piModeSel.value
|
|
1365
|
+
|
|
1366
|
+
def CameraSetStrobeMode(hCamera, iMode):
|
|
1367
|
+
err_code = _sdk.CameraSetStrobeMode(hCamera, iMode)
|
|
1368
|
+
SetLastError(err_code)
|
|
1369
|
+
return err_code
|
|
1370
|
+
|
|
1371
|
+
def CameraGetStrobeMode(hCamera):
|
|
1372
|
+
piMode = c_int()
|
|
1373
|
+
err_code = _sdk.CameraGetStrobeMode(hCamera, byref(piMode))
|
|
1374
|
+
SetLastError(err_code)
|
|
1375
|
+
return piMode.value
|
|
1376
|
+
|
|
1377
|
+
def CameraSetStrobeDelayTime(hCamera, uDelayTimeUs):
|
|
1378
|
+
err_code = _sdk.CameraSetStrobeDelayTime(hCamera, uDelayTimeUs)
|
|
1379
|
+
SetLastError(err_code)
|
|
1380
|
+
return err_code
|
|
1381
|
+
|
|
1382
|
+
def CameraGetStrobeDelayTime(hCamera):
|
|
1383
|
+
upDelayTimeUs = c_uint()
|
|
1384
|
+
err_code = _sdk.CameraGetStrobeDelayTime(hCamera, byref(upDelayTimeUs))
|
|
1385
|
+
SetLastError(err_code)
|
|
1386
|
+
return upDelayTimeUs.value
|
|
1387
|
+
|
|
1388
|
+
def CameraSetStrobePulseWidth(hCamera, uTimeUs):
|
|
1389
|
+
err_code = _sdk.CameraSetStrobePulseWidth(hCamera, uTimeUs)
|
|
1390
|
+
SetLastError(err_code)
|
|
1391
|
+
return err_code
|
|
1392
|
+
|
|
1393
|
+
def CameraGetStrobePulseWidth(hCamera):
|
|
1394
|
+
upTimeUs = c_uint()
|
|
1395
|
+
err_code = _sdk.CameraGetStrobePulseWidth(hCamera, byref(upTimeUs))
|
|
1396
|
+
SetLastError(err_code)
|
|
1397
|
+
return upTimeUs.value
|
|
1398
|
+
|
|
1399
|
+
def CameraSetStrobePolarity(hCamera, uPolarity):
|
|
1400
|
+
err_code = _sdk.CameraSetStrobePolarity(hCamera, uPolarity)
|
|
1401
|
+
SetLastError(err_code)
|
|
1402
|
+
return err_code
|
|
1403
|
+
|
|
1404
|
+
def CameraGetStrobePolarity(hCamera):
|
|
1405
|
+
upPolarity = c_uint()
|
|
1406
|
+
err_code = _sdk.CameraGetStrobePolarity(hCamera, byref(upPolarity))
|
|
1407
|
+
SetLastError(err_code)
|
|
1408
|
+
return upPolarity.value
|
|
1409
|
+
|
|
1410
|
+
def CameraSetExtTrigSignalType(hCamera, iType):
|
|
1411
|
+
err_code = _sdk.CameraSetExtTrigSignalType(hCamera, iType)
|
|
1412
|
+
SetLastError(err_code)
|
|
1413
|
+
return err_code
|
|
1414
|
+
|
|
1415
|
+
def CameraGetExtTrigSignalType(hCamera):
|
|
1416
|
+
ipType = c_int()
|
|
1417
|
+
err_code = _sdk.CameraGetExtTrigSignalType(hCamera, byref(ipType))
|
|
1418
|
+
SetLastError(err_code)
|
|
1419
|
+
return ipType.value
|
|
1420
|
+
|
|
1421
|
+
def CameraSetExtTrigShutterType(hCamera, iType):
|
|
1422
|
+
err_code = _sdk.CameraSetExtTrigShutterType(hCamera, iType)
|
|
1423
|
+
SetLastError(err_code)
|
|
1424
|
+
return err_code
|
|
1425
|
+
|
|
1426
|
+
def CameraGetExtTrigShutterType(hCamera):
|
|
1427
|
+
ipType = c_int()
|
|
1428
|
+
err_code = _sdk.CameraGetExtTrigShutterType(hCamera, byref(ipType))
|
|
1429
|
+
SetLastError(err_code)
|
|
1430
|
+
return ipType.value
|
|
1431
|
+
|
|
1432
|
+
def CameraSetExtTrigDelayTime(hCamera, uDelayTimeUs):
|
|
1433
|
+
err_code = _sdk.CameraSetExtTrigDelayTime(hCamera, uDelayTimeUs)
|
|
1434
|
+
SetLastError(err_code)
|
|
1435
|
+
return err_code
|
|
1436
|
+
|
|
1437
|
+
def CameraGetExtTrigDelayTime(hCamera):
|
|
1438
|
+
upDelayTimeUs = c_uint()
|
|
1439
|
+
err_code = _sdk.CameraGetExtTrigDelayTime(hCamera, byref(upDelayTimeUs))
|
|
1440
|
+
SetLastError(err_code)
|
|
1441
|
+
return upDelayTimeUs.value
|
|
1442
|
+
|
|
1443
|
+
def CameraSetExtTrigJitterTime(hCamera, uTimeUs):
|
|
1444
|
+
err_code = _sdk.CameraSetExtTrigJitterTime(hCamera, uTimeUs)
|
|
1445
|
+
SetLastError(err_code)
|
|
1446
|
+
return err_code
|
|
1447
|
+
|
|
1448
|
+
def CameraGetExtTrigJitterTime(hCamera):
|
|
1449
|
+
upTimeUs = c_uint()
|
|
1450
|
+
err_code = _sdk.CameraGetExtTrigJitterTime(hCamera, byref(upTimeUs))
|
|
1451
|
+
SetLastError(err_code)
|
|
1452
|
+
return upTimeUs.value
|
|
1453
|
+
|
|
1454
|
+
def CameraGetExtTrigCapability(hCamera):
|
|
1455
|
+
puCapabilityMask = c_uint()
|
|
1456
|
+
err_code = _sdk.CameraGetExtTrigCapability(hCamera, byref(puCapabilityMask))
|
|
1457
|
+
SetLastError(err_code)
|
|
1458
|
+
return puCapabilityMask.value
|
|
1459
|
+
|
|
1460
|
+
def CameraPauseLevelTrigger(hCamera):
|
|
1461
|
+
err_code = _sdk.CameraPauseLevelTrigger(hCamera)
|
|
1462
|
+
SetLastError(err_code)
|
|
1463
|
+
return err_code
|
|
1464
|
+
|
|
1465
|
+
def CameraGetResolutionForSnap(hCamera):
|
|
1466
|
+
pImageResolution = tSdkImageResolution()
|
|
1467
|
+
err_code = _sdk.CameraGetResolutionForSnap(hCamera, byref(pImageResolution))
|
|
1468
|
+
SetLastError(err_code)
|
|
1469
|
+
return pImageResolution
|
|
1470
|
+
|
|
1471
|
+
def CameraSetResolutionForSnap(hCamera, pImageResolution):
|
|
1472
|
+
err_code = _sdk.CameraSetResolutionForSnap(hCamera, byref(pImageResolution))
|
|
1473
|
+
SetLastError(err_code)
|
|
1474
|
+
return err_code
|
|
1475
|
+
|
|
1476
|
+
def CameraCustomizeResolution(hCamera):
|
|
1477
|
+
pImageCustom = tSdkImageResolution()
|
|
1478
|
+
err_code = _sdk.CameraCustomizeResolution(hCamera, byref(pImageCustom))
|
|
1479
|
+
SetLastError(err_code)
|
|
1480
|
+
return pImageCustom
|
|
1481
|
+
|
|
1482
|
+
def CameraCustomizeReferWin(hCamera, iWinType, hParent):
|
|
1483
|
+
piHOff = c_int()
|
|
1484
|
+
piVOff = c_int()
|
|
1485
|
+
piWidth = c_int()
|
|
1486
|
+
piHeight = c_int()
|
|
1487
|
+
err_code = _sdk.CameraCustomizeReferWin(hCamera, iWinType, hParent, byref(piHOff), byref(piVOff), byref(piWidth), byref(piHeight))
|
|
1488
|
+
SetLastError(err_code)
|
|
1489
|
+
return (piHOff.value, piVOff.value, piWidth.value, piHeight.value)
|
|
1490
|
+
|
|
1491
|
+
def CameraShowSettingPage(hCamera, bShow):
|
|
1492
|
+
err_code = _sdk.CameraShowSettingPage(hCamera, bShow)
|
|
1493
|
+
SetLastError(err_code)
|
|
1494
|
+
return err_code
|
|
1495
|
+
|
|
1496
|
+
def CameraCreateSettingPage(hCamera, hParent, pWinText, pCallbackFunc = None, pCallbackCtx = 0, uReserved = 0):
|
|
1497
|
+
err_code = _sdk.CameraCreateSettingPage(hCamera, hParent, _str_to_string_buffer(pWinText), pCallbackFunc, c_void_p(pCallbackCtx), uReserved)
|
|
1498
|
+
SetLastError(err_code)
|
|
1499
|
+
return err_code
|
|
1500
|
+
|
|
1501
|
+
def CameraCreateSettingPageEx(hCamera):
|
|
1502
|
+
err_code = _sdk.CameraCreateSettingPageEx(hCamera)
|
|
1503
|
+
SetLastError(err_code)
|
|
1504
|
+
return err_code
|
|
1505
|
+
|
|
1506
|
+
def CameraSetActiveSettingSubPage(hCamera, index):
|
|
1507
|
+
err_code = _sdk.CameraSetActiveSettingSubPage(hCamera, index)
|
|
1508
|
+
SetLastError(err_code)
|
|
1509
|
+
return err_code
|
|
1510
|
+
|
|
1511
|
+
def CameraSetSettingPageParent(hCamera, hParentWnd, Flags):
|
|
1512
|
+
err_code = _sdk.CameraSetSettingPageParent(hCamera, hParentWnd, Flags)
|
|
1513
|
+
SetLastError(err_code)
|
|
1514
|
+
return err_code
|
|
1515
|
+
|
|
1516
|
+
def CameraGetSettingPageHWnd(hCamera):
|
|
1517
|
+
hWnd = c_void_p()
|
|
1518
|
+
err_code = _sdk.CameraGetSettingPageHWnd(hCamera, byref(hWnd))
|
|
1519
|
+
SetLastError(err_code)
|
|
1520
|
+
return hWnd.value
|
|
1521
|
+
|
|
1522
|
+
def CameraSpecialControl(hCamera, dwCtrlCode, dwParam, lpData):
|
|
1523
|
+
err_code = _sdk.CameraSpecialControl(hCamera, dwCtrlCode, dwParam, c_void_p(lpData) )
|
|
1524
|
+
SetLastError(err_code)
|
|
1525
|
+
return err_code
|
|
1526
|
+
|
|
1527
|
+
def CameraGetFrameStatistic(hCamera):
|
|
1528
|
+
psFrameStatistic = tSdkFrameStatistic()
|
|
1529
|
+
err_code = _sdk.CameraGetFrameStatistic(hCamera, byref(psFrameStatistic))
|
|
1530
|
+
SetLastError(err_code)
|
|
1531
|
+
return psFrameStatistic
|
|
1532
|
+
|
|
1533
|
+
def CameraSetNoiseFilter(hCamera, bEnable):
|
|
1534
|
+
err_code = _sdk.CameraSetNoiseFilter(hCamera, bEnable)
|
|
1535
|
+
SetLastError(err_code)
|
|
1536
|
+
return err_code
|
|
1537
|
+
|
|
1538
|
+
def CameraGetNoiseFilterState(hCamera):
|
|
1539
|
+
pEnable = c_int()
|
|
1540
|
+
err_code = _sdk.CameraGetNoiseFilterState(hCamera, byref(pEnable))
|
|
1541
|
+
SetLastError(err_code)
|
|
1542
|
+
return pEnable.value
|
|
1543
|
+
|
|
1544
|
+
def CameraRstTimeStamp(hCamera):
|
|
1545
|
+
err_code = _sdk.CameraRstTimeStamp(hCamera)
|
|
1546
|
+
SetLastError(err_code)
|
|
1547
|
+
return err_code
|
|
1548
|
+
|
|
1549
|
+
def CameraSaveUserData(hCamera, uStartAddr, pbData):
|
|
1550
|
+
err_code = _sdk.CameraSaveUserData(hCamera, uStartAddr, pbData, len(pbData))
|
|
1551
|
+
SetLastError(err_code)
|
|
1552
|
+
return err_code
|
|
1553
|
+
|
|
1554
|
+
def CameraLoadUserData(hCamera, uStartAddr, ilen):
|
|
1555
|
+
pbData = create_string_buffer(ilen)
|
|
1556
|
+
err_code = _sdk.CameraLoadUserData(hCamera, uStartAddr, pbData, ilen)
|
|
1557
|
+
SetLastError(err_code)
|
|
1558
|
+
return pbData[:]
|
|
1559
|
+
|
|
1560
|
+
def CameraGetFriendlyName(hCamera):
|
|
1561
|
+
pName = create_string_buffer(64)
|
|
1562
|
+
err_code = _sdk.CameraGetFriendlyName(hCamera, pName)
|
|
1563
|
+
SetLastError(err_code)
|
|
1564
|
+
return _string_buffer_to_str(pName)
|
|
1565
|
+
|
|
1566
|
+
def CameraSetFriendlyName(hCamera, pName):
|
|
1567
|
+
pNameBuf = _str_to_string_buffer(pName)
|
|
1568
|
+
resize(pNameBuf, 64)
|
|
1569
|
+
err_code = _sdk.CameraSetFriendlyName(hCamera, pNameBuf)
|
|
1570
|
+
SetLastError(err_code)
|
|
1571
|
+
return err_code
|
|
1572
|
+
|
|
1573
|
+
def CameraSdkGetVersionString():
|
|
1574
|
+
pVersionString = create_string_buffer(64)
|
|
1575
|
+
err_code = _sdk.CameraSdkGetVersionString(pVersionString)
|
|
1576
|
+
SetLastError(err_code)
|
|
1577
|
+
return _string_buffer_to_str(pVersionString)
|
|
1578
|
+
|
|
1579
|
+
def CameraCheckFwUpdate(hCamera):
|
|
1580
|
+
pNeedUpdate = c_int()
|
|
1581
|
+
err_code = _sdk.CameraCheckFwUpdate(hCamera, byref(pNeedUpdate))
|
|
1582
|
+
SetLastError(err_code)
|
|
1583
|
+
return pNeedUpdate.value
|
|
1584
|
+
|
|
1585
|
+
def CameraGetFirmwareVersion(hCamera):
|
|
1586
|
+
pVersion = create_string_buffer(64)
|
|
1587
|
+
err_code = _sdk.CameraGetFirmwareVersion(hCamera, pVersion)
|
|
1588
|
+
SetLastError(err_code)
|
|
1589
|
+
return _string_buffer_to_str(pVersion)
|
|
1590
|
+
|
|
1591
|
+
def CameraGetEnumInfo(hCamera):
|
|
1592
|
+
pCameraInfo = tSdkCameraDevInfo()
|
|
1593
|
+
err_code = _sdk.CameraGetEnumInfo(hCamera, byref(pCameraInfo))
|
|
1594
|
+
SetLastError(err_code)
|
|
1595
|
+
return pCameraInfo
|
|
1596
|
+
|
|
1597
|
+
def CameraGetInerfaceVersion(hCamera):
|
|
1598
|
+
pVersion = create_string_buffer(64)
|
|
1599
|
+
err_code = _sdk.CameraGetInerfaceVersion(hCamera, pVersion)
|
|
1600
|
+
SetLastError(err_code)
|
|
1601
|
+
return _string_buffer_to_str(pVersion)
|
|
1602
|
+
|
|
1603
|
+
def CameraSetIOState(hCamera, iOutputIOIndex, uState):
|
|
1604
|
+
err_code = _sdk.CameraSetIOState(hCamera, iOutputIOIndex, uState)
|
|
1605
|
+
SetLastError(err_code)
|
|
1606
|
+
return err_code
|
|
1607
|
+
|
|
1608
|
+
def CameraSetIOStateEx(hCamera, iOutputIOIndex, uState):
|
|
1609
|
+
err_code = _sdk.CameraSetIOStateEx(hCamera, iOutputIOIndex, uState)
|
|
1610
|
+
SetLastError(err_code)
|
|
1611
|
+
return err_code
|
|
1612
|
+
|
|
1613
|
+
def CameraGetOutPutIOState(hCamera, iOutputIOIndex):
|
|
1614
|
+
puState = c_int()
|
|
1615
|
+
err_code = _sdk.CameraGetOutPutIOState(hCamera, iOutputIOIndex, byref(puState))
|
|
1616
|
+
SetLastError(err_code)
|
|
1617
|
+
return puState.value
|
|
1618
|
+
|
|
1619
|
+
def CameraGetOutPutIOStateEx(hCamera, iOutputIOIndex):
|
|
1620
|
+
puState = c_int()
|
|
1621
|
+
err_code = _sdk.CameraGetOutPutIOStateEx(hCamera, iOutputIOIndex, byref(puState))
|
|
1622
|
+
SetLastError(err_code)
|
|
1623
|
+
return puState.value
|
|
1624
|
+
|
|
1625
|
+
def CameraGetIOState(hCamera, iInputIOIndex):
|
|
1626
|
+
puState = c_int()
|
|
1627
|
+
err_code = _sdk.CameraGetIOState(hCamera, iInputIOIndex, byref(puState))
|
|
1628
|
+
SetLastError(err_code)
|
|
1629
|
+
return puState.value
|
|
1630
|
+
|
|
1631
|
+
def CameraGetIOStateEx(hCamera, iInputIOIndex):
|
|
1632
|
+
puState = c_int()
|
|
1633
|
+
err_code = _sdk.CameraGetIOStateEx(hCamera, iInputIOIndex, byref(puState))
|
|
1634
|
+
SetLastError(err_code)
|
|
1635
|
+
return puState.value
|
|
1636
|
+
|
|
1637
|
+
def CameraSetInPutIOMode(hCamera, iInputIOIndex, iMode):
|
|
1638
|
+
err_code = _sdk.CameraSetInPutIOMode(hCamera, iInputIOIndex, iMode)
|
|
1639
|
+
SetLastError(err_code)
|
|
1640
|
+
return err_code
|
|
1641
|
+
|
|
1642
|
+
def CameraSetOutPutIOMode(hCamera, iOutputIOIndex, iMode):
|
|
1643
|
+
err_code = _sdk.CameraSetOutPutIOMode(hCamera, iOutputIOIndex, iMode)
|
|
1644
|
+
SetLastError(err_code)
|
|
1645
|
+
return err_code
|
|
1646
|
+
|
|
1647
|
+
def CameraSetOutPutPWM(hCamera, iOutputIOIndex, iCycle, uDuty):
|
|
1648
|
+
err_code = _sdk.CameraSetOutPutPWM(hCamera, iOutputIOIndex, iCycle, uDuty)
|
|
1649
|
+
SetLastError(err_code)
|
|
1650
|
+
return err_code
|
|
1651
|
+
|
|
1652
|
+
def CameraSetAeAlgorithm(hCamera, iIspProcessor, iAeAlgorithmSel):
|
|
1653
|
+
err_code = _sdk.CameraSetAeAlgorithm(hCamera, iIspProcessor, iAeAlgorithmSel)
|
|
1654
|
+
SetLastError(err_code)
|
|
1655
|
+
return err_code
|
|
1656
|
+
|
|
1657
|
+
def CameraGetAeAlgorithm(hCamera, iIspProcessor):
|
|
1658
|
+
piAlgorithmSel = c_int()
|
|
1659
|
+
err_code = _sdk.CameraGetAeAlgorithm(hCamera, iIspProcessor, byref(piAlgorithmSel))
|
|
1660
|
+
SetLastError(err_code)
|
|
1661
|
+
return piAlgorithmSel.value
|
|
1662
|
+
|
|
1663
|
+
def CameraSetBayerDecAlgorithm(hCamera, iIspProcessor, iAlgorithmSel):
|
|
1664
|
+
err_code = _sdk.CameraSetBayerDecAlgorithm(hCamera, iIspProcessor, iAlgorithmSel)
|
|
1665
|
+
SetLastError(err_code)
|
|
1666
|
+
return err_code
|
|
1667
|
+
|
|
1668
|
+
def CameraGetBayerDecAlgorithm(hCamera, iIspProcessor):
|
|
1669
|
+
piAlgorithmSel = c_int()
|
|
1670
|
+
err_code = _sdk.CameraGetBayerDecAlgorithm(hCamera, iIspProcessor, byref(piAlgorithmSel))
|
|
1671
|
+
SetLastError(err_code)
|
|
1672
|
+
return piAlgorithmSel.value
|
|
1673
|
+
|
|
1674
|
+
def CameraSetIspProcessor(hCamera, iIspProcessor):
|
|
1675
|
+
err_code = _sdk.CameraSetIspProcessor(hCamera, iIspProcessor)
|
|
1676
|
+
SetLastError(err_code)
|
|
1677
|
+
return err_code
|
|
1678
|
+
|
|
1679
|
+
def CameraGetIspProcessor(hCamera):
|
|
1680
|
+
piIspProcessor = c_int()
|
|
1681
|
+
err_code = _sdk.CameraGetIspProcessor(hCamera, byref(piIspProcessor))
|
|
1682
|
+
SetLastError(err_code)
|
|
1683
|
+
return piIspProcessor.value
|
|
1684
|
+
|
|
1685
|
+
def CameraSetBlackLevel(hCamera, iBlackLevel):
|
|
1686
|
+
err_code = _sdk.CameraSetBlackLevel(hCamera, iBlackLevel)
|
|
1687
|
+
SetLastError(err_code)
|
|
1688
|
+
return err_code
|
|
1689
|
+
|
|
1690
|
+
def CameraGetBlackLevel(hCamera):
|
|
1691
|
+
piBlackLevel = c_int()
|
|
1692
|
+
err_code = _sdk.CameraGetBlackLevel(hCamera, byref(piBlackLevel))
|
|
1693
|
+
SetLastError(err_code)
|
|
1694
|
+
return piBlackLevel.value
|
|
1695
|
+
|
|
1696
|
+
def CameraSetWhiteLevel(hCamera, iWhiteLevel):
|
|
1697
|
+
err_code = _sdk.CameraSetWhiteLevel(hCamera, iWhiteLevel)
|
|
1698
|
+
SetLastError(err_code)
|
|
1699
|
+
return err_code
|
|
1700
|
+
|
|
1701
|
+
def CameraGetWhiteLevel(hCamera):
|
|
1702
|
+
piWhiteLevel = c_int()
|
|
1703
|
+
err_code = _sdk.CameraGetWhiteLevel(hCamera, byref(piWhiteLevel))
|
|
1704
|
+
SetLastError(err_code)
|
|
1705
|
+
return piWhiteLevel.value
|
|
1706
|
+
|
|
1707
|
+
def CameraSetIspOutFormat(hCamera, uFormat):
|
|
1708
|
+
err_code = _sdk.CameraSetIspOutFormat(hCamera, uFormat)
|
|
1709
|
+
SetLastError(err_code)
|
|
1710
|
+
return err_code
|
|
1711
|
+
|
|
1712
|
+
def CameraGetIspOutFormat(hCamera):
|
|
1713
|
+
puFormat = c_int()
|
|
1714
|
+
err_code = _sdk.CameraGetIspOutFormat(hCamera, byref(puFormat))
|
|
1715
|
+
SetLastError(err_code)
|
|
1716
|
+
return puFormat.value
|
|
1717
|
+
|
|
1718
|
+
def CameraGetErrorString(iStatusCode):
|
|
1719
|
+
_sdk.CameraGetErrorString.restype = c_char_p
|
|
1720
|
+
msg = _sdk.CameraGetErrorString(iStatusCode)
|
|
1721
|
+
if msg:
|
|
1722
|
+
return _string_buffer_to_str(msg)
|
|
1723
|
+
else:
|
|
1724
|
+
return ''
|
|
1725
|
+
|
|
1726
|
+
def CameraGetImageBufferEx2(hCamera, pImageData, uOutFormat, wTimes):
|
|
1727
|
+
piWidth = c_int()
|
|
1728
|
+
piHeight = c_int()
|
|
1729
|
+
err_code = _sdk.CameraGetImageBufferEx2(hCamera, c_void_p(pImageData), uOutFormat, byref(piWidth), byref(piHeight), wTimes)
|
|
1730
|
+
SetLastError(err_code)
|
|
1731
|
+
if err_code != 0:
|
|
1732
|
+
raise CameraException(err_code)
|
|
1733
|
+
return (piWidth.value, piHeight.value)
|
|
1734
|
+
|
|
1735
|
+
def CameraGetImageBufferEx3(hCamera, pImageData, uOutFormat, wTimes):
|
|
1736
|
+
piWidth = c_int()
|
|
1737
|
+
piHeight = c_int()
|
|
1738
|
+
puTimeStamp = c_int()
|
|
1739
|
+
err_code = _sdk.CameraGetImageBufferEx3(hCamera, c_void_p(pImageData), uOutFormat, byref(piWidth), byref(piHeight), byref(puTimeStamp), wTimes)
|
|
1740
|
+
SetLastError(err_code)
|
|
1741
|
+
if err_code != 0:
|
|
1742
|
+
raise CameraException(err_code)
|
|
1743
|
+
return (piWidth.value, piHeight.value, puTimeStamp.value)
|
|
1744
|
+
|
|
1745
|
+
def CameraGetCapabilityEx2(hCamera):
|
|
1746
|
+
pMaxWidth = c_int()
|
|
1747
|
+
pMaxHeight = c_int()
|
|
1748
|
+
pbColorCamera = c_int()
|
|
1749
|
+
err_code = _sdk.CameraGetCapabilityEx2(hCamera, byref(pMaxWidth), byref(pMaxHeight), byref(pbColorCamera))
|
|
1750
|
+
SetLastError(err_code)
|
|
1751
|
+
return (pMaxWidth.value, pMaxHeight.value, pbColorCamera.value)
|
|
1752
|
+
|
|
1753
|
+
def CameraReConnect(hCamera):
|
|
1754
|
+
err_code = _sdk.CameraReConnect(hCamera)
|
|
1755
|
+
SetLastError(err_code)
|
|
1756
|
+
return err_code
|
|
1757
|
+
|
|
1758
|
+
def CameraConnectTest(hCamera):
|
|
1759
|
+
err_code = _sdk.CameraConnectTest(hCamera)
|
|
1760
|
+
SetLastError(err_code)
|
|
1761
|
+
return err_code
|
|
1762
|
+
|
|
1763
|
+
def CameraSetLedEnable(hCamera, index, enable):
|
|
1764
|
+
err_code = _sdk.CameraSetLedEnable(hCamera, index, enable)
|
|
1765
|
+
SetLastError(err_code)
|
|
1766
|
+
return err_code
|
|
1767
|
+
|
|
1768
|
+
def CameraGetLedEnable(hCamera, index):
|
|
1769
|
+
enable = c_int()
|
|
1770
|
+
err_code = _sdk.CameraGetLedEnable(hCamera, index, byref(enable))
|
|
1771
|
+
SetLastError(err_code)
|
|
1772
|
+
return enable.value
|
|
1773
|
+
|
|
1774
|
+
def CameraSetLedOnOff(hCamera, index, onoff):
|
|
1775
|
+
err_code = _sdk.CameraSetLedOnOff(hCamera, index, onoff)
|
|
1776
|
+
SetLastError(err_code)
|
|
1777
|
+
return err_code
|
|
1778
|
+
|
|
1779
|
+
def CameraGetLedOnOff(hCamera, index):
|
|
1780
|
+
onoff = c_int()
|
|
1781
|
+
err_code = _sdk.CameraGetLedOnOff(hCamera, index, byref(onoff))
|
|
1782
|
+
SetLastError(err_code)
|
|
1783
|
+
return onoff.value
|
|
1784
|
+
|
|
1785
|
+
def CameraSetLedDuration(hCamera, index, duration):
|
|
1786
|
+
err_code = _sdk.CameraSetLedDuration(hCamera, index, duration)
|
|
1787
|
+
SetLastError(err_code)
|
|
1788
|
+
return err_code
|
|
1789
|
+
|
|
1790
|
+
def CameraGetLedDuration(hCamera, index):
|
|
1791
|
+
duration = c_uint()
|
|
1792
|
+
err_code = _sdk.CameraGetLedDuration(hCamera, index, byref(duration))
|
|
1793
|
+
SetLastError(err_code)
|
|
1794
|
+
return duration.value
|
|
1795
|
+
|
|
1796
|
+
def CameraSetLedBrightness(hCamera, index, uBrightness):
|
|
1797
|
+
err_code = _sdk.CameraSetLedBrightness(hCamera, index, uBrightness)
|
|
1798
|
+
SetLastError(err_code)
|
|
1799
|
+
return err_code
|
|
1800
|
+
|
|
1801
|
+
def CameraGetLedBrightness(hCamera, index):
|
|
1802
|
+
uBrightness = c_uint()
|
|
1803
|
+
err_code = _sdk.CameraGetLedBrightness(hCamera, index, byref(uBrightness))
|
|
1804
|
+
SetLastError(err_code)
|
|
1805
|
+
return uBrightness.value
|
|
1806
|
+
|
|
1807
|
+
def CameraEnableTransferRoi(hCamera, uEnableMask):
|
|
1808
|
+
err_code = _sdk.CameraEnableTransferRoi(hCamera, uEnableMask)
|
|
1809
|
+
SetLastError(err_code)
|
|
1810
|
+
return err_code
|
|
1811
|
+
|
|
1812
|
+
def CameraSetTransferRoi(hCamera, index, X1, Y1, X2, Y2):
|
|
1813
|
+
err_code = _sdk.CameraSetTransferRoi(hCamera, index, X1, Y1, X2, Y2)
|
|
1814
|
+
SetLastError(err_code)
|
|
1815
|
+
return err_code
|
|
1816
|
+
|
|
1817
|
+
def CameraGetTransferRoi(hCamera, index):
|
|
1818
|
+
pX1 = c_uint()
|
|
1819
|
+
pY1 = c_uint()
|
|
1820
|
+
pX2 = c_uint()
|
|
1821
|
+
pY2 = c_uint()
|
|
1822
|
+
err_code = _sdk.CameraGetTransferRoi(hCamera, index, byref(pX1), byref(pY1), byref(pX2), byref(pY2))
|
|
1823
|
+
SetLastError(err_code)
|
|
1824
|
+
return (pX1.value, pY1.value, pX2.value, pY2.value)
|
|
1825
|
+
|
|
1826
|
+
def CameraAlignMalloc(size, align = 16):
|
|
1827
|
+
_sdk.CameraAlignMalloc.restype = c_void_p
|
|
1828
|
+
r = _sdk.CameraAlignMalloc(size, align)
|
|
1829
|
+
return r
|
|
1830
|
+
|
|
1831
|
+
def CameraAlignFree(membuffer):
|
|
1832
|
+
_sdk.CameraAlignFree(c_void_p(membuffer))
|
|
1833
|
+
|
|
1834
|
+
def CameraSetAutoConnect(hCamera, bEnable):
|
|
1835
|
+
err_code = _sdk.CameraSetAutoConnect(hCamera, bEnable)
|
|
1836
|
+
SetLastError(err_code)
|
|
1837
|
+
return err_code
|
|
1838
|
+
|
|
1839
|
+
def CameraGetAutoConnect(hCamera):
|
|
1840
|
+
pbEnable = c_int()
|
|
1841
|
+
err_code = _sdk.CameraGetAutoConnect(hCamera, byref(pbEnable))
|
|
1842
|
+
SetLastError(err_code)
|
|
1843
|
+
return pbEnable.value
|
|
1844
|
+
|
|
1845
|
+
def CameraGetReConnectCounts(hCamera):
|
|
1846
|
+
puCounts = c_int()
|
|
1847
|
+
err_code = _sdk.CameraGetReConnectCounts(hCamera, byref(puCounts))
|
|
1848
|
+
SetLastError(err_code)
|
|
1849
|
+
return puCounts.value
|
|
1850
|
+
|
|
1851
|
+
def CameraSetSingleGrabMode(hCamera, bEnable):
|
|
1852
|
+
err_code = _sdk.CameraSetSingleGrabMode(hCamera, bEnable)
|
|
1853
|
+
SetLastError(err_code)
|
|
1854
|
+
return err_code
|
|
1855
|
+
|
|
1856
|
+
def CameraGetSingleGrabMode(hCamera):
|
|
1857
|
+
pbEnable = c_int()
|
|
1858
|
+
err_code = _sdk.CameraGetSingleGrabMode(hCamera, byref(pbEnable))
|
|
1859
|
+
SetLastError(err_code)
|
|
1860
|
+
return pbEnable.value
|
|
1861
|
+
|
|
1862
|
+
def CameraRestartGrab(hCamera):
|
|
1863
|
+
err_code = _sdk.CameraRestartGrab(hCamera)
|
|
1864
|
+
SetLastError(err_code)
|
|
1865
|
+
return err_code
|
|
1866
|
+
|
|
1867
|
+
def CameraEvaluateImageDefinition(hCamera, iAlgorithSel, pbyIn, pFrInfo):
|
|
1868
|
+
DefinitionValue = c_double()
|
|
1869
|
+
err_code = _sdk.CameraEvaluateImageDefinition(hCamera, iAlgorithSel, c_void_p(pbyIn), byref(pFrInfo), byref(DefinitionValue))
|
|
1870
|
+
SetLastError(err_code)
|
|
1871
|
+
return DefinitionValue.value
|
|
1872
|
+
|
|
1873
|
+
def CameraDrawText(pRgbBuffer, pFrInfo, pFontFileName, FontWidth, FontHeight, pText, Left, Top, Width, Height, TextColor, uFlags):
|
|
1874
|
+
err_code = _sdk.CameraDrawText(c_void_p(pRgbBuffer), byref(pFrInfo), _str_to_string_buffer(pFontFileName), FontWidth, FontHeight, _str_to_string_buffer(pText), Left, Top, Width, Height, TextColor, uFlags)
|
|
1875
|
+
SetLastError(err_code)
|
|
1876
|
+
return err_code
|
|
1877
|
+
|
|
1878
|
+
def CameraGigeEnumerateDevice(ipList, MaxCount = 32):
|
|
1879
|
+
if type(ipList) in (list, tuple):
|
|
1880
|
+
ipList = map(lambda x: _str_to_string_buffer(x), ipList)
|
|
1881
|
+
else:
|
|
1882
|
+
ipList = (_str_to_string_buffer(ipList),)
|
|
1883
|
+
numIP = len(ipList)
|
|
1884
|
+
ppIpList = (c_void_p * numIP)(*map(lambda x: addressof(x), ipList))
|
|
1885
|
+
Nums = c_int(MaxCount)
|
|
1886
|
+
pCameraList = (tSdkCameraDevInfo * Nums.value)()
|
|
1887
|
+
err_code = _sdk.CameraGigeEnumerateDevice(ppIpList, numIP, pCameraList, byref(Nums))
|
|
1888
|
+
SetLastError(err_code)
|
|
1889
|
+
return pCameraList[0:Nums.value]
|
|
1890
|
+
|
|
1891
|
+
def CameraGigeGetIp(pCameraInfo):
|
|
1892
|
+
CamIp = create_string_buffer(32)
|
|
1893
|
+
CamMask = create_string_buffer(32)
|
|
1894
|
+
CamGateWay = create_string_buffer(32)
|
|
1895
|
+
EtIp = create_string_buffer(32)
|
|
1896
|
+
EtMask = create_string_buffer(32)
|
|
1897
|
+
EtGateWay = create_string_buffer(32)
|
|
1898
|
+
err_code = _sdk.CameraGigeGetIp(byref(pCameraInfo), CamIp, CamMask, CamGateWay, EtIp, EtMask, EtGateWay)
|
|
1899
|
+
SetLastError(err_code)
|
|
1900
|
+
return (_string_buffer_to_str(CamIp), _string_buffer_to_str(CamMask), _string_buffer_to_str(CamGateWay),
|
|
1901
|
+
_string_buffer_to_str(EtIp), _string_buffer_to_str(EtMask), _string_buffer_to_str(EtGateWay) )
|
|
1902
|
+
|
|
1903
|
+
def CameraGigeSetIp(pCameraInfo, Ip, SubMask, GateWay, bPersistent):
|
|
1904
|
+
err_code = _sdk.CameraGigeSetIp(byref(pCameraInfo),
|
|
1905
|
+
_str_to_string_buffer(Ip), _str_to_string_buffer(SubMask), _str_to_string_buffer(GateWay), bPersistent)
|
|
1906
|
+
SetLastError(err_code)
|
|
1907
|
+
return err_code
|
|
1908
|
+
|
|
1909
|
+
def CameraGigeGetMac(pCameraInfo):
|
|
1910
|
+
CamMac = create_string_buffer(32)
|
|
1911
|
+
EtMac = create_string_buffer(32)
|
|
1912
|
+
err_code = _sdk.CameraGigeGetMac(byref(pCameraInfo), CamMac, EtMac)
|
|
1913
|
+
SetLastError(err_code)
|
|
1914
|
+
return (_string_buffer_to_str(CamMac), _string_buffer_to_str(EtMac) )
|
|
1915
|
+
|
|
1916
|
+
def CameraEnableFastResponse(hCamera):
|
|
1917
|
+
err_code = _sdk.CameraEnableFastResponse(hCamera)
|
|
1918
|
+
SetLastError(err_code)
|
|
1919
|
+
return err_code
|
|
1920
|
+
|
|
1921
|
+
def CameraSetCorrectDeadPixel(hCamera, bEnable):
|
|
1922
|
+
err_code = _sdk.CameraSetCorrectDeadPixel(hCamera, bEnable)
|
|
1923
|
+
SetLastError(err_code)
|
|
1924
|
+
return err_code
|
|
1925
|
+
|
|
1926
|
+
def CameraGetCorrectDeadPixel(hCamera):
|
|
1927
|
+
pbEnable = c_int()
|
|
1928
|
+
err_code = _sdk.CameraGetCorrectDeadPixel(hCamera, byref(pbEnable))
|
|
1929
|
+
SetLastError(err_code)
|
|
1930
|
+
return pbEnable.value
|
|
1931
|
+
|
|
1932
|
+
def CameraFlatFieldingCorrectSetEnable(hCamera, bEnable):
|
|
1933
|
+
err_code = _sdk.CameraFlatFieldingCorrectSetEnable(hCamera, bEnable)
|
|
1934
|
+
SetLastError(err_code)
|
|
1935
|
+
return err_code
|
|
1936
|
+
|
|
1937
|
+
def CameraFlatFieldingCorrectGetEnable(hCamera):
|
|
1938
|
+
pbEnable = c_int()
|
|
1939
|
+
err_code = _sdk.CameraFlatFieldingCorrectGetEnable(hCamera, byref(pbEnable))
|
|
1940
|
+
SetLastError(err_code)
|
|
1941
|
+
return pbEnable.value
|
|
1942
|
+
|
|
1943
|
+
def CameraFlatFieldingCorrectSetParameter(hCamera, pDarkFieldingImage, pDarkFieldingFrInfo, pLightFieldingImage, pLightFieldingFrInfo):
|
|
1944
|
+
err_code = _sdk.CameraFlatFieldingCorrectSetParameter(hCamera, c_void_p(pDarkFieldingImage), byref(pDarkFieldingFrInfo), c_void_p(pLightFieldingImage), byref(pLightFieldingFrInfo))
|
|
1945
|
+
SetLastError(err_code)
|
|
1946
|
+
return err_code
|
|
1947
|
+
|
|
1948
|
+
def CameraFlatFieldingCorrectGetParameterState(hCamera):
|
|
1949
|
+
pbValid = c_int()
|
|
1950
|
+
pFilePath = create_string_buffer(1024)
|
|
1951
|
+
err_code = _sdk.CameraFlatFieldingCorrectGetParameterState(hCamera, byref(pbValid), pFilePath)
|
|
1952
|
+
SetLastError(err_code)
|
|
1953
|
+
return (pbValid.value, _string_buffer_to_str(pFilePath) )
|
|
1954
|
+
|
|
1955
|
+
def CameraFlatFieldingCorrectSaveParameterToFile(hCamera, pszFileName):
|
|
1956
|
+
err_code = _sdk.CameraFlatFieldingCorrectSaveParameterToFile(hCamera, _str_to_string_buffer(pszFileName))
|
|
1957
|
+
SetLastError(err_code)
|
|
1958
|
+
return err_code
|
|
1959
|
+
|
|
1960
|
+
def CameraFlatFieldingCorrectLoadParameterFromFile(hCamera, pszFileName):
|
|
1961
|
+
err_code = _sdk.CameraFlatFieldingCorrectLoadParameterFromFile(hCamera, _str_to_string_buffer(pszFileName))
|
|
1962
|
+
SetLastError(err_code)
|
|
1963
|
+
return err_code
|
|
1964
|
+
|
|
1965
|
+
def CameraCommonCall(hCamera, pszCall, uResultBufSize):
|
|
1966
|
+
pszResult = create_string_buffer(uResultBufSize) if uResultBufSize > 0 else None
|
|
1967
|
+
err_code = _sdk.CameraCommonCall(hCamera, _str_to_string_buffer(pszCall), pszResult, uResultBufSize)
|
|
1968
|
+
SetLastError(err_code)
|
|
1969
|
+
return _string_buffer_to_str(pszResult) if pszResult else ''
|
|
1970
|
+
|
|
1971
|
+
def CameraSetDenoise3DParams(hCamera, bEnable, nCount, Weights):
|
|
1972
|
+
assert(nCount >= 2 and nCount <= 8)
|
|
1973
|
+
if Weights:
|
|
1974
|
+
assert(len(Weights) == nCount)
|
|
1975
|
+
WeightsNative = (c_float * nCount)(*Weights)
|
|
1976
|
+
else:
|
|
1977
|
+
WeightsNative = None
|
|
1978
|
+
err_code = _sdk.CameraSetDenoise3DParams(hCamera, bEnable, nCount, WeightsNative)
|
|
1979
|
+
SetLastError(err_code)
|
|
1980
|
+
return err_code
|
|
1981
|
+
|
|
1982
|
+
def CameraGetDenoise3DParams(hCamera):
|
|
1983
|
+
bEnable = c_int()
|
|
1984
|
+
nCount = c_int()
|
|
1985
|
+
bUseWeight = c_int()
|
|
1986
|
+
Weights = (c_float * 8)()
|
|
1987
|
+
err_code = _sdk.CameraGetDenoise3DParams(hCamera, byref(bEnable), byref(nCount), byref(bUseWeight), Weights)
|
|
1988
|
+
SetLastError(err_code)
|
|
1989
|
+
bEnable, nCount, bUseWeight = bEnable.value, nCount.value, bUseWeight.value
|
|
1990
|
+
if bUseWeight:
|
|
1991
|
+
Weights = Weights[:nCount]
|
|
1992
|
+
else:
|
|
1993
|
+
Weights = None
|
|
1994
|
+
return (bEnable, nCount, bUseWeight, Weights)
|
|
1995
|
+
|
|
1996
|
+
def CameraManualDenoise3D(InFramesHead, InFramesData, nCount, Weights, OutFrameHead, OutFrameData):
|
|
1997
|
+
assert(nCount > 0)
|
|
1998
|
+
assert(len(InFramesData) == nCount)
|
|
1999
|
+
assert(Weights is None or len(Weights) == nCount)
|
|
2000
|
+
InFramesDataNative = (c_void_p * nCount)(*InFramesData)
|
|
2001
|
+
WeightsNative = (c_float * nCount)(*Weights) if Weights else None
|
|
2002
|
+
err_code = _sdk.CameraManualDenoise3D(byref(InFramesHead), InFramesDataNative, nCount, WeightsNative, byref(OutFrameHead), c_void_p(OutFrameData))
|
|
2003
|
+
SetLastError(err_code)
|
|
2004
|
+
return err_code
|
|
2005
|
+
|
|
2006
|
+
def CameraCustomizeDeadPixels(hCamera, hParent):
|
|
2007
|
+
err_code = _sdk.CameraCustomizeDeadPixels(hCamera, hParent)
|
|
2008
|
+
SetLastError(err_code)
|
|
2009
|
+
return err_code
|
|
2010
|
+
|
|
2011
|
+
def CameraReadDeadPixels(hCamera):
|
|
2012
|
+
pNumPixel = c_int()
|
|
2013
|
+
err_code = _sdk.CameraReadDeadPixels(hCamera, None, None, byref(pNumPixel))
|
|
2014
|
+
SetLastError(err_code)
|
|
2015
|
+
if pNumPixel.value < 1:
|
|
2016
|
+
return None
|
|
2017
|
+
UShortArray = c_ushort * pNumPixel.value
|
|
2018
|
+
pRows = UShortArray()
|
|
2019
|
+
pCols = UShortArray()
|
|
2020
|
+
err_code = _sdk.CameraReadDeadPixels(hCamera, pRows, pCols, byref(pNumPixel))
|
|
2021
|
+
SetLastError(err_code)
|
|
2022
|
+
if err_code == 0:
|
|
2023
|
+
pNumPixel = pNumPixel.value
|
|
2024
|
+
else:
|
|
2025
|
+
pNumPixel = 0
|
|
2026
|
+
return (pRows[:pNumPixel], pCols[:pNumPixel])
|
|
2027
|
+
|
|
2028
|
+
def CameraAddDeadPixels(hCamera, pRows, pCols, NumPixel):
|
|
2029
|
+
UShortArray = c_ushort * NumPixel
|
|
2030
|
+
pRowsNative = UShortArray(*pRows)
|
|
2031
|
+
pColsNative = UShortArray(*pCols)
|
|
2032
|
+
err_code = _sdk.CameraAddDeadPixels(hCamera, pRowsNative, pColsNative, NumPixel)
|
|
2033
|
+
SetLastError(err_code)
|
|
2034
|
+
return err_code
|
|
2035
|
+
|
|
2036
|
+
def CameraRemoveDeadPixels(hCamera, pRows, pCols, NumPixel):
|
|
2037
|
+
UShortArray = c_ushort * NumPixel
|
|
2038
|
+
pRowsNative = UShortArray(*pRows)
|
|
2039
|
+
pColsNative = UShortArray(*pCols)
|
|
2040
|
+
err_code = _sdk.CameraRemoveDeadPixels(hCamera, pRowsNative, pColsNative, NumPixel)
|
|
2041
|
+
SetLastError(err_code)
|
|
2042
|
+
return err_code
|
|
2043
|
+
|
|
2044
|
+
def CameraRemoveAllDeadPixels(hCamera):
|
|
2045
|
+
err_code = _sdk.CameraRemoveAllDeadPixels(hCamera)
|
|
2046
|
+
SetLastError(err_code)
|
|
2047
|
+
return err_code
|
|
2048
|
+
|
|
2049
|
+
def CameraSaveDeadPixels(hCamera):
|
|
2050
|
+
err_code = _sdk.CameraSaveDeadPixels(hCamera)
|
|
2051
|
+
SetLastError(err_code)
|
|
2052
|
+
return err_code
|
|
2053
|
+
|
|
2054
|
+
def CameraSaveDeadPixelsToFile(hCamera, sFileName):
|
|
2055
|
+
err_code = _sdk.CameraSaveDeadPixelsToFile(hCamera, _str_to_string_buffer(sFileName))
|
|
2056
|
+
SetLastError(err_code)
|
|
2057
|
+
return err_code
|
|
2058
|
+
|
|
2059
|
+
def CameraLoadDeadPixelsFromFile(hCamera, sFileName):
|
|
2060
|
+
err_code = _sdk.CameraLoadDeadPixelsFromFile(hCamera, _str_to_string_buffer(sFileName))
|
|
2061
|
+
SetLastError(err_code)
|
|
2062
|
+
return err_code
|
|
2063
|
+
|
|
2064
|
+
def CameraGetImageBufferPriority(hCamera, wTimes, Priority):
|
|
2065
|
+
pFrameInfo = tSdkFrameHead()
|
|
2066
|
+
pbyBuffer = c_void_p()
|
|
2067
|
+
err_code = _sdk.CameraGetImageBufferPriority(hCamera, byref(pFrameInfo), byref(pbyBuffer), wTimes, Priority)
|
|
2068
|
+
SetLastError(err_code)
|
|
2069
|
+
if err_code != 0:
|
|
2070
|
+
raise CameraException(err_code)
|
|
2071
|
+
return (pbyBuffer.value, pFrameInfo)
|
|
2072
|
+
|
|
2073
|
+
def CameraGetImageBufferPriorityEx(hCamera, wTimes, Priority):
|
|
2074
|
+
_sdk.CameraGetImageBufferPriorityEx.restype = c_void_p
|
|
2075
|
+
piWidth = c_int()
|
|
2076
|
+
piHeight = c_int()
|
|
2077
|
+
pFrameBuffer = _sdk.CameraGetImageBufferPriorityEx(hCamera, byref(piWidth), byref(piHeight), wTimes, Priority)
|
|
2078
|
+
err_code = CAMERA_STATUS_SUCCESS if pFrameBuffer else CAMERA_STATUS_TIME_OUT
|
|
2079
|
+
SetLastError(err_code)
|
|
2080
|
+
if pFrameBuffer:
|
|
2081
|
+
return (pFrameBuffer, piWidth.value, piHeight.value)
|
|
2082
|
+
else:
|
|
2083
|
+
raise CameraException(err_code)
|
|
2084
|
+
|
|
2085
|
+
def CameraGetImageBufferPriorityEx2(hCamera, pImageData, uOutFormat, wTimes, Priority):
|
|
2086
|
+
piWidth = c_int()
|
|
2087
|
+
piHeight = c_int()
|
|
2088
|
+
err_code = _sdk.CameraGetImageBufferPriorityEx2(hCamera, c_void_p(pImageData), uOutFormat, byref(piWidth), byref(piHeight), wTimes, Priority)
|
|
2089
|
+
SetLastError(err_code)
|
|
2090
|
+
if err_code != 0:
|
|
2091
|
+
raise CameraException(err_code)
|
|
2092
|
+
return (piWidth.value, piHeight.value)
|
|
2093
|
+
|
|
2094
|
+
def CameraGetImageBufferPriorityEx3(hCamera, pImageData, uOutFormat, wTimes, Priority):
|
|
2095
|
+
piWidth = c_int()
|
|
2096
|
+
piHeight = c_int()
|
|
2097
|
+
puTimeStamp = c_uint()
|
|
2098
|
+
err_code = _sdk.CameraGetImageBufferPriorityEx3(hCamera, c_void_p(pImageData), uOutFormat, byref(piWidth), byref(piHeight), byref(puTimeStamp), wTimes, Priority)
|
|
2099
|
+
SetLastError(err_code)
|
|
2100
|
+
if err_code != 0:
|
|
2101
|
+
raise CameraException(err_code)
|
|
2102
|
+
return (piWidth.value, piHeight.value, puTimeStamp.value)
|
|
2103
|
+
|
|
2104
|
+
def CameraClearBuffer(hCamera):
|
|
2105
|
+
err_code = _sdk.CameraClearBuffer(hCamera)
|
|
2106
|
+
SetLastError(err_code)
|
|
2107
|
+
return err_code
|
|
2108
|
+
|
|
2109
|
+
def CameraSoftTriggerEx(hCamera, uFlags):
|
|
2110
|
+
err_code = _sdk.CameraSoftTriggerEx(hCamera, uFlags)
|
|
2111
|
+
SetLastError(err_code)
|
|
2112
|
+
return err_code
|
|
2113
|
+
|
|
2114
|
+
def CameraSetHDR(hCamera, value):
|
|
2115
|
+
err_code = _sdk.CameraSetHDR(hCamera, value)
|
|
2116
|
+
SetLastError(err_code)
|
|
2117
|
+
return err_code
|
|
2118
|
+
|
|
2119
|
+
def CameraGetHDR(hCamera):
|
|
2120
|
+
value = c_int()
|
|
2121
|
+
err_code = _sdk.CameraGetHDR(hCamera, byref(value))
|
|
2122
|
+
SetLastError(err_code)
|
|
2123
|
+
return value.value
|
|
2124
|
+
|
|
2125
|
+
def CameraGetFrameID(hCamera):
|
|
2126
|
+
FrameID = c_uint()
|
|
2127
|
+
err_code = _sdk.CameraGetFrameID(hCamera, byref(FrameID))
|
|
2128
|
+
SetLastError(err_code)
|
|
2129
|
+
return FrameID.value
|
|
2130
|
+
|
|
2131
|
+
def CameraGetFrameTimeStamp(hCamera):
|
|
2132
|
+
TimeStamp = c_uint64()
|
|
2133
|
+
TimeStampL = c_uint32.from_buffer(TimeStamp)
|
|
2134
|
+
TimeStampH = c_uint32.from_buffer(TimeStamp, 4)
|
|
2135
|
+
err_code = _sdk.CameraGetFrameTimeStamp(hCamera, byref(TimeStampL), byref(TimeStampH))
|
|
2136
|
+
SetLastError(err_code)
|
|
2137
|
+
return TimeStamp.value
|
|
2138
|
+
|
|
2139
|
+
def CameraSetHDRGainMode(hCamera, value):
|
|
2140
|
+
err_code = _sdk.CameraSetHDRGainMode(hCamera, value)
|
|
2141
|
+
SetLastError(err_code)
|
|
2142
|
+
return err_code
|
|
2143
|
+
|
|
2144
|
+
def CameraGetHDRGainMode(hCamera):
|
|
2145
|
+
value = c_int()
|
|
2146
|
+
err_code = _sdk.CameraGetHDRGainMode(hCamera, byref(value))
|
|
2147
|
+
SetLastError(err_code)
|
|
2148
|
+
return value.value
|
|
2149
|
+
|
|
2150
|
+
def CameraCreateDIBitmap(hDC, pFrameBuffer, pFrameHead):
|
|
2151
|
+
outBitmap = c_void_p()
|
|
2152
|
+
err_code = _sdk.CameraCreateDIBitmap(hDC, c_void_p(pFrameBuffer), byref(pFrameHead), byref(outBitmap))
|
|
2153
|
+
SetLastError(err_code)
|
|
2154
|
+
return outBitmap.value
|
|
2155
|
+
|
|
2156
|
+
def CameraDrawFrameBuffer(pFrameBuffer, pFrameHead, hWnd, Algorithm, Mode):
|
|
2157
|
+
err_code = _sdk.CameraDrawFrameBuffer(c_void_p(pFrameBuffer), byref(pFrameHead), c_void_p(hWnd), Algorithm, Mode)
|
|
2158
|
+
SetLastError(err_code)
|
|
2159
|
+
return err_code
|
|
2160
|
+
|
|
2161
|
+
def CameraFlipFrameBuffer(pFrameBuffer, pFrameHead, Flags):
|
|
2162
|
+
err_code = _sdk.CameraFlipFrameBuffer(c_void_p(pFrameBuffer), byref(pFrameHead), Flags)
|
|
2163
|
+
SetLastError(err_code)
|
|
2164
|
+
return err_code
|
|
2165
|
+
|
|
2166
|
+
def CameraConvertFrameBufferFormat(hCamera, pInFrameBuffer, pOutFrameBuffer, outWidth, outHeight, outMediaType, pFrameHead):
|
|
2167
|
+
err_code = _sdk.CameraConvertFrameBufferFormat(hCamera, c_void_p(pInFrameBuffer), c_void_p(pOutFrameBuffer), outWidth, outHeight, outMediaType, byref(pFrameHead))
|
|
2168
|
+
SetLastError(err_code)
|
|
2169
|
+
return err_code
|
|
2170
|
+
|
|
2171
|
+
def CameraSetConnectionStatusCallback(hCamera, pCallBack, pContext = 0):
|
|
2172
|
+
err_code = _sdk.CameraSetConnectionStatusCallback(hCamera, pCallBack, c_void_p(pContext) )
|
|
2173
|
+
SetLastError(err_code)
|
|
2174
|
+
return err_code
|
|
2175
|
+
|
|
2176
|
+
def CameraSetLightingControllerMode(hCamera, index, mode):
|
|
2177
|
+
err_code = _sdk.CameraSetLightingControllerMode(hCamera, index, mode)
|
|
2178
|
+
SetLastError(err_code)
|
|
2179
|
+
return err_code
|
|
2180
|
+
|
|
2181
|
+
def CameraSetLightingControllerState(hCamera, index, state):
|
|
2182
|
+
err_code = _sdk.CameraSetLightingControllerState(hCamera, index, state)
|
|
2183
|
+
SetLastError(err_code)
|
|
2184
|
+
return err_code
|
|
2185
|
+
|
|
2186
|
+
def CameraSetFrameResendCount(hCamera, count):
|
|
2187
|
+
err_code = _sdk.CameraSetFrameResendCount(hCamera, count)
|
|
2188
|
+
SetLastError(err_code)
|
|
2189
|
+
return err_code
|
|
2190
|
+
|
|
2191
|
+
def CameraSetUndistortParams(hCamera, width, height, cameraMatrix, distCoeffs):
|
|
2192
|
+
assert(len(cameraMatrix) == 4)
|
|
2193
|
+
assert(len(distCoeffs) == 5)
|
|
2194
|
+
cameraMatrixNative = (c_double * len(cameraMatrix))(*cameraMatrix)
|
|
2195
|
+
distCoeffsNative = (c_double * len(distCoeffs))(*distCoeffs)
|
|
2196
|
+
err_code = _sdk.CameraSetUndistortParams(hCamera, width, height, cameraMatrixNative, distCoeffsNative)
|
|
2197
|
+
SetLastError(err_code)
|
|
2198
|
+
return err_code
|
|
2199
|
+
|
|
2200
|
+
def CameraGetUndistortParams(hCamera):
|
|
2201
|
+
width = c_int()
|
|
2202
|
+
height = c_int()
|
|
2203
|
+
cameraMatrix = (c_double * 4)()
|
|
2204
|
+
distCoeffs = (c_double * 5)()
|
|
2205
|
+
err_code = _sdk.CameraGetUndistortParams(hCamera, byref(width), byref(height), cameraMatrix, distCoeffs)
|
|
2206
|
+
SetLastError(err_code)
|
|
2207
|
+
width, height = width.value, height.value
|
|
2208
|
+
cameraMatrix = cameraMatrix[:]
|
|
2209
|
+
distCoeffs = distCoeffs[:]
|
|
2210
|
+
return (width, height, cameraMatrix, distCoeffs)
|
|
2211
|
+
|
|
2212
|
+
def CameraSetUndistortEnable(hCamera, bEnable):
|
|
2213
|
+
err_code = _sdk.CameraSetUndistortEnable(hCamera, bEnable)
|
|
2214
|
+
SetLastError(err_code)
|
|
2215
|
+
return err_code
|
|
2216
|
+
|
|
2217
|
+
def CameraGetUndistortEnable(hCamera):
|
|
2218
|
+
value = c_int()
|
|
2219
|
+
err_code = _sdk.CameraGetUndistortEnable(hCamera, byref(value))
|
|
2220
|
+
SetLastError(err_code)
|
|
2221
|
+
return value.value
|
|
2222
|
+
|
|
2223
|
+
def CameraCustomizeUndistort(hCamera, hParent):
|
|
2224
|
+
err_code = _sdk.CameraCustomizeUndistort(hCamera, hParent)
|
|
2225
|
+
SetLastError(err_code)
|
|
2226
|
+
return err_code
|
|
2227
|
+
|
|
2228
|
+
def CameraGetEyeCount(hCamera):
|
|
2229
|
+
EyeCount = c_int()
|
|
2230
|
+
err_code = _sdk.CameraGetEyeCount(hCamera, byref(EyeCount))
|
|
2231
|
+
SetLastError(err_code)
|
|
2232
|
+
return EyeCount.value
|
|
2233
|
+
|
|
2234
|
+
def CameraMultiEyeImageProcess(hCamera, iEyeIndex, pbyIn, pInFrInfo, pbyOut, pOutFrInfo, uOutFormat, uReserved):
|
|
2235
|
+
err_code = _sdk.CameraMultiEyeImageProcess(hCamera, iEyeIndex, c_void_p(pbyIn), byref(pInFrInfo), c_void_p(pbyOut), byref(pOutFrInfo), uOutFormat, uReserved)
|
|
2236
|
+
SetLastError(err_code)
|
|
2237
|
+
return err_code
|
|
2238
|
+
|
|
2239
|
+
# CameraGrabber
|
|
2240
|
+
|
|
2241
|
+
def CameraGrabber_CreateFromDevicePage():
|
|
2242
|
+
Grabber = c_void_p()
|
|
2243
|
+
err_code = _sdk.CameraGrabber_CreateFromDevicePage(byref(Grabber))
|
|
2244
|
+
SetLastError(err_code)
|
|
2245
|
+
if err_code != 0:
|
|
2246
|
+
raise CameraException(err_code)
|
|
2247
|
+
return Grabber.value
|
|
2248
|
+
|
|
2249
|
+
def CameraGrabber_CreateByIndex(Index):
|
|
2250
|
+
Grabber = c_void_p()
|
|
2251
|
+
err_code = _sdk.CameraGrabber_CreateByIndex(byref(Grabber), Index)
|
|
2252
|
+
SetLastError(err_code)
|
|
2253
|
+
if err_code != 0:
|
|
2254
|
+
raise CameraException(err_code)
|
|
2255
|
+
return Grabber.value
|
|
2256
|
+
|
|
2257
|
+
def CameraGrabber_CreateByName(Name):
|
|
2258
|
+
Grabber = c_void_p()
|
|
2259
|
+
err_code = _sdk.CameraGrabber_CreateByName(byref(Grabber), _str_to_string_buffer(Name))
|
|
2260
|
+
SetLastError(err_code)
|
|
2261
|
+
if err_code != 0:
|
|
2262
|
+
raise CameraException(err_code)
|
|
2263
|
+
return Grabber.value
|
|
2264
|
+
|
|
2265
|
+
def CameraGrabber_Create(pDevInfo):
|
|
2266
|
+
Grabber = c_void_p()
|
|
2267
|
+
err_code = _sdk.CameraGrabber_Create(byref(Grabber), byref(pDevInfo))
|
|
2268
|
+
SetLastError(err_code)
|
|
2269
|
+
if err_code != 0:
|
|
2270
|
+
raise CameraException(err_code)
|
|
2271
|
+
return Grabber.value
|
|
2272
|
+
|
|
2273
|
+
def CameraGrabber_Destroy(Grabber):
|
|
2274
|
+
err_code = _sdk.CameraGrabber_Destroy(c_void_p(Grabber))
|
|
2275
|
+
SetLastError(err_code)
|
|
2276
|
+
return err_code
|
|
2277
|
+
|
|
2278
|
+
def CameraGrabber_SetHWnd(Grabber, hWnd):
|
|
2279
|
+
err_code = _sdk.CameraGrabber_SetHWnd(c_void_p(Grabber), c_void_p(hWnd) )
|
|
2280
|
+
SetLastError(err_code)
|
|
2281
|
+
return err_code
|
|
2282
|
+
|
|
2283
|
+
def CameraGrabber_SetPriority(Grabber, Priority):
|
|
2284
|
+
err_code = _sdk.CameraGrabber_SetPriority(c_void_p(Grabber), Priority)
|
|
2285
|
+
SetLastError(err_code)
|
|
2286
|
+
return err_code
|
|
2287
|
+
|
|
2288
|
+
def CameraGrabber_StartLive(Grabber):
|
|
2289
|
+
err_code = _sdk.CameraGrabber_StartLive(c_void_p(Grabber))
|
|
2290
|
+
SetLastError(err_code)
|
|
2291
|
+
return err_code
|
|
2292
|
+
|
|
2293
|
+
def CameraGrabber_StopLive(Grabber):
|
|
2294
|
+
err_code = _sdk.CameraGrabber_StopLive(c_void_p(Grabber))
|
|
2295
|
+
SetLastError(err_code)
|
|
2296
|
+
return err_code
|
|
2297
|
+
|
|
2298
|
+
def CameraGrabber_SaveImage(Grabber, TimeOut):
|
|
2299
|
+
Image = c_void_p()
|
|
2300
|
+
err_code = _sdk.CameraGrabber_SaveImage(c_void_p(Grabber), byref(Image), TimeOut)
|
|
2301
|
+
SetLastError(err_code)
|
|
2302
|
+
if err_code != 0:
|
|
2303
|
+
raise CameraException(err_code)
|
|
2304
|
+
return Image.value
|
|
2305
|
+
|
|
2306
|
+
def CameraGrabber_SaveImageAsync(Grabber):
|
|
2307
|
+
err_code = _sdk.CameraGrabber_SaveImageAsync(c_void_p(Grabber))
|
|
2308
|
+
SetLastError(err_code)
|
|
2309
|
+
return err_code
|
|
2310
|
+
|
|
2311
|
+
def CameraGrabber_SaveImageAsyncEx(Grabber, UserData):
|
|
2312
|
+
err_code = _sdk.CameraGrabber_SaveImageAsyncEx(c_void_p(Grabber), c_void_p(UserData))
|
|
2313
|
+
SetLastError(err_code)
|
|
2314
|
+
return err_code
|
|
2315
|
+
|
|
2316
|
+
def CameraGrabber_SetSaveImageCompleteCallback(Grabber, Callback, Context = 0):
|
|
2317
|
+
err_code = _sdk.CameraGrabber_SetSaveImageCompleteCallback(c_void_p(Grabber), Callback, c_void_p(Context))
|
|
2318
|
+
SetLastError(err_code)
|
|
2319
|
+
return err_code
|
|
2320
|
+
|
|
2321
|
+
def CameraGrabber_SetFrameListener(Grabber, Listener, Context = 0):
|
|
2322
|
+
err_code = _sdk.CameraGrabber_SetFrameListener(c_void_p(Grabber), Listener, c_void_p(Context))
|
|
2323
|
+
SetLastError(err_code)
|
|
2324
|
+
return err_code
|
|
2325
|
+
|
|
2326
|
+
def CameraGrabber_SetRawCallback(Grabber, Callback, Context = 0):
|
|
2327
|
+
err_code = _sdk.CameraGrabber_SetRawCallback(c_void_p(Grabber), Callback, c_void_p(Context))
|
|
2328
|
+
SetLastError(err_code)
|
|
2329
|
+
return err_code
|
|
2330
|
+
|
|
2331
|
+
def CameraGrabber_SetRGBCallback(Grabber, Callback, Context = 0):
|
|
2332
|
+
err_code = _sdk.CameraGrabber_SetRGBCallback(c_void_p(Grabber), Callback, c_void_p(Context))
|
|
2333
|
+
SetLastError(err_code)
|
|
2334
|
+
return err_code
|
|
2335
|
+
|
|
2336
|
+
def CameraGrabber_GetCameraHandle(Grabber):
|
|
2337
|
+
hCamera = c_int()
|
|
2338
|
+
err_code = _sdk.CameraGrabber_GetCameraHandle(c_void_p(Grabber), byref(hCamera))
|
|
2339
|
+
SetLastError(err_code)
|
|
2340
|
+
return hCamera.value
|
|
2341
|
+
|
|
2342
|
+
def CameraGrabber_GetStat(Grabber):
|
|
2343
|
+
stat = tSdkGrabberStat()
|
|
2344
|
+
err_code = _sdk.CameraGrabber_GetStat(c_void_p(Grabber), byref(stat))
|
|
2345
|
+
SetLastError(err_code)
|
|
2346
|
+
return stat
|
|
2347
|
+
|
|
2348
|
+
def CameraGrabber_GetCameraDevInfo(Grabber):
|
|
2349
|
+
DevInfo = tSdkCameraDevInfo()
|
|
2350
|
+
err_code = _sdk.CameraGrabber_GetCameraDevInfo(c_void_p(Grabber), byref(DevInfo))
|
|
2351
|
+
SetLastError(err_code)
|
|
2352
|
+
return DevInfo
|
|
2353
|
+
|
|
2354
|
+
# CameraImage
|
|
2355
|
+
|
|
2356
|
+
def CameraImage_Create(pFrameBuffer, pFrameHead, bCopy):
|
|
2357
|
+
Image = c_void_p()
|
|
2358
|
+
err_code = _sdk.CameraImage_Create(byref(Image), c_void_p(pFrameBuffer), byref(pFrameHead), bCopy)
|
|
2359
|
+
SetLastError(err_code)
|
|
2360
|
+
return Image.value
|
|
2361
|
+
|
|
2362
|
+
def CameraImage_CreateEmpty():
|
|
2363
|
+
Image = c_void_p()
|
|
2364
|
+
err_code = _sdk.CameraImage_CreateEmpty(byref(Image))
|
|
2365
|
+
SetLastError(err_code)
|
|
2366
|
+
return Image.value
|
|
2367
|
+
|
|
2368
|
+
def CameraImage_Destroy(Image):
|
|
2369
|
+
err_code = _sdk.CameraImage_Destroy(c_void_p(Image))
|
|
2370
|
+
SetLastError(err_code)
|
|
2371
|
+
return err_code
|
|
2372
|
+
|
|
2373
|
+
def CameraImage_GetData(Image):
|
|
2374
|
+
DataBuffer = c_void_p()
|
|
2375
|
+
HeadPtr = c_void_p()
|
|
2376
|
+
err_code = _sdk.CameraImage_GetData(c_void_p(Image), byref(DataBuffer), byref(HeadPtr))
|
|
2377
|
+
SetLastError(err_code)
|
|
2378
|
+
if err_code == 0:
|
|
2379
|
+
return (DataBuffer.value, tSdkFrameHead.from_address(HeadPtr.value) )
|
|
2380
|
+
else:
|
|
2381
|
+
return (0, None)
|
|
2382
|
+
|
|
2383
|
+
def CameraImage_GetUserData(Image):
|
|
2384
|
+
UserData = c_void_p()
|
|
2385
|
+
err_code = _sdk.CameraImage_GetUserData(c_void_p(Image), byref(UserData))
|
|
2386
|
+
SetLastError(err_code)
|
|
2387
|
+
return UserData.value
|
|
2388
|
+
|
|
2389
|
+
def CameraImage_SetUserData(Image, UserData):
|
|
2390
|
+
err_code = _sdk.CameraImage_SetUserData(c_void_p(Image), c_void_p(UserData))
|
|
2391
|
+
SetLastError(err_code)
|
|
2392
|
+
return err_code
|
|
2393
|
+
|
|
2394
|
+
def CameraImage_IsEmpty(Image):
|
|
2395
|
+
IsEmpty = c_int()
|
|
2396
|
+
err_code = _sdk.CameraImage_IsEmpty(c_void_p(Image), byref(IsEmpty))
|
|
2397
|
+
SetLastError(err_code)
|
|
2398
|
+
return IsEmpty.value
|
|
2399
|
+
|
|
2400
|
+
def CameraImage_Draw(Image, hWnd, Algorithm):
|
|
2401
|
+
err_code = _sdk.CameraImage_Draw(c_void_p(Image), c_void_p(hWnd), Algorithm)
|
|
2402
|
+
SetLastError(err_code)
|
|
2403
|
+
return err_code
|
|
2404
|
+
|
|
2405
|
+
def CameraImage_DrawFit(Image, hWnd, Algorithm):
|
|
2406
|
+
err_code = _sdk.CameraImage_DrawFit(c_void_p(Image), c_void_p(hWnd), Algorithm)
|
|
2407
|
+
SetLastError(err_code)
|
|
2408
|
+
return err_code
|
|
2409
|
+
|
|
2410
|
+
def CameraImage_DrawToDC(Image, hDC, Algorithm, xDst, yDst, cxDst, cyDst):
|
|
2411
|
+
err_code = _sdk.CameraImage_DrawToDC(c_void_p(Image), c_void_p(hDC), Algorithm, xDst, yDst, cxDst, cyDst)
|
|
2412
|
+
SetLastError(err_code)
|
|
2413
|
+
return err_code
|
|
2414
|
+
|
|
2415
|
+
def CameraImage_DrawToDCFit(Image, hDC, Algorithm, xDst, yDst, cxDst, cyDst):
|
|
2416
|
+
err_code = _sdk.CameraImage_DrawToDCFit(c_void_p(Image), c_void_p(hDC), Algorithm, xDst, yDst, cxDst, cyDst)
|
|
2417
|
+
SetLastError(err_code)
|
|
2418
|
+
return err_code
|
|
2419
|
+
|
|
2420
|
+
def CameraImage_BitBlt(Image, hWnd, xDst, yDst, cxDst, cyDst, xSrc, ySrc):
|
|
2421
|
+
err_code = _sdk.CameraImage_BitBlt(c_void_p(Image), c_void_p(hWnd), xDst, yDst, cxDst, cyDst, xSrc, ySrc)
|
|
2422
|
+
SetLastError(err_code)
|
|
2423
|
+
return err_code
|
|
2424
|
+
|
|
2425
|
+
def CameraImage_BitBltToDC(Image, hDC, xDst, yDst, cxDst, cyDst, xSrc, ySrc):
|
|
2426
|
+
err_code = _sdk.CameraImage_BitBltToDC(c_void_p(Image), c_void_p(hDC), xDst, yDst, cxDst, cyDst, xSrc, ySrc)
|
|
2427
|
+
SetLastError(err_code)
|
|
2428
|
+
return err_code
|
|
2429
|
+
|
|
2430
|
+
def CameraImage_SaveAsBmp(Image, FileName):
|
|
2431
|
+
err_code = _sdk.CameraImage_SaveAsBmp(c_void_p(Image), _str_to_string_buffer(FileName))
|
|
2432
|
+
SetLastError(err_code)
|
|
2433
|
+
return err_code
|
|
2434
|
+
|
|
2435
|
+
def CameraImage_SaveAsJpeg(Image, FileName, Quality):
|
|
2436
|
+
err_code = _sdk.CameraImage_SaveAsJpeg(c_void_p(Image), _str_to_string_buffer(FileName), Quality)
|
|
2437
|
+
SetLastError(err_code)
|
|
2438
|
+
return err_code
|
|
2439
|
+
|
|
2440
|
+
def CameraImage_SaveAsPng(Image, FileName):
|
|
2441
|
+
err_code = _sdk.CameraImage_SaveAsPng(c_void_p(Image), _str_to_string_buffer(FileName))
|
|
2442
|
+
SetLastError(err_code)
|
|
2443
|
+
return err_code
|
|
2444
|
+
|
|
2445
|
+
def CameraImage_SaveAsRaw(Image, FileName, Format):
|
|
2446
|
+
err_code = _sdk.CameraImage_SaveAsRaw(c_void_p(Image), _str_to_string_buffer(FileName), Format)
|
|
2447
|
+
SetLastError(err_code)
|
|
2448
|
+
return err_code
|
|
2449
|
+
|
|
2450
|
+
def CameraImage_IPicture(Image):
|
|
2451
|
+
NewPic = c_void_p()
|
|
2452
|
+
err_code = _sdk.CameraImage_IPicture(c_void_p(Image), byref(NewPic))
|
|
2453
|
+
SetLastError(err_code)
|
|
2454
|
+
return NewPic.value
|