# Path: vocto/frame.py
# X, Y = 0, 1
# L, T, R, B = 0, 1, 2, 3
# class Frame:
#     def __init__(self, key=False, alpha=255, zorder=None, rect=[0, 0, 0, 0], crop=[0, 0, 0, 0]):
#     def __repr__(self):
#     def str_title():
#     def __str__(self):
#     def __eq__(self, other):
#     def zoomx(self):
#     def zoomy(self):
#     def zoom(self):
#     def cropped(self):
#     def corner(self, ix, iy): return [self.rect[ix], self.rect[iy]]
#     def left(self): return self.rect[L]
#     def top(self): return self.rect[T]
#     def width(self): return self.rect[R] - self.rect[L]
#     def height(self): return self.rect[B] - self.rect[T]
#     def float_alpha(self):
#     def size(self): return self.width(), self.height()
#     def invisible(self):
#     def mirrored(self):
#     def duplicate(self):


import logging
import copy
import re
from vocto.frame import Frame, X, Y, L, T, R, B
            r = c.mirrored()
            r.order = len(composites) + len(result)
            result[mirror_name(c_name)] = r
    return composites.update(result)


def swap_name(name): return name[1:] if name[0] == '^' else "^" + name
def mirror_name(name): return name[1:] if name[0] == '|' else "|" + name


def absolute(str, max):
    if str == '*':
        assert max
        # return maximum value
        return int(max)
    elif '.' in str:
        assert max
        # return absolute (Pixel) value in proportion to max
        return int(float(str) * max)
    else:
        # return absolute (Pixel) value
        return int(str)


def str2rect(str, size):
    """ read rectangle pair from string '*', 'X/Y WxH', 'X/Y', 'WxH', 'X/Y WH', 'X/Y WH' or 'XY WH'
    """
    # check for '*'
    if str == "*":
        # return overall position and size

# Path: vocto/frame.py
# X, Y = 0, 1
# L, T, R, B = 0, 1, 2, 3
# class Frame:
#     def __init__(self, key=False, alpha=255, zorder=None, rect=[0, 0, 0, 0], crop=[0, 0, 0, 0]):
#     def __repr__(self):
#     def str_title():
#     def __str__(self):
#     def __eq__(self, other):
#     def zoomx(self):
#     def zoomy(self):
#     def zoom(self):
#     def cropped(self):
#     def corner(self, ix, iy): return [self.rect[ix], self.rect[iy]]
#     def left(self): return self.rect[L]
#     def top(self): return self.rect[T]
#     def width(self): return self.rect[R] - self.rect[L]
#     def height(self): return self.rect[B] - self.rect[T]
#     def float_alpha(self):
#     def size(self): return self.width(), self.height()
#     def invisible(self):
#     def mirrored(self):
#     def duplicate(self):


# Path: vocto/composites.py
import logging
import copy
import re
from vocto.frame import Frame, X, Y, L, T, R, B

            r = c.mirrored()
            r.order = len(composites) + len(result)
            result[mirror_name(c_name)] = r
    return composites.update(result)


def swap_name(name): return name[1:] if name[0] == '^' else "^" + name
def mirror_name(name): return name[1:] if name[0] == '|' else "|" + name


def absolute(str, max):
    if str == '*':
        assert max
        # return maximum value
        return int(max)
    elif '.' in str:
        assert max
        # return absolute (Pixel) value in proportion to max
        return int(float(str) * max)
    else:
        # return absolute (Pixel) value
        return int(str)


def str2rect(str, size):
    """ read rectangle pair from string '*', 'X/Y WxH', 'X/Y', 'WxH', 'X/Y WH', 'X/Y WH' or 'XY WH'
    """
    # check for '*'
    if str == "*":
        # return overall position and size

        return [0, 0, size[X], size[Y]]