diff options
| author | morefigs <morefigs@gmail.com> | 2013-12-24 20:10:10 -0800 |
|---|---|---|
| committer | morefigs <morefigs@gmail.com> | 2013-12-24 20:10:10 -0800 |
| commit | 317bae243867397aa676ce822715bd18f9062efe (patch) | |
| tree | 5fe0bd76744be9fc2a41608e045bb7388ff3666e | |
| parent | f1a1b85c3ea2f5fc67b00b0994bb219f14deed52 (diff) | |
| download | pymba-317bae243867397aa676ce822715bd18f9062efe.tar.gz pymba-317bae243867397aa676ce822715bd18f9062efe.zip | |
Create vimbastructure.py
| -rw-r--r-- | vimbastructure.py | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/vimbastructure.py b/vimbastructure.py new file mode 100644 index 0000000..9384d6b --- /dev/null +++ b/vimbastructure.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +from ctypes import * + +class VimbaVersion(Structure): + _fields_ = [('major', c_uint32), + ('minor', c_uint32), + ('patch', c_uint32)] + + +# populated by calling VimbaDLL.cameraInfoQuery() +class VimbaCameraInfo(Structure): + _fields_ = [('cameraIdString', c_char_p), # Unique identifier for each camera + ('cameraName', c_char_p), # Name of the camera + ('modelName', c_char_p), # Model name + ('serialString', c_char_p), # Serial number + ('permittedAccess', c_uint32), # Used access mode, see VmbAccessModeType + ('interfaceIdString', c_char_p)] # Unique value for each interface or bus + + def getFieldNames(self): + """ + Get field names. + """ + return [field[0] for field in self._fields_] + + +# populated by calling VimbaDLL.featureInfoQuery() +class VimbaFeatureInfo(Structure): + + _fields_ = [('name', c_char_p), + ('featureDataType', c_uint32), + ('featureFlags', c_uint32), + ('category', c_char_p), + ('displayName', c_char_p), + ('pollingTime', c_uint32), + ('unit', c_char_p), + ('representation', c_char_p), + ('visibility', c_uint32), + ('tooltip', c_char_p), + ('description', c_char_p), + ('sfncNamespace', c_char_p), + ('isStreamable', c_bool), + ('hasAffectedFeatures', c_bool), + ('hasSelectedFeatures', c_bool)] + + def getFieldNames(self): + """ + Get field names. + """ + return [field[0] for field in self._fields_] + + +class VimbaFrame(Structure): + + # IN + _fields_ = [('buffer', c_void_p), # Comprises image and ancillary data + ('bufferSize', c_uint32), # Size of the data buffer + + ('context', c_void_p * 4), # User context filled during queuing + + # OUT + ('receiveStatus', c_int32), # Resulting status of the receive operation + ('receiveFlags', c_uint32), # Resulting flags of the receive operation + + ('imageSize', c_uint32), # Size of the image data inside the data buffer + ('ancillarySize', c_uint32), # Size of the ancillary data inside the data buffer + + ('pixelFormat', c_uint32), # Pixel format of the image + + ('width', c_uint32), # Width of an image + ('height', c_uint32), # Height of an image + ('offsetX', c_uint32), # Horizontal offset of an image + ('offsetY', c_uint32), # Vertical offset of an image + + ('frameID', c_uint64), # Unique ID of this frame in this stream + ('timestamp', c_uint64)] # Timestamp of the data transfer + + def getFieldNames(self): + """ + Get field names. + """ + return [field[0] for field in self._fields_] + + + + + |
