TkGlobals

class tools.manual.globals.TkGlobals(input_location: str)

Bases: object

Holds Tkinter Variables and other frame information that need to be accessible from all areas of the GUI.

Parameters:

input_location (str) – The location of the input folder of frames or video file

Attributes Summary

current_frame

The currently displayed frame in the frame viewer with it's meta information.

face_index

The currently displayed face index when in zoomed mode.

frame_count

The total number of frames for the input location

frame_display_dims

The (width, height) of the video display frame in pixels.

frame_index

The currently displayed frame index.

is_video

True if the input is a video file, False if it is a folder of images.

is_zoomed

True if the frame viewer is zoomed into a face, False if the frame viewer is displaying a full frame.

var_faces_size

The variable holding the currently selected Faces Viewer thumbnail size.

var_filter_distance

The variable holding the currently selected threshold distance for misaligned filter mode.

var_filter_mode

The variable holding the currently selected navigation filter mode.

var_frame_index

The current absolute frame index of the currently displayed frame.

var_full_update

Flag to indicate that whole GUI should be refreshed

var_transport_index

The current index of the display frame's transport slider.

var_update_active_viewport

Boolean Variable that is traced by the viewport's active frame to update.

Methods Summary

set_current_frame(image, filename)

Set the frame and meta information for the currently displayed frame.

set_face_index(index)

Set the currently selected face index

set_frame_count(count)

Set the count of total number of frames to frame_count when the FramesLoader has completed loading.

set_frame_display_dims(width, height)

Set the size, in pixels, of the video frame display window and resize the displayed frame.

set_zoomed(state)

Set the current zoom state

Attributes Documentation

current_frame

The currently displayed frame in the frame viewer with it’s meta information.

Type:

CurrentFrame

face_index

The currently displayed face index when in zoomed mode.

Type:

int

frame_count

The total number of frames for the input location

Type:

int

frame_display_dims

The (width, height) of the video display frame in pixels.

Type:

tuple

frame_index

The currently displayed frame index. NB This returns -1 if there are no frames that meet the currently selected filter criteria.

Type:

int

is_video

True if the input is a video file, False if it is a folder of images.

Type:

bool

is_zoomed

True if the frame viewer is zoomed into a face, False if the frame viewer is displaying a full frame.

Type:

bool

var_faces_size

The variable holding the currently selected Faces Viewer thumbnail size.

Type:

tkinter..IntVar

var_filter_distance

The variable holding the currently selected threshold distance for misaligned filter mode.

Type:

tkinter.IntVar

var_filter_mode

The variable holding the currently selected navigation filter mode.

Type:

tkinter.StringVar

var_frame_index

The current absolute frame index of the currently displayed frame.

Type:

tkinter.IntVar

var_full_update

Flag to indicate that whole GUI should be refreshed

Type:

tkinter.BooleanVar

var_transport_index

The current index of the display frame’s transport slider.

Type:

tkinter.IntVar

var_update_active_viewport

Boolean Variable that is traced by the viewport’s active frame to update.

Type:

tkinter.BooleanVar

Methods Documentation

set_current_frame(image: ndarray, filename: str) None

Set the frame and meta information for the currently displayed frame. Populates the attribute current_frame

Parameters:
  • image (numpy.ndarray) – The image used to display in the Frame Viewer

  • filename (str) – The filename of the current frame

Return type:

None

set_face_index(index: int) None

Set the currently selected face index

Parameters:

index (int) – The currently selected face index

Return type:

None

set_frame_count(count: int) None

Set the count of total number of frames to frame_count when the FramesLoader has completed loading.

Parameters:

count (int) – The number of frames that exist for this session

Return type:

None

set_frame_display_dims(width: int, height: int) None

Set the size, in pixels, of the video frame display window and resize the displayed frame.

Used on a frame resize callback, sets the :attr:frame_display_dims`.

Parameters:
  • width (int) – The width of the frame holding the video canvas in pixels

  • height (int) – The height of the frame holding the video canvas in pixels

Return type:

None

set_zoomed(state: bool) None

Set the current zoom state

Parameters:

state (bool) – True for zoomed False for full frame

Return type:

None

property current_frame: CurrentFrame

The currently displayed frame in the frame viewer with it’s meta information.

Type:

CurrentFrame

property face_index: int

The currently displayed face index when in zoomed mode.

Type:

int

property frame_count: int

The total number of frames for the input location

Type:

int

property frame_display_dims: tuple[int, int]

The (width, height) of the video display frame in pixels.

Type:

tuple

property frame_index: int

The currently displayed frame index. NB This returns -1 if there are no frames that meet the currently selected filter criteria.

Type:

int

property is_video: bool

True if the input is a video file, False if it is a folder of images.

Type:

bool

property is_zoomed: bool

True if the frame viewer is zoomed into a face, False if the frame viewer is displaying a full frame.

Type:

bool

set_current_frame(image: ndarray, filename: str) None

Set the frame and meta information for the currently displayed frame. Populates the attribute current_frame

Parameters:
  • image (numpy.ndarray) – The image used to display in the Frame Viewer

  • filename (str) – The filename of the current frame

Return type:

None

set_face_index(index: int) None

Set the currently selected face index

Parameters:

index (int) – The currently selected face index

Return type:

None

set_frame_count(count: int) None

Set the count of total number of frames to frame_count when the FramesLoader has completed loading.

Parameters:

count (int) – The number of frames that exist for this session

Return type:

None

set_frame_display_dims(width: int, height: int) None

Set the size, in pixels, of the video frame display window and resize the displayed frame.

Used on a frame resize callback, sets the :attr:frame_display_dims`.

Parameters:
  • width (int) – The width of the frame holding the video canvas in pixels

  • height (int) – The height of the frame holding the video canvas in pixels

Return type:

None

set_zoomed(state: bool) None

Set the current zoom state

Parameters:

state (bool) – True for zoomed False for full frame

Return type:

None

property var_faces_size: StringVar

The variable holding the currently selected Faces Viewer thumbnail size.

Type:

tkinter..IntVar

property var_filter_distance: IntVar

The variable holding the currently selected threshold distance for misaligned filter mode.

Type:

tkinter.IntVar

property var_filter_mode: StringVar

The variable holding the currently selected navigation filter mode.

Type:

tkinter.StringVar

property var_frame_index: IntVar

The current absolute frame index of the currently displayed frame.

Type:

tkinter.IntVar

property var_full_update: BooleanVar

Flag to indicate that whole GUI should be refreshed

Type:

tkinter.BooleanVar

property var_transport_index: IntVar

The current index of the display frame’s transport slider.

Type:

tkinter.IntVar

property var_update_active_viewport: BooleanVar

Boolean Variable that is traced by the viewport’s active frame to update.

Type:

tkinter.BooleanVar