from dataclasses import dataclass from PIL import Image UNTAGGED = "untagged" @dataclass class DetailSection: source: str # 잘라낸 원본 이름 (detail_01 …) index: int # 그 원본 안에서의 순번 y0: int y1: int # compose는 좌표만 쓴다 — 조각 그림 없이 만들어도 된다 image: Image.Image | None = None tag: str = UNTAGGED @property def name(self) -> str: return f"{self.source}_s{self.index:02d}" @dataclass class DetailSplitResult: sections: list[DetailSection] sheet: Image.Image # 육안 검수용 컨택트 시트