コード例 #1
0
ファイル: 005_scene.py プロジェクト: bracket/handsome
def render_image(scene_path, out_path):
    from handsome.util import save_array_as_image

    scene = parse_scene(scene_path)
    canvas = render_scene(scene)

    buffer = array_view(canvas.downsample(1))
    buffer = np.clip(buffer, 0., 1.)
    buffer = (255. * buffer).astype(dtype=np.uint8)

    save_array_as_image(pixel_view(buffer), out_path, 'RGBA')
コード例 #2
0
ファイル: app.py プロジェクト: bracket/VIctor
    def scene(self):
        from sweatervest import parse_scene

        attrs = self.__dict__
        scene = attrs.get('scene')

        if scene is not None:
            return scene

        scene_path = os.path.join(DATA_PATH, 'blank_scene.yaml')
        scene = parse_scene(scene_path)
        attrs['scene'] = scene

        return scene
コード例 #3
0
ファイル: 005_scene.py プロジェクト: bracket/handsome
def read_blank_scene():
    scene_path = os.path.join(os.path.split(__file__)[0], 'data', 'blank_scene.yaml')
    return parse_scene(scene_path)