#!/usr/bin/env python
"""
In this file, all the colors for the different segmentations are set
HSV = ([0,360], [0,100], [0,100])
"""

use_real_outdoor = True

#############
# Simulator #
#############
HSV_SIM_WHITE = [0, 0, 74]
HSV_SIM_ORANGE = [36, 100, 74]
HSV_SIM_GREEN = [120, 100, 30]

HUE_MARGIN = 15
SAT_MARGIN = 15
VAL_MARGIN = 15

# White
HUE_LOW_WHITE = 0
HUE_HIGH_WHITE = 360

SAT_LOW_WHITE = 0
SAT_HIGH_WHITE = 15

VAL_LOW_WHITE = 30 
VAL_HIGH_WHITE = 100

# Orange
HUE_LOW_ORANGE = max(0, HSV_SIM_ORANGE[0] - HUE_MARGIN) 
HUE_HIGH_ORANGE = min(360, HSV_SIM_ORANGE[0] + HUE_MARGIN)

SAT_LOW_ORANGE = 85
SAT_HIGH_ORANGE = 100

VAL_LOW_ORANGE = 30
VAL_HIGH_ORANGE = 100

# Green
HUE_LOW_GREEN = max(0, HSV_SIM_GREEN[0] - HUE_MARGIN) 
HUE_HIGH_GREEN = min(360, HSV_SIM_GREEN[0] + HUE_MARGIN)

SAT_LOW_GREEN = 85 
SAT_HIGH_GREEN = 100

VAL_LOW_GREEN = 15
VAL_HIGH_GREEN = 60

##############
# Real drone #
##############

if use_real_outdoor:                # Outdoor limits
    # White
    REAL_HUE_LOW_WHITE = 0
    REAL_HUE_HIGH_WHITE = 360

    REAL_SAT_LOW_WHITE = 0
    REAL_SAT_HIGH_WHITE = 7

    REAL_VAL_LOW_WHITE = 98
    REAL_VAL_HIGH_WHITE = 100

    # Orange
    REAL_HUE_LOW_ORANGE = 10
    REAL_HUE_HIGH_ORANGE = 40

    REAL_SAT_LOW_ORANGE = 20
    REAL_SAT_HIGH_ORANGE = 70

    REAL_VAL_LOW_ORANGE = 90
    REAL_VAL_HIGH_ORANGE = 100

    # Green
    REAL_HUE_LOW_GREEN = 120
    REAL_HUE_HIGH_GREEN = 220

    REAL_SAT_LOW_GREEN = 0
    REAL_SAT_HIGH_GREEN = 50

    REAL_VAL_LOW_GREEN = 0
    REAL_VAL_HIGH_GREEN = 60


else:                               # Indoor limits
    # White
    REAL_HUE_LOW_WHITE = 0
    REAL_HUE_HIGH_WHITE = 360

    REAL_SAT_LOW_WHITE = 0
    REAL_SAT_HIGH_WHITE = 30

    REAL_VAL_LOW_WHITE = 85
    REAL_VAL_HIGH_WHITE = 100

    # Orange
    REAL_HUE_LOW_ORANGE = 10
    REAL_HUE_HIGH_ORANGE = 40

    REAL_SAT_LOW_ORANGE = 25
    REAL_SAT_HIGH_ORANGE = 100

    REAL_VAL_LOW_ORANGE = 60
    REAL_VAL_HIGH_ORANGE = 100

    # Green
    REAL_HUE_LOW_GREEN = 120
    REAL_HUE_HIGH_GREEN = 200

    REAL_SAT_LOW_GREEN = 60
    REAL_SAT_HIGH_GREEN = 100

    REAL_VAL_LOW_GREEN = 0
    REAL_VAL_HIGH_GREEN = 60




SIMULATOR_COLOR_LIMITS = [
    HUE_LOW_WHITE, HUE_HIGH_WHITE, SAT_LOW_WHITE, SAT_HIGH_WHITE, VAL_LOW_WHITE, VAL_HIGH_WHITE,
    HUE_LOW_ORANGE, HUE_HIGH_ORANGE, SAT_LOW_ORANGE, SAT_HIGH_ORANGE, VAL_LOW_ORANGE, VAL_HIGH_ORANGE,
    HUE_LOW_GREEN, HUE_HIGH_GREEN, SAT_LOW_GREEN, SAT_HIGH_GREEN, VAL_LOW_GREEN, VAL_HIGH_GREEN
]

REAL_COLOR_LIMITS = [
    REAL_HUE_LOW_WHITE, REAL_HUE_HIGH_WHITE, REAL_SAT_LOW_WHITE, REAL_SAT_HIGH_WHITE, REAL_VAL_LOW_WHITE, REAL_VAL_HIGH_WHITE, \
    REAL_HUE_LOW_ORANGE, REAL_HUE_HIGH_ORANGE, REAL_SAT_LOW_ORANGE, REAL_SAT_HIGH_ORANGE, REAL_VAL_LOW_ORANGE, REAL_VAL_HIGH_ORANGE, \
    REAL_HUE_LOW_GREEN, REAL_HUE_HIGH_GREEN, REAL_SAT_LOW_GREEN, REAL_SAT_HIGH_GREEN, REAL_VAL_LOW_GREEN, REAL_VAL_HIGH_GREEN
]

