• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python vimbadll.VimbaDLL类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vimbadll.VimbaDLL的典型用法代码示例。如果您正苦于以下问题:Python VimbaDLL类的具体用法?Python VimbaDLL怎么用?Python VimbaDLL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了VimbaDLL类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: queueFrameCapture

    def queueFrameCapture(self, frameCallback = None):
        """
        Queue frames that may be filled during frame capturing.
        Runs VmbCaptureFrameQueue

        Call after announceFrame and startCapture

        Callback must accept argument of type frame. Remember to requeue the
        frame by calling frame.queueFrameCapture(frameCallback) at the end of
        your callback function.
        """
        # remember the given callback function
        self._frameCallback = frameCallback

        # define a callback wrapper here so it doesn't bind self
        def frameCallbackWrapper(p_frame):
            # call the user's callback with the self bound outside the wrapper
            # ignore the frame pointer since we already know the callback
            # refers to this frame
            self._frameCallback(self)

        if self._frameCallback is None:
            self._frameCallbackWrapper_C = None
        else:
            # keep a reference to prevent gc issues
            self._frameCallbackWrapper_C = \
                VimbaDLL.frameDoneCallback(frameCallbackWrapper)

        errorCode = VimbaDLL.captureFrameQueue(self._handle,
                                               byref(self._frame),
                                               self._frameCallbackWrapper_C)
        if errorCode != 0:
            raise VimbaException(errorCode)
开发者ID:draustin,项目名称:pymba,代码行数:33,代码来源:vimbaframe.py


示例2: _getCameraInfos

    def _getCameraInfos(self):
        """
        Gets camera info of all attached cameras.

        :returns: list -- camera info for available cameras.
        """
        # args
        dummyCameraInfo = structs.VimbaCameraInfo()
        numFound = c_uint32(-1)

        # call once just to get the number of cameras
        # Vimba DLL will return an error code
        errorCode = VimbaDLL.camerasList(byref(dummyCameraInfo),
                                         0,
                                         byref(numFound),
                                         sizeof(dummyCameraInfo))
        if errorCode != 0 and errorCode != -9:
            raise VimbaException(errorCode)

        numCameras = numFound.value

        # args
        cameraInfoArray = (structs.VimbaCameraInfo * numCameras)()

        # call again to get the features
        # Vimba DLL will return an error code
        errorCode = VimbaDLL.camerasList(cameraInfoArray,
                                         numCameras,
                                         byref(numFound),
                                         sizeof(dummyCameraInfo))
        if errorCode != 0:
            raise VimbaException(errorCode)
        return list(camInfo for camInfo in cameraInfoArray)
开发者ID:draustin,项目名称:pymba,代码行数:33,代码来源:vimba.py


示例3: startCapture

 def startCapture(self):
     """
     Prepare the API for incoming frames.
     """
     errorCode = VimbaDLL.captureStart(self._handle)
     if errorCode != 0:
         raise VimbaException(errorCode)
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:7,代码来源:vimbacamera.py


示例4: announceFrame

    def announceFrame(self):
        """
        Announce frames to the API that may be queued for frame capturing later.

        Runs VmbFrameAnnounce

        Should be called after the frame is created.  Call startCapture
        after this method.
        """
        # size of expected frame
        sizeOfFrame = self.payloadSize

        # keep this reference to keep block alive for life of frame
        self._cMem = VimbaC_MemoryBlock(sizeOfFrame)
        # set buffer to have length of expected payload size
        self._frame.buffer = self._cMem.block

        # set buffer size to expected payload size
        self._frame.bufferSize = sizeOfFrame

        errorCode = VimbaDLL.frameAnnounce(self._handle,
                                           byref(self._frame),
                                           sizeof(self._frame))

        if errorCode != 0:
            raise VimbaException(errorCode)
开发者ID:draustin,项目名称:pymba,代码行数:26,代码来源:vimbaframe.py


示例5: closeCamera

 def closeCamera(self):
     """
     Close the camera.
     """
     errorCode = VimbaDLL.cameraClose(self._handle)
     if errorCode != 0:
         raise VimbaException(errorCode)
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:7,代码来源:vimbacamera.py


示例6: readRegister

    def readRegister(self, address):
        # note that the underlying Vimba function allows reading of an array
        # of registers, but only one address/value at a time is implemented
        # here
        """
        Read from a register of the module (camera).

        :param address: the address of the register to read.

        :returns: int -- value of register.
        """
        readCount = 1

        # check address validity
        try:
            regAddress = c_uint64(int(address, 16))
        except:
            raise VimbaException(-52)

        regData = c_uint64()
        numCompleteReads = c_uint32()

        errorCode = VimbaDLL.registersRead(self.handle,
                                           readCount,
                                           byref(regAddress),
                                           byref(regData),
                                           byref(numCompleteReads))

        if errorCode != 0:
            raise VimbaException(errorCode)

        return regData.value
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:32,代码来源:vimbaobject.py


示例7: flushCaptureQueue

 def flushCaptureQueue(self):
     """
     Flush the capture queue.
     """
     errorCode = VimbaDLL.captureQueueFlush(self._handle)
     if errorCode != 0:
         raise VimbaException(errorCode)
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:7,代码来源:vimbacamera.py


示例8: closeInterface

	def closeInterface(self):
		"""
		Close the interface.
		"""
		errorCode = VimbaDLL.interfaceClose(self._handle)
		if errorCode != 0:
			raise VimbaException(errorCode)
开发者ID:jayich,项目名称:pymba,代码行数:7,代码来源:vimbainterface.py


示例9: writeRegister

    def writeRegister(self, address, value):
        # note that the underlying Vimba function allows writing of an array
        # of registers, but only one address/value at a time is implemented
        # here
        """
        Read from a register of the module (camera).

        :param address: the address of the register to read.
        :param value: the value to set in hex.
        """
        writeCount = 1

        # check address validity
        try:
            regAddress = c_uint64(int(address, 16))
        except:
            raise VimbaException(-52)

        # check value validity
        try:
            regData = c_uint64(int(value, 16))
        except:
            raise VimbaException(-52)

        numCompleteWrites = c_uint32()

        errorCode = VimbaDLL.registersWrite(self.handle,
                                            writeCount,
                                            byref(regAddress),
                                            byref(regData),
                                            byref(numCompleteWrites))
        if errorCode != 0:
            raise VimbaException(errorCode)
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:33,代码来源:vimbaobject.py


示例10: revokeAllFrames

 def revokeAllFrames(self):
     """
     Revoke all frames assigned to the camera.
     """
     errorCode = VimbaDLL.frameRevokeAll(self._handle)
     if errorCode != 0:
         raise VimbaException(errorCode)
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:7,代码来源:vimbacamera.py


示例11: endCapture

 def endCapture(self):
     """
     Stop the API from being able to receive frames.
     """
     errorCode = VimbaDLL.captureEnd(self._handle)
     if errorCode != 0:
         raise VimbaException(errorCode)
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:7,代码来源:vimbacamera.py


示例12: openInterface

	def openInterface(self):
		"""
		Open the interface.
		"""
		errorCode = VimbaDLL.interfaceOpen(self._interfaceIdString,
										   byref(self._handle))
		if errorCode != 0:
			raise VimbaException(errorCode)
开发者ID:jayich,项目名称:pymba,代码行数:8,代码来源:vimbainterface.py


示例13: startup

 def startup(self):
     """
     Initialize the VimbaC API.
     """
     # Vimba DLL will return an error code
     errorCode = VimbaDLL.startup()
     if errorCode != 0:
         raise VimbaException(errorCode)
开发者ID:DanielArnett,项目名称:vimba-mjpeg,代码行数:8,代码来源:vimba.py


示例14: revokeFrame

	def revokeFrame(self):
		"""
		Revoke a frame from the API.
		"""
		errorCode = VimbaDLL.frameRevoke(self._handle,
										 byref(self._frame))
		if errorCode != 0:
			raise VimbaException(errorCode)
开发者ID:sightmachine,项目名称:pymba,代码行数:8,代码来源:vimbaframe.py


示例15: waitFrameCapture

	def waitFrameCapture(self, timeout = 2000):
		"""
		Wait for a queued frame to be filled (or dequeued).
		"""
		errorCode = VimbaDLL.captureFrameWait(self._handle,
											  byref(self._frame),
											  timeout)
		if errorCode != 0:
			raise VimbaException(errorCode)	
开发者ID:sightmachine,项目名称:pymba,代码行数:9,代码来源:vimbaframe.py


示例16: queueFrameCapture

	def queueFrameCapture(self):
		"""
		Queue frames that may be filled during frame capturing.
		"""
		errorCode = VimbaDLL.captureFrameQueue(self._handle,
											   byref(self._frame),
											   None)	# callback not implemented, callback example in pico?
		if errorCode != 0:
			raise VimbaException(errorCode)
开发者ID:sightmachine,项目名称:pymba,代码行数:9,代码来源:vimbaframe.py


示例17: _setFloatFeature

    def _setFloatFeature(self, valueToSet):
        """
		Set the value of a float feature.
		
		:param valueToSet: the float value to set for the feature.
		"""

        errorCode = VimbaDLL.featureFloatSet(self._handle, self._name, valueToSet)
        if errorCode != 0:
            raise VimbaException(errorCode)
开发者ID:jayich,项目名称:pymba,代码行数:10,代码来源:vimbafeature.py


示例18: _setBoolFeature

    def _setBoolFeature(self, valueToSet):
        """
		Set the value of a bool feature.
		
		:param valueToSet: the bool value to set for the feature.
		"""

        errorCode = VimbaDLL.featureBoolSet(self._handle, self._name, valueToSet)
        if errorCode != 0:
            raise VimbaException(errorCode)
开发者ID:jayich,项目名称:pymba,代码行数:10,代码来源:vimbafeature.py


示例19: _setEnumFeature

    def _setEnumFeature(self, valueToSet):
        """
		Set the value of an enum feature.
		
		:param valueToSet: the enum value to set for the feature.
		"""

        errorCode = VimbaDLL.featureEnumSet(self._handle, self._name, valueToSet)
        if errorCode != 0:
            raise VimbaException(errorCode)
开发者ID:jayich,项目名称:pymba,代码行数:10,代码来源:vimbafeature.py


示例20: _setStringFeature

    def _setStringFeature(self, valueToSet):
        """
		Set the value of a string feature.
		
		:param valueToSet: the string value to set for the feature.
		"""

        errorCode = VimbaDLL.featureStringSet(self._handle, self._name, valueToSet)
        if errorCode != 0:
            raise VimbaException(errorCode)
开发者ID:jayich,项目名称:pymba,代码行数:10,代码来源:vimbafeature.py



注:本文中的vimbadll.VimbaDLL类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python vimcalc.parse函数代码示例发布时间:2022-05-26
下一篇:
Python vim.eval函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap