return True elif event.type == pygame.MOUSEBUTTONDOWN: return True return False if __name__ == '__main__': pygame.display.set_mode((0, 0), pygame.FULLSCREEN) main_surface = pygame.display.get_surface() pygame.mouse.set_visible(False) display_lock = threading.Lock() camera_lock = threading.Lock() queue = queue.Queue(10) camera = shutter.Camera() print camera.wait_for_event() print camera.list_files() print camera.summary thread0 = CaptureThread(queue, camera, camera_lock) thread0.daemon = True thread0.start() thread1 = BlitThread(queue, main_surface, display_lock) thread1.daemon = True thread1.start() clock = pygame.time.Clock() flip = pygame.display.flip
def reset(self): with self._lock: self._camera = None self._camera = shutter.Camera()
def __init__(self, *args, **kwargs): self.capture_filename = 'capture.jpg' self.preview_filename = 'preview.jpg' self._camera = shutter.Camera(*args, **kwargs) self._lock = threading.Lock()
def reset(): c = shutter.Camera() c.capture_image()
return c def lookup_path(self, path): """ :type path: str :return: int """ path = path.encode('ascii') index = gp.gp_port_info_list_lookup_path(self._l, path) check(index) return index def get_info(self, path_index): info = PortInfo() check( gp.gp_port_info_list_get_info(self._l, path_index, PTR(info.pointer))) return info if __name__ == '__main__': import shutter import re c = shutter.Camera(re.compile('canon', re.I)) print(c.summary) print(c.about) print(c.abilities) c.capture_image()
def open_camera(self): release_from_tight_grip_of_operating_system() self._device_context = shutter.Camera(self._device_name_regex)