displayarray.window

class SubscriberWindows(window_names: Iterable[str] = ('displayarray',), video_sources: Iterable[Union[str, int]] = (0,), callbacks: Optional[List[Callable[[numpy.ndarray], Any]]] = None)[source]

Windows that subscribe to updates to cameras, videos, and arrays.

add_callback(callback)[source]

Add a callback for this class to apply to videos.

add_source(name)[source]

Add another source for this class to display.

add_window(name)[source]

Add another window for this class to display sources with. The name will be the title.

block()[source]

Update the window continuously while blocking the outer program.

end()[source]

Close all threads. Should be used with non-blocking mode.

handle_keys(key_input: int)[source]

Capture key input for the escape function and passing to key control subscriber threads.

handle_mouse(event, x, y, flags, param)[source]

Capture mouse input for mouse control subscriber threads.

loop()[source]

Continually update window frame. OpenCV only allows this in the main thread.

update(arr: numpy.ndarray = None, id: str = None)[source]

Update window frames once. Optionally add a new input and input id.

update_window_frames()[source]

Update the windows with the newest data for all frames.

wait_for_init()[source]

Update window frames in a loop until they’re actually updated. Useful for waiting for cameras to init.