# -*- coding: utf-8 -*-
"""
Copyright (C) 2019 Event-driven Perception for Robotics
Authors: Sim Bamford
        Massimiliano Iacono

This program is free software: you can redistribute it and/or modify it under 
the terms of the GNU General Public License as published by the Free Software 
Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.  See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with 
this program. If not, see <https://www.gnu.org/licenses/>.

Intended as part of bimvee (Batch Import, Manipulation, Visualisation and Export of Events etc)
Functionality for serving images which represent the data at a certain time
(or given a certain time window). 
The intended use case is to support video-like playback of data
There is a generic Visualiser class - it contains a dataType dict. 
This is subclassed for each supported dataType (e.g. dvs, frame, pose etc)
Each subclass should implement basic methods: get_dims, get_frame, get_colorfmt
Implementing set_data allows the visualiser to do some preparation for visualisation
when it receives new data.

In general get_frame takes two args: time, and time_window.
In general one could think about representing data in an interpolated way or not.
For example, with poses, imu etc, one could interpolate between samples, 
or one could simply choose the sample which is nearest in time.
Likewise for frames. 
The time_window parameter says how much data to take around the sample point for event-type data.
It might be possible to develop visualisations for other types of data that make use of the concept of a time window. 

colorfmt is a choice between luminance and rgb. 
If luminance, then the frame returned should have dim 2 = 3.
Nothing stops the calling function from applying a color mask to an output in luminance format.      
"""

import numpy as np

# Local imports

# Importing child classes lets this one module be referenced for all imports



try:
    from .visualisers.visualiserDvs import VisualiserDvs
    from .visualisers.visualiserFrame import VisualiserFrame
    from .visualisers.visualiserPoint3 import VisualiserPoint3
    from .visualisers.visualiserPose6q import VisualiserPose6q
    from .visualisers.visualiserBoundingBoxes import VisualiserBoundingBoxes
    from .visualisers.visualiserOpticFlow import VisualiserOpticFlow
    from .visualisers.visualiserImu import VisualiserImu
    from .visualisers.visualiserSkeleton import VisualiserSkeleton
except ImportError:
    from bimvee.visualisers.visualiserDvs import VisualiserDvs
    from bimvee.visualisers.visualiserFrame import VisualiserFrame
    from bimvee.visualisers.visualiserPoint3 import VisualiserPoint3
    from bimvee.visualisers.visualiserPose6q import VisualiserPose6q
    from bimvee.visualisers.visualiserBoundingBoxes import VisualiserBoundingBoxes
    from bimvee.visualisers.visualiserOpticFlow import VisualiserOpticFlow
    from bimvee.visualisers.visualiserImu import VisualiserImu
    from bimvee.visualisers.visualiserSkeleton import VisualiserSkeleton

