def capture_image(self, wait_for_finger):
		"""FIXME: check that the dev supports imaging, or check -ENOTSUP"""
		if not self.dev:
			raise "Device not open"

		unconditional = 1
		if wait_for_finger == True:
			unconditional = 0

		(r, img) = pyf.pyfp_dev_img_capture(self.dev, unconditional)
		if r != 0:
			raise "image_capture failed. error: " + r
		return Image(img)
Example #2
0
    def capture_image(self, wait_for_finger):
        """
		Captures an image from the device. Return None if imaging isn't supported.
		wait_for_finger controls if the device should wait for a finger to be placed
		on the sensor before image capture.
		"""
        if not self.dev:
            raise "Device not open"

        if not self.supports_imaging():
            return None

        unconditional = 1
        if wait_for_finger == True:
            unconditional = 0

        (r, img) = pyf.pyfp_dev_img_capture(self.dev, unconditional)
        img = Image(img)
        if r != 0:
            raise "image_capture failed. error: %i" % r
        return img
Example #3
0
	def capture_image(self, wait_for_finger):
		"""
		Captures an image from the device. Return None if imaging isn't supported.
		wait_for_finger controls if the device should wait for a finger to be placed
		on the sensor before image capture.
		"""
		if not self.dev:
			raise "Device not open"

		if not self.supports_imaging():
			return None

		unconditional = 1
		if wait_for_finger == True:
			unconditional = 0

		(r, img) = pyf.pyfp_dev_img_capture(self.dev, unconditional)
		img = Image(img)
		if r != 0:
			raise "image_capture failed. error: %i" % r
		return img