# Path: core/overlays/base.py
# class BaseOverlay(object):
# 
#     def  __init__(self):
# 
#         self.name = "OVERLAY"
#         self.nameP = colored(self.name,'cyan')
# 
#         # running flag
#         self.running = threading.Event()
# 
#         # Receive thread
#         self.recvThread = threading.Thread(target=self.receive)
# 
#     # receiver THREAD (dummy)
#     def receive(self):
#         while self.isRunning():
#             sleep(1000)
#         return
# 
#     # Stop
#     def start(self):
#         self.running.set()
#         self.recvThread.start()
#         return self
# 
#     # Stop
#     def quit(self):
#         self.isRunning(False)
#         self.recvThread.join()
#         print(self.nameP, "stopped")
# 
# 	# is Running
#     def isRunning(self, state=None):
#         if state is not None:
#             self.running.set() if state else self.running.clear()
#         return self.running.is_set()
# 
# Path: core/overlays/rpiopengles/rpiopengles.py
# EGL_DEFAULT_DISPLAY = 0
# EGL_NO_CONTEXT = 0
# EGL_NO_DISPLAY = 0
# EGL_NO_SURFACE = 0
# DISPMANX_PROTECTION_NONE = 0
# def eglints(L):
# def eglfloats(L):
# def check(e):
#     def __init__(self,depthbuffer=False):
#     def __init__(self):
#     def draw(self, red=0.0, green=0.0, blue=0.0, alpha=0.0):
#     def check(self):
# class EGL(object):
# class colortexture():


from termcolor import colored
from time import sleep
from .base import BaseOverlay
from .rpiopengles import rpiopengles
import copy
import queue
from __future__ import print_function

class RpifadeOverlay (BaseOverlay):

    queue = queue.Queue()
    nextFader = {'red': 0.0, 'green': 0.0, 'blue': 0.0, 'alpha': 0.0}
    currentFader = copy.deepcopy(nextFader)

    def __init__(self):
        super(RpifadeOverlay, self).__init__()

        self.name = "RPI Fade"
        self.nameP = colored(self.name,'cyan')
        self.workit = False


    # Queue processor
    def receive(self):


# Path: core/overlays/base.py
# class BaseOverlay(object):
# 
#     def  __init__(self):
# 
#         self.name = "OVERLAY"
#         self.nameP = colored(self.name,'cyan')
# 
#         # running flag
#         self.running = threading.Event()
# 
#         # Receive thread
#         self.recvThread = threading.Thread(target=self.receive)
# 
#     # receiver THREAD (dummy)
#     def receive(self):
#         while self.isRunning():
#             sleep(1000)
#         return
# 
#     # Stop
#     def start(self):
#         self.running.set()
#         self.recvThread.start()
#         return self
# 
#     # Stop
#     def quit(self):
#         self.isRunning(False)
#         self.recvThread.join()
#         print(self.nameP, "stopped")
# 
# 	# is Running
#     def isRunning(self, state=None):
#         if state is not None:
#             self.running.set() if state else self.running.clear()
#         return self.running.is_set()
# 
# Path: core/overlays/rpiopengles/rpiopengles.py
# EGL_DEFAULT_DISPLAY = 0
# EGL_NO_CONTEXT = 0
# EGL_NO_DISPLAY = 0
# EGL_NO_SURFACE = 0
# DISPMANX_PROTECTION_NONE = 0
# def eglints(L):
# def eglfloats(L):
# def check(e):
#     def __init__(self,depthbuffer=False):
#     def __init__(self):
#     def draw(self, red=0.0, green=0.0, blue=0.0, alpha=0.0):
#     def check(self):
# class EGL(object):
# class colortexture():


# Path: core/overlays/rpifade.py
from termcolor import colored
from time import sleep
from .base import BaseOverlay
from .rpiopengles import rpiopengles
import copy
import queue

from __future__ import print_function

class RpifadeOverlay (BaseOverlay):

    queue = queue.Queue()
    nextFader = {'red': 0.0, 'green': 0.0, 'blue': 0.0, 'alpha': 0.0}
    currentFader = copy.deepcopy(nextFader)

    def __init__(self):
        super(RpifadeOverlay, self).__init__()

        self.name = "RPI Fade"
        self.nameP = colored(self.name,'cyan')
        self.workit = False


    # Queue processor
    def receive(self):


        texture = rpiopengles.colortexture()