# Path: vocto/transitions.py
# V = 2  # distance (velocity) index
# class Transitions:
# class Transition:
#     def __init__(self, targets=[], fps=25):
#     def __str__(self):
#     def __len__(self):
#     def count(self):
#     def add(self,transition,frames):
#     def configure(cfg, composites, targets=None, fps=25):
#         def index(composite):
#     def solve(self, begin, end, flip):
#     def travel(composites, previous=None):
#     def __init__(self, name, a=None, b=None):
#     def __str__(self):
#         def hidden( x, hidden ):
#     def phi(self):
#     def name(self):
#     def append(self, composite):
#     def frames(self): return len(self.composites)
#     def A(self, n=None):
#     def B(self, n=None):
#     def Az(self, z0, z1):
#     def Bz(self, z0, z1):
#     def begin(self): return self.composites[0]
#     def end(self): return self.composites[-1]
#     def reversed(self):
#     def swapped(self):
#     def calculate_flip(self):
#             def overlap(a, b):
#     def calculate(self, frames, a_corner=(R, T), b_corner=(L, T)):
#     def keys(self):
# def parse_asterisk(sequence, composites):
# def frange(x, y, jump):
# def bspline(points):
# def find_nearest(spline, points):
# def measure(points):
# def smooth(x):
# def distribute(points, positions, begin, end, x0, x1, n):
# def fade(begin, end, factor):
# def morph(begin, end, pt, corner, factor):
# def interpolate(key_frames, num_frames, corner):
# def is_in(sequence, part):
# def fade_alpha(frame,alpha,frames):


from configparser import SafeConfigParser
from vocto.transitions import Composites, Transitions, L, T, R, B, X, Y
from PIL import Image, ImageDraw, ImageFont
from subprocess import call
import sys
import copy
import re
import logging
import argparse
        x, y = line_or_pos
        if align == 0:
            x = (x - draw.textsize(text, font=font)[X]) / 2
        elif align == -1:
            x = x - draw.textsize(text, font=font)[X]
            y = y - draw.textsize(text, font=font)[Y]
    draw.text([x, y], text, font=font, fill=fill)


def draw_composite(size, composite, swap=False):
    # indices in size and tsize
    X, Y = 0, 1
    # create an image to draw into
    imageBg = Image.new('RGBA', size, (40, 40, 40, 255))
    imageA = Image.new('RGBA', size, (0, 0, 0, 0))
    imageB = Image.new('RGBA', size, (0, 0, 0, 0))
    imageFg = Image.new('RGBA', size, (0, 0, 0, 0))
    # create a drawing context
    drawBg = ImageDraw.Draw(imageBg)
    drawA = ImageDraw.Draw(imageA)
    drawB = ImageDraw.Draw(imageB)
    drawFg = ImageDraw.Draw(imageFg)
    if Args.cross:
        # mark center lines
        drawFg.line((size[X] / 2, 0, size[X] / 2, size[Y]),
                    fill=(0, 0, 0, 128))
        drawFg.line((0, size[Y] / 2, size[X], size[Y] / 2),
                    fill=(0, 0, 0, 128))

    # simulate swapping sources

# Path: vocto/transitions.py
# V = 2  # distance (velocity) index
# class Transitions:
# class Transition:
#     def __init__(self, targets=[], fps=25):
#     def __str__(self):
#     def __len__(self):
#     def count(self):
#     def add(self,transition,frames):
#     def configure(cfg, composites, targets=None, fps=25):
#         def index(composite):
#     def solve(self, begin, end, flip):
#     def travel(composites, previous=None):
#     def __init__(self, name, a=None, b=None):
#     def __str__(self):
#         def hidden( x, hidden ):
#     def phi(self):
#     def name(self):
#     def append(self, composite):
#     def frames(self): return len(self.composites)
#     def A(self, n=None):
#     def B(self, n=None):
#     def Az(self, z0, z1):
#     def Bz(self, z0, z1):
#     def begin(self): return self.composites[0]
#     def end(self): return self.composites[-1]
#     def reversed(self):
#     def swapped(self):
#     def calculate_flip(self):
#             def overlap(a, b):
#     def calculate(self, frames, a_corner=(R, T), b_corner=(L, T)):
#     def keys(self):
# def parse_asterisk(sequence, composites):
# def frange(x, y, jump):
# def bspline(points):
# def find_nearest(spline, points):
# def measure(points):
# def smooth(x):
# def distribute(points, positions, begin, end, x0, x1, n):
# def fade(begin, end, factor):
# def morph(begin, end, pt, corner, factor):
# def interpolate(key_frames, num_frames, corner):
# def is_in(sequence, part):
# def fade_alpha(frame,alpha,frames):


# Path: voctocore/test-transition.py
from configparser import SafeConfigParser
from vocto.transitions import Composites, Transitions, L, T, R, B, X, Y
from PIL import Image, ImageDraw, ImageFont
from subprocess import call
import sys
import copy
import re
import logging
import argparse

        x, y = line_or_pos
        if align == 0:
            x = (x - draw.textsize(text, font=font)[X]) / 2
        elif align == -1:
            x = x - draw.textsize(text, font=font)[X]
            y = y - draw.textsize(text, font=font)[Y]
    draw.text([x, y], text, font=font, fill=fill)


def draw_composite(size, composite, swap=False):
    # indices in size and tsize
    X, Y = 0, 1
    # create an image to draw into
    imageBg = Image.new('RGBA', size, (40, 40, 40, 255))
    imageA = Image.new('RGBA', size, (0, 0, 0, 0))
    imageB = Image.new('RGBA', size, (0, 0, 0, 0))
    imageFg = Image.new('RGBA', size, (0, 0, 0, 0))
    # create a drawing context
    drawBg = ImageDraw.Draw(imageBg)
    drawA = ImageDraw.Draw(imageA)
    drawB = ImageDraw.Draw(imageB)
    drawFg = ImageDraw.Draw(imageFg)
    if Args.cross:
        # mark center lines
        drawFg.line((size[X] / 2, 0, size[X] / 2, size[Y]),
                    fill=(0, 0, 0, 128))
        drawFg.line((0, size[Y] / 2, size[X], size[Y] / 2),
                    fill=(0, 0, 0, 128))

    # simulate swapping sources

    a, b = composite.A(), composite.B()