PreviewInterface

class scripts.train.PreviewInterface(use_preview: bool)

Bases: object

Run the preview window in a thread and interface with it

Parameters:

use_preview (bool) – True if pop-up preview window has been requested otherwise False

Attributes Summary

buffer

The thread save preview image object

should_quit

Check whether an exit request has been made.

should_refresh

Check whether the preview should be updated and return the value.

should_save

Check whether a save request has been made.

should_toggle_mask

Check whether the mask should be toggled and return the value.

Methods Summary

shutdown()

Send a signal to shutdown the preview window.

Attributes Documentation

buffer

The thread save preview image object

should_quit

Check whether an exit request has been made. True if an exit request has been made otherwise False.

Raises:

Error – Re-raises any error within the preview thread

should_refresh

Check whether the preview should be updated and return the value. If True is returned then resets the refresh trigger back to False

should_save

Check whether a save request has been made. If True is returned then save trigger is set back to False

should_toggle_mask

Check whether the mask should be toggled and return the value. If True is returned then resets mask toggle back to False

Methods Documentation

shutdown() None

Send a signal to shutdown the preview window.

Return type:

None

property buffer: PreviewBuffer

The thread save preview image object

property should_quit: bool

Check whether an exit request has been made. True if an exit request has been made otherwise False.

Raises:

Error – Re-raises any error within the preview thread

property should_refresh: bool

Check whether the preview should be updated and return the value. If True is returned then resets the refresh trigger back to False

property should_save: bool

Check whether a save request has been made. If True is returned then save trigger is set back to False

property should_toggle_mask: bool

Check whether the mask should be toggled and return the value. If True is returned then resets mask toggle back to False

shutdown() None

Send a signal to shutdown the preview window.

Return type:

None