def loop_over(self, images, handle_input=lambda key : None, delay=25): for image in images: self._show(image) keycode = lib.cvWaitKey(delay) nothing_was_pressed = keycode == -1 if nothing_was_pressed: continue handle_input(key=_keycode_to_key(keycode))
def loop_over(self, images, handle_input=lambda key: None, delay=25): for image in images: self._show(image) keycode = lib.cvWaitKey(delay) nothing_was_pressed = keycode == -1 if nothing_was_pressed: continue handle_input(key=_keycode_to_key(keycode))
def show_until_keypress(self, image, delay=None): self._show(image) keycode = lib.cvWaitKey(0) return _keycode_to_key(keycode)