add back GUI 2D display with optional raw / pure color background
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user