Files
douyi_guaji_main/douyin/detection/detection_pkg/finder_scan_config.py
T

18 lines
489 B
Python

"""Shared scan ranges for finding the small fudai icon."""
from __future__ import annotations
# v2 live-room icon can sit slightly further left than the old hot zone.
FUDAI_ICON_SCAN_X_START = 20
FUDAI_ICON_SCAN_X_END = 430
FUDAI_ICON_SCAN_Y_BASES = (403, 503, 354)
FUDAI_ICON_DEFAULT_OPTIMAL_X = 169
def scale_x(value: int, rx: int) -> int:
return int(value * rx // 1080)
def scale_y(value: int, ry: int, y_offset: int = 0) -> int:
return int(value * ry // 2400 + y_offset)