# 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
    return Image.alpha_composite(
        Image.alpha_composite(
            Image.alpha_composite(imageBg, imageA), imageB), imageFg)


def draw_transition(size, transition, info=None):
    # animation as a list of images
    images = []
    # render all frames
    for i in range(transition.frames()):
        # create an image to draw into
        imageBg = draw_composite(size, transition.composites[i],
                                 transition.flip is not None and i >= transition.flip)
        imageDesc = 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)
        drawDesc = ImageDraw.Draw(imageDesc)
        drawFg = ImageDraw.Draw(imageFg)

        acolor = (256, 128, 128, 128)
        bcolor = (128, 128, 256, 128)

        if Args.keys:
            n = 0
            for key in transition.keys():
                ac = key.A().rect
                bc = key.B().rect
                drawDesc.rectangle(ac, outline=acolor)
                draw_text(drawDesc, size,

# 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

    return Image.alpha_composite(
        Image.alpha_composite(
            Image.alpha_composite(imageBg, imageA), imageB), imageFg)


def draw_transition(size, transition, info=None):
    # animation as a list of images
    images = []
    # render all frames
    for i in range(transition.frames()):
        # create an image to draw into
        imageBg = draw_composite(size, transition.composites[i],
                                 transition.flip is not None and i >= transition.flip)
        imageDesc = 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)
        drawDesc = ImageDraw.Draw(imageDesc)
        drawFg = ImageDraw.Draw(imageFg)

        acolor = (256, 128, 128, 128)
        bcolor = (128, 128, 256, 128)

        if Args.keys:
            n = 0
            for key in transition.keys():
                ac = key.A().rect
                bc = key.B().rect
                drawDesc.rectangle(ac, outline=acolor)
                draw_text(drawDesc, size,

                          [ac[L] + 2, ac[T] + 2],