File size: 881 Bytes
1e3ce4c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | """Scope: WHERE in time, depth, identity, and opacity the cursor extends."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Union
import numpy as np
@dataclass(frozen=True, slots=True)
class FrameIndex:
index: int
@dataclass(frozen=True, slots=True)
class FrameRange:
start: int
end: int
class _AllFrames:
__slots__ = ()
def __repr__(self) -> str:
return "ALL_FRAMES"
ALL_FRAMES = _AllFrames()
TemporalScope = Union[FrameIndex, FrameRange, _AllFrames]
@dataclass(frozen=True, slots=True)
class DepthScope:
layer_id: Optional[str] = None
@dataclass(frozen=True, slots=True, eq=False)
class OpacityProfile:
kind: str = "hard"
falloff: Optional[np.ndarray] = None
@dataclass(frozen=True, slots=True, eq=False)
class IdentityLock:
embedding: np.ndarray
source: str = ""
|