# To use the matplotlib's JET colormap
from matplotlib.cm import get_cmap

DEFAULT_WINDOW_SIZE_HW = (480, 640)
KEEP_ORIGINAL_ASPECT_RATIO = True
DEFAULT_WINDOW_NAME = 'Stream Visualization'

GENERAL_OVERLAY_CORNERS = ((0., 0.), (1., 0.), (1., 1.), (0., 1.))
DEFAULT_OVERLAY_CORNER = (0.0, 0.0)
OVERLAY_CORNER_PAD = 0.05

GENERAL_OVERLAY_FONT_SIZE = 0.5
DEFAULT_TEXT_COLOR = (0, 0, 0)
DEFAULT_BBOX_THICKNESS = 2
DEFAULT_BBOX_INFO_THICKNESS = 1
BBOX_INFO_FONT_SIZE = 0.3
BBOX_AGE_FONT_SIZE = 0.5
MIN_BBOX_ALPHA = 0.3

DEFAULT_SEGMENTATION_ALPHA = 0.25

# DISPLAYABLE_GENERAL_INFORMATION

DETECTIONS_PER_ELEMENT = 'detections_per_element'
CURRENT_TIME = 'current_time'
CURRENT_FPS = 'fps'
OLDER_ELEMENT_AGE = 'older_element_age'
YOUNGER_ELEMENT_AGE = 'younger_element_age'

DISPLAYABLE_GENERAL_INFORMATION = (CURRENT_TIME, CURRENT_FPS, OLDER_ELEMENT_AGE, YOUNGER_ELEMENT_AGE,  DETECTIONS_PER_ELEMENT)
DISPLAYABLE_INFORMATION_TEXTS = {
    DETECTIONS_PER_ELEMENT: 'Detections per Element',
    CURRENT_TIME: 'Scene Time',
    CURRENT_FPS: 'FPS',
    OLDER_ELEMENT_AGE: 'Older Element Age',
    YOUNGER_ELEMENT_AGE: 'Younger Element Age'
}
GENERAL_INFORMATION_DISPLAY_ORDER = {key : i for i, key in enumerate(DISPLAYABLE_GENERAL_INFORMATION)}

TIME_FORMAT = "%H:%M:%S"
ELEMENT_AGE_TIME_FORMAT = "%M:%S"
NO_ELEMENT_TEXT = " --- "
DEFAULT_INTERLINE_SPACE = 2

BBOXES_COLOR_MAP = get_cmap('gist_rainbow')
MAX_BBOX_COLORS = 16