Пример #1
0
 def __init__(self, uri, mode = None):
     self._orig_uri = uri
     self.uri = uri
     self._mode = mode
     HandleObject.__init__(self, None)
     self._reopen()
     _registered_devices.add(self)
Пример #2
0
 def __init__(self, uri, mode=None):
     self._orig_uri = uri
     self.uri = uri
     self._mode = mode
     HandleObject.__init__(self, None)
     self._reopen()
     _registered_devices.add(self)
Пример #3
0
 def __init__(self, hand_tracker):
     self.hand_tracker = hand_tracker
     self._callbacks = c_api.NiteHandTrackerCallbacks(
         readyForNextFrame=c_api.OniGeneralCallback(self._on_ready_for_next_frame))
     handle = ctypes.pointer(self._callbacks)
     c_api.niteRegisterHandTrackerCallbacks(self.hand_tracker._handle, handle, None)
     HandleObject.__init__(self, handle)
     _registered_hand_tracker_listeners.add(self)
Пример #4
0
 def __init__(self, hand_tracker_handle, pframe):
     self._hand_tracker_handle = hand_tracker_handle
     self._frame = pframe[0]
     c_api.niteHandTrackerFrameAddRef(hand_tracker_handle, pframe)
     HandleObject.__init__(self, pframe)
     self._depth_frame = None
     self._hands = None
     self._gestures = None
     _registered_hand_tracker_frames.add(self)
Пример #5
0
 def __init__(self, hand_tracker_handle, pframe):
     self._hand_tracker_handle = hand_tracker_handle
     self._frame = pframe[0]
     c_api.niteHandTrackerFrameAddRef(hand_tracker_handle, pframe)
     HandleObject.__init__(self, pframe)
     self._depth_frame = None
     self._hands = None
     self._gestures = None
     _registered_hand_tracker_frames.add(self)
Пример #6
0
 def __init__(self, hand_tracker):
     self.hand_tracker = hand_tracker
     self._callbacks = c_api.NiteHandTrackerCallbacks(
         readyForNextFrame=c_api.OniGeneralCallback(
             self._on_ready_for_next_frame))
     handle = ctypes.pointer(self._callbacks)
     c_api.niteRegisterHandTrackerCallbacks(self.hand_tracker._handle,
                                            handle, None)
     HandleObject.__init__(self, handle)
     _registered_hand_tracker_listeners.add(self)
Пример #7
0
 def __init__(self, device):
     handle = c_api.NiteUserTrackerHandle()
     if not device:
         c_api.niteInitializeUserTracker(ctypes.byref(handle))
     else:
         self._devstruct = _NiteDevStruct()
         self._devstruct.device = device._handle
         c_api.niteInitializeUserTrackerByDevice(ctypes.byref(self._devstruct), ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_user_trackers.add(self)
Пример #8
0
 def __init__(self, device):
     handle = c_api.NiteUserTrackerHandle()
     if not device:
         c_api.niteInitializeUserTracker(ctypes.byref(handle))
     else:
         self._devstruct = _NiteDevStruct()
         self._devstruct.device = device._handle
         c_api.niteInitializeUserTrackerByDevice(
             ctypes.byref(self._devstruct), ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_user_trackers.add(self)
Пример #9
0
 def __init__(self):
     handle = c_api.OniCallbackHandle()
     self._callbacks = c_api.OniDeviceCallbacks(
         deviceConnected = c_api.OniDeviceInfoCallback(self._on_connected),
         deviceDisconnected = c_api.OniDeviceInfoCallback(self._on_disconnected),
         deviceStateChanged = c_api.OniDeviceStateCallback(self._on_state_changed),
     )
     c_api.oniRegisterDeviceCallbacks(self._callbacks, None, ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_device_listeners.add(self)
     self._connected_uris = set()
     self._disconnected_uris = set()
Пример #10
0
 def __init__(self):
     handle = c_api.OniCallbackHandle()
     self._callbacks = c_api.OniDeviceCallbacks(
         deviceConnected = c_api.OniDeviceInfoCallback(self._on_connected),
         deviceDisconnected = c_api.OniDeviceInfoCallback(self._on_disconnected),
         deviceStateChanged = c_api.OniDeviceStateCallback(self._on_state_changed),
     )
     c_api.oniRegisterDeviceCallbacks(self._callbacks, None, ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_device_listeners.add(self)
     self._connected_uris = set()
     self._disconnected_uris = set()
Пример #11
0
 def __init__(self, pframe, user_tracker_handle):
     self._frame = pframe[0]
     self._user_tracker_handle = user_tracker_handle
     self._depth_frame = None
     c_api.niteUserTrackerFrameAddRef(user_tracker_handle, pframe)
     HandleObject.__init__(self, pframe)
     self.users = []
     self.users_by_id = {}
     for i in range(self.userCount):
         u = UserData(self.pUser[i])
         self.users.append(u)
         self.users_by_id[u.id] = u
     _registered_user_tracker_frames.add(self)
Пример #12
0
 def __init__(self, device, sensor_type):
     self.device = device
     self.sensor_type = sensor_type
     self._callbacks = {}
     handle = c_api.OniStreamHandle()
     c_api.oniDeviceCreateStream(self.device._handle, sensor_type, ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_video_streams.add(self)
     if (self.is_property_supported(c_api.ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE) and
             self.is_property_supported(c_api.ONI_STREAM_PROPERTY_AUTO_EXPOSURE)):
         self.camera = CameraSettings(self)
     else:
         self.camera = None
Пример #13
0
 def __init__(self, device, sensor_type):
     self.device = device
     self.sensor_type = sensor_type
     self._callbacks = {}
     handle = c_api.OniStreamHandle()
     c_api.oniDeviceCreateStream(self.device._handle, sensor_type, ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_video_streams.add(self)
     if (self.is_property_supported(c_api.ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE) and
             self.is_property_supported(c_api.ONI_STREAM_PROPERTY_AUTO_EXPOSURE)):
         self.camera = CameraSettings(self)
     else:
         self.camera = None
Пример #14
0
 def __init__(self, pframe, user_tracker_handle):
     self._frame = pframe[0]
     self._user_tracker_handle = user_tracker_handle
     self._depth_frame = None
     c_api.niteUserTrackerFrameAddRef(user_tracker_handle, pframe)
     HandleObject.__init__(self, pframe)
     self.users = []
     self.users_by_id = {}
     for i in range(self.userCount):
         u = UserData(self.pUser[i])
         self.users.append(u)
         self.users_by_id[u.id] = u
     _registered_user_tracker_frames.add(self)
Пример #15
0
    def __init__(self, device):
        handle = c_api.NiteUserTrackerHandle()
        if not device:
            c_api.niteInitializeUserTracker(ctypes.byref(handle))
        else:
            self._devstruct = _NiteDevStruct()
            self._devstruct.pPlaybackControl = None
            self._devstruct.device = device._handle
            self._devstruct.device_info = device.get_device_info()
            # self._devstruct.sensor_info = device.get_sensor_infos(sensor_type)
            self._devstruct.is_owner = True
            c_api.niteInitializeUserTrackerByDevice(ctypes.byref(self._devstruct), ctypes.byref(handle))

        HandleObject.__init__(self, handle)
        _registered_user_trackers.add(self)
Пример #16
0
    def __init__(self, device):
        handle = c_api.NiteUserTrackerHandle()
        if not device:
            c_api.niteInitializeUserTracker(ctypes.byref(handle))
        else:
            self._devstruct = _NiteDevStruct()
            self._devstruct.pPlaybackControl = None
            self._devstruct.device = device._handle
            self._devstruct.device_info = device.get_device_info()
            # self._devstruct.sensor_info = device.get_sensor_infos(sensor_type)
            self._devstruct.is_owner = True
            c_api.niteInitializeUserTrackerByDevice(
                ctypes.byref(self._devstruct), ctypes.byref(handle))

        HandleObject.__init__(self, handle)
        _registered_user_trackers.add(self)
Пример #17
0
 def __init__(self, filename):
     self.filename = filename
     handle = c_api.OniRecorderHandle()
     c_api.oniCreateRecorder(filename, ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_recorders.add(self)
Пример #18
0
 def __init__(self, pframe):
     self._frame = pframe[0]
     HandleObject.__init__(self, pframe)
     _registered_video_frames.add(self)
Пример #19
0
 def __init__(self, pframe):
     self._frame = pframe[0]
     HandleObject.__init__(self, pframe)
     _registered_video_frames.add(self)
Пример #20
0
 def __init__(self, filename):
     self.filename = filename
     handle = c_api.OniRecorderHandle()
     c_api.oniCreateRecorder(filename, ctypes.byref(handle))
     HandleObject.__init__(self, handle)
     _registered_recorders.add(self)