Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 1,685 Bytes
13170f7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | import ctypes
from ctypes_enum import CtypesEnum
from .CBasicStructs import *
CAMERA_PID_VID_SIZE = 8
CAMERA_NAME_SIZE = 64
class EveCompare(CtypesEnum):
EVE_EQUAL = 0
EVE_AT_MOST = 1
EVE_AT_LEAST = 2
class CCameraFormat(ctypes.Structure):
_fields_ = [
("resolution", CResolution),
("format", ctypes.c_int),
("fps", ctypes.c_float),
("compareResolution", ctypes.c_int),
("compareFps", ctypes.c_int),
]
class CCamera(ctypes.Structure):
_fields_ = [
("id", ctypes.c_int),
("pid", ctypes.c_byte * CAMERA_PID_VID_SIZE),
("vid", ctypes.c_byte * CAMERA_PID_VID_SIZE),
("name", ctypes.c_byte * CAMERA_NAME_SIZE),
("isHardwareCamera", ctypes.c_uint),
("isFpgaCamera", ctypes.c_uint),
("isIrCamera", ctypes.c_uint),
("screenLocationXinMM", ctypes.c_float),
("screenLocationYinMM", ctypes.c_float),
]
class CCameraParameters(ctypes.Structure):
_fields_ = [
("width", ctypes.c_int),
("height", ctypes.c_int),
("focalLength", ctypes.c_double),
("pixelSizeX", ctypes.c_double),
("pixelSizeY", ctypes.c_double),
("principalPointX", ctypes.c_double),
("principalPointY", ctypes.c_double),
("depthMin", ctypes.c_double),
("depthMax", ctypes.c_double),
("screenLocationXinMM", ctypes.c_float),
("screenLocationYinMM", ctypes.c_float),
("isInfrared", ctypes.c_uint),
]
class CMonitor(ctypes.Structure):
_fields_ = [
("rectangle", CRect2iWH),
("dpiRatio", ctypes.c_float),
("dpiX", ctypes.c_float),
("dpiY", ctypes.c_float),
("primary", ctypes.c_uint),
]
class CCameraLocation(ctypes.Structure):
_fields_ = [
("id", ctypes.c_int),
("screenLocationXinMM", ctypes.c_float),
("screenLocationYinMM", ctypes.c_float),
]
|