Ejemplo n.º 1
0
 def register_application_components(self, args, app: Application):
     display = TextDisplay()
     main_window_config = MainWindow.configurator().config_from_args(args)
     layout = MyKeyboardHandler.configurator().layout_from_args(args)
     keyboard = MyKeyboardHandler(layout)
     main = MainWindow([display], keyboard_handler=keyboard, config=main_window_config)
     app.register(main)
Ejemplo n.º 2
0
 def register_application_components(self, args, app: Application):
     source = VideoSource(VideoSource.configurator().config_from_args(args))
     displays = [OpenCvDisplay('flipped')]
     app.register(source)
     app.register(FlipFilter('source', 'flipped'))
     app.register(
         MainWindow(
             displays=displays,
             config=MainWindow.configurator().config_from_args(args)))
Ejemplo n.º 3
0
 def register_application_components(self, args, app: Application):
     displays = [
         OpenCvDebugDisplay(),
     ]
     main_window = MainWindow(
         displays, config=MainWindow.configurator().config_from_args(args))
     video_source = VideoSource(
         config=VideoSource.configurator().config_from_args(args))
     app.register(main_window, video_source)
Ejemplo n.º 4
0
 def register_application_components(self, args, app: Application):
     main_window_config = MainWindow.configurator().config_from_args(args)
     mouse_handler = EventBasedMouseHandler()
     displays = [
         OpenCvDebugDisplay(),
     ]
     main_window = MainWindow(displays,
                              config=main_window_config,
                              mouse_handler=mouse_handler)
     app.register(main_window)
Ejemplo n.º 5
0
 def register_application_components(self, args, app: Application):
     displays = [
         OpenCvDisplay('drawn_people'),
         OpenCvDebugDisplay(),
     ]
     main_window = MainWindow(
         displays, config=MainWindow.configurator().config_from_args(args))
     video_source = VideoSource(
         config=VideoSource.configurator().config_from_args(args))
     person_detect_filter = PersonDetectFilter('source', 'drawn_people')
     app.register(main_window, video_source, person_detect_filter)
Ejemplo n.º 6
0
 def register_application_components(self, args, app: Application):
     displays = [
         OpenCvDisplay('flipped'),
         OpenCvDebugDisplay(),
     ]
     main_window = MainWindow(
         displays, config=MainWindow.configurator().config_from_args(args))
     video_source = VideoSource(
         config=VideoSource.configurator().config_from_args(args))
     flip_filter = FlipFilter('source', 'flipped')
     app.register(main_window, video_source, flip_filter)
Ejemplo n.º 7
0
def test_simple_application(app, video_source):
    displays = [OpenCvDebugDisplay()]
    main_window = MainWindow(displays=displays)
    app.register(video_source, main_window)
    app.start()
    app.join(30)

    assert not app.is_alive()
    assert not app.has_error_occurred()
Ejemplo n.º 8
0
 def register_application_components(self, args, app: Application):
     source = VideoSource(VideoSource.configurator().config_from_args(args))
     displays = [
         OpenCvDisplay('terminator'),
         OpenCvDebugDisplay(),
     ]
     face_detector = FaceDetector()
     terminator_filter = TerminatorFilter()
     main_window_config = MainWindowConfigurator.config_from_args(args)
     main_window = MainWindow(displays, config=main_window_config)
     app.register(source, face_detector, terminator_filter, main_window)
Ejemplo n.º 9
0
 def register_application_components(self, args, app: Application):
     source = VideoSource(VideoSource.configurator().config_from_args(args))
     person_detector = PersonDetector()
     person_display = PersonDisplay()
     displays = [
         OpenCvDisplay('display'),
         OpenCvDebugDisplay(),
     ]
     mouse_handler = EventBasedMouseHandler()
     main_window_config = MainWindowConfigurator.config_from_args(args)
     main_window = MainWindow(displays,
                              mouse_handler=mouse_handler,
                              config=main_window_config)
     app.register(source, person_detector, person_display, main_window)
Ejemplo n.º 10
0
 def __init__(self):
     super().__init__()
     self.add_configurator(MainWindow.configurator())
     self.add_configurator(VideoSource.configurator())
Ejemplo n.º 11
0
 def __init__(self):
     super().__init__()
     self.add_configurator(MyKeyboardHandler.configurator())
     self.add_configurator(MainWindow.configurator())
     self.add_configurator(GameConfigurator())
Ejemplo n.º 12
0
 def register_application_components(self, args, app: Application):
     displays = [
         OpenCvDebugDisplay(),
     ]
     main_window = MainWindow(displays)
     app.register(main_window)