# Path: opc/utils/prof.py
# def timefunc(f, reference=False):
#     global records
# 
#     records[f.__name__] = Record(f.__name__, reference)
# 
#     @wraps(f)
#     def f_timer(*args, **kwargs):
#         global active
# 
#         if not active:
#             return f(*args, **kwargs)
# 
#         start = time.time()
#         result = f(*args, **kwargs)
#         end = time.time()
# 
#         records[f.__name__].addTime(end-start)
# 
#         return result
# 
#     return f_timer


from functools import reduce
from ..utils.prof import timefunc
import numpy as np
import operator
        """
        origin = points.pop(0)

        self.setCursor(origin)
        for x, y in points:
            self.drawLineRelative(x, y, color, alpha)

        x, y = origin
        self.drawLineRelative(x, y, color, alpha)

    @timefunc
    def fillRectAbsolute(self, x1, y1, x2, y2, color):
        """
        Draw an unrotated filled rectangle
        """
        x1, y1 = self._clip(x1, y1)
        x2, y2 = self._clip(x2, y2)

        if x1 == x2:
            if y1 == y2:
                self.buf.buf[x1, y1] = color
            else:
                self.buf.buf[x1, min(y1, y2):max(y1, y2)+1] = color
        else:
            if y1 == y2:
                self.buf.buf[min(x1, x2):max(x1, x2)+1, y1] = color
            else:
                self.buf.buf[min(x1, x2):max(x1, x2)+1,
                             min(y1, y2):max(y1, y2)+1] = color


# Path: opc/utils/prof.py
# def timefunc(f, reference=False):
#     global records
# 
#     records[f.__name__] = Record(f.__name__, reference)
# 
#     @wraps(f)
#     def f_timer(*args, **kwargs):
#         global active
# 
#         if not active:
#             return f(*args, **kwargs)
# 
#         start = time.time()
#         result = f(*args, **kwargs)
#         end = time.time()
# 
#         records[f.__name__].addTime(end-start)
# 
#         return result
# 
#     return f_timer


# Path: opc/matrix/plot.py
from functools import reduce
from ..utils.prof import timefunc
import numpy as np
import operator

        """
        origin = points.pop(0)

        self.setCursor(origin)
        for x, y in points:
            self.drawLineRelative(x, y, color, alpha)

        x, y = origin
        self.drawLineRelative(x, y, color, alpha)

    @timefunc
    def fillRectAbsolute(self, x1, y1, x2, y2, color):
        """
        Draw an unrotated filled rectangle
        """
        x1, y1 = self._clip(x1, y1)
        x2, y2 = self._clip(x2, y2)

        if x1 == x2:
            if y1 == y2:
                self.buf.buf[x1, y1] = color
            else:
                self.buf.buf[x1, min(y1, y2):max(y1, y2)+1] = color
        else:
            if y1 == y2:
                self.buf.buf[min(x1, x2):max(x1, x2)+1, y1] = color
            else:
                self.buf.buf[min(x1, x2):max(x1, x2)+1,
                             min(y1, y2):max(y1, y2)+1] = color


    @timefunc