# Path: cuburn/profile.py
# BUILTIN={
#     '1080p': dict(width=1920, height=1080),
#     '720p': dict(width=1280, height=720),
#     '540p': dict(width=960, height=540),
#     'preview': dict(width=640, height=360, spp=1200, skip=1)
# }
# def add_args(parser=None):
# def get_from_args(args):
# def wrap(prof, gnm):
# def enumerate_times(gprof):
# def enumerate_jobs(gprof, basename, args, resume=None):
# 
# Path: cuburn/render.py
# class DurationEvent(cuda.Event):
# class Framebuffers(object):
# class DevSrc(object):
# class DevInfo(object):
# class Renderer(object):
# class RenderManager(ClsMod):
#     def __init__(self, prior):
#     def time(self):
#     def calc_dim(cls, width, height):
#     def __init__(self):
#     def _clear(self):
#     def free(self, stream=None):
#     def alloc(self, dim, stream=None):
#     def set_dim(self, width, height, stream=None):
#     def flip(self):
#     def flip_side(self):
#     def __init__(self):
#     def __init__(self):
#     def compile(cls, gnm, arch=None, keep=False):
#     def load(self, cubin):
#     def __init__(self, gnm, gprof, keep=False, arch=None):
#     def __init__(self):
#     def _copy(self, rdr, gnm):
#     def _interp(self, rdr, gnm, dim, ts, td):
#     def _print_interp_knots(self, rdr, tsidx=5):
#     def _iter(self, rdr, gnm, gprof, dim, tc):
#     def queue_frame(self, rdr, gnm, gprof, tc, copy=True):
#     MAX_MODREFS = 20
# 
# Path: main.py
# def save(buf):
#     out, log = rdr.out.encode(buf)
#     for suffix, file_like in out.items():
#         with open(name + suffix, 'w') as fp:
#             fp.write(file_like.read())
#         if getattr(file_like, 'close', None):
#             file_like.close()
#     for key, val in log:
#         print >> sys.stderr, '\n=== %s ===' % key
#         print >> sys.stderr, val


import os, sys, json, scipy, pycuda.autoinit
import numpy as np
from copy import deepcopy
from os.path import abspath, join, dirname
from cuburn import genome, profile, render
from main import save
#!/usr/bin/python2

"""
Render multiple versions of a genome, disabling each xform and variation in
turn, for use in debugging.
"""


sys.path.insert(0, abspath(join(dirname(__file__), '..')))



def main(gnm_path, time):
    gdb = genome.db.connect('.')
    gnm, basename = gdb.get_anim(gnm_path)
    rmgr = render.RenderManager()
    def go(gj, name):

# Path: cuburn/profile.py
# BUILTIN={
#     '1080p': dict(width=1920, height=1080),
#     '720p': dict(width=1280, height=720),
#     '540p': dict(width=960, height=540),
#     'preview': dict(width=640, height=360, spp=1200, skip=1)
# }
# def add_args(parser=None):
# def get_from_args(args):
# def wrap(prof, gnm):
# def enumerate_times(gprof):
# def enumerate_jobs(gprof, basename, args, resume=None):
# 
# Path: cuburn/render.py
# class DurationEvent(cuda.Event):
# class Framebuffers(object):
# class DevSrc(object):
# class DevInfo(object):
# class Renderer(object):
# class RenderManager(ClsMod):
#     def __init__(self, prior):
#     def time(self):
#     def calc_dim(cls, width, height):
#     def __init__(self):
#     def _clear(self):
#     def free(self, stream=None):
#     def alloc(self, dim, stream=None):
#     def set_dim(self, width, height, stream=None):
#     def flip(self):
#     def flip_side(self):
#     def __init__(self):
#     def __init__(self):
#     def compile(cls, gnm, arch=None, keep=False):
#     def load(self, cubin):
#     def __init__(self, gnm, gprof, keep=False, arch=None):
#     def __init__(self):
#     def _copy(self, rdr, gnm):
#     def _interp(self, rdr, gnm, dim, ts, td):
#     def _print_interp_knots(self, rdr, tsidx=5):
#     def _iter(self, rdr, gnm, gprof, dim, tc):
#     def queue_frame(self, rdr, gnm, gprof, tc, copy=True):
#     MAX_MODREFS = 20
# 
# Path: main.py
# def save(buf):
#     out, log = rdr.out.encode(buf)
#     for suffix, file_like in out.items():
#         with open(name + suffix, 'w') as fp:
#             fp.write(file_like.read())
#         if getattr(file_like, 'close', None):
#             file_like.close()
#     for key, val in log:
#         print >> sys.stderr, '\n=== %s ===' % key
#         print >> sys.stderr, val


# Path: helpers/xfsearch.py
import os, sys, json, scipy, pycuda.autoinit
import numpy as np
from copy import deepcopy
from os.path import abspath, join, dirname
from cuburn import genome, profile, render
from main import save

#!/usr/bin/python2

"""
Render multiple versions of a genome, disabling each xform and variation in
turn, for use in debugging.
"""


sys.path.insert(0, abspath(join(dirname(__file__), '..')))



def main(gnm_path, time):
    gdb = genome.db.connect('.')
    gnm, basename = gdb.get_anim(gnm_path)
    rmgr = render.RenderManager()
    def go(gj, name):

        gprof = profile.wrap(profile.BUILTIN['720p'], gj)