venture-studio / studio /__init__.py
AlterProgramming's picture
Initial venture-studio deploy: pixel_cursor + studio + app.py
1e3ce4c verified
Raw
History Blame Contribute Delete
1.24 kB
"""Studio: orchestration shell for animation development.
The Studio class is a thin convenience facade. It holds no direct reference to
model code; every pixel mutation routes through pixel_cursor.PixelCursor.write_*.
Enable a backend by importing its adapter (e.g. studio.backends.motionclone) —
the adapter self-registers with pixel_cursor.ops.register_backend.
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Iterable, Optional
from pixel_cursor import (
PixelCursor,
open_cursor,
Image,
FrameStack,
AnimationSegment,
load_image,
)
@dataclass
class Studio:
cursor: Optional[PixelCursor] = None
def load(self, image_path: str) -> "Studio":
img = load_image(image_path)
self.cursor = open_cursor(img)
return self
def with_cursor(self, cursor: PixelCursor) -> "Studio":
self.cursor = cursor
return self
def compile_24fps_from_keyframes(
self,
keyframe_cursors: Iterable[PixelCursor],
segments: Iterable[AnimationSegment],
) -> FrameStack:
from .compile_24fps import compile_keyframes
return compile_keyframes(keyframe_cursors, segments)
__all__ = ["Studio"]