add back GUI 2D display with optional raw / pure color background

This commit is contained in:
ykcheungab
2026-06-21 18:01:13 +08:00
parent 7feae9550e
commit 04a4df3303
25 changed files with 931 additions and 9 deletions
+4 -2
View File
@@ -12,12 +12,12 @@ import orisys
if TYPE_CHECKING:
from pipeline.frame import FingerFrameView
ArrowBackground = Literal["unrolled", "white"]
ArrowBackground = Literal["unrolled", "pure_color"]
@dataclass(frozen=True)
class ArrowCanvasColors:
"""BGR fill colors for synthetic UV arrow background (``background='white'``)."""
"""BGR fill colors for synthetic UV arrow background (``background='pure_color'``)."""
outside_bgr: tuple[int, int, int] = (0, 0, 0)
uv_bgr: tuple[int, int, int] = (255, 255, 255)
@@ -67,6 +67,8 @@ def _arrow_background(
"""Return the BGR canvas for UV arrow drawing."""
if background == "unrolled":
return frame.unrolled
if background != "pure_color":
raise ValueError(f"unknown arrow background: {background!r}")
h, w = frame.unrolled.shape[:2]
outside = np.array(_as_bgr(canvas_colors.outside_bgr), dtype=np.uint8)
uv = np.array(_as_bgr(canvas_colors.uv_bgr), dtype=np.uint8)