添加信号格式修改
This commit is contained in:
@@ -143,12 +143,10 @@ def run_custom_sdr_test(self, test_items):
|
||||
self.log_gui.log("执行客户定制 SDR 测试...", level="info")
|
||||
# 获取信号格式设置
|
||||
color_space = self.sdr_color_space_var.get() # BT.709/BT.601/BT.2020
|
||||
gamma_type = self.sdr_gamma_type_var.get() # 2.2/2.4/2.6
|
||||
data_range = self.sdr_data_range_var.get() # Full/Limited
|
||||
bit_depth = self.sdr_bit_depth_var.get() # 8bit/10bit/12bit
|
||||
|
||||
self.log_gui.log(f"信号格式: 色彩空间={color_space}, Gamma={gamma_type}", level="info")
|
||||
self.log_gui.log(f" 数据范围={data_range}, 编码位深={bit_depth}", level="info")
|
||||
self.log_gui.log(f"信号格式: 色彩空间={color_space}, 数据范围={data_range}, 编码位深={bit_depth}", level="info")
|
||||
self.log_gui.log("开始统一采集灰阶数据(用于 Gamma/CCT/对比度测试)", level="info")
|
||||
self.test_custom_sdr()
|
||||
|
||||
@@ -168,12 +166,10 @@ def run_sdr_movie_test(self, test_items):
|
||||
|
||||
# 获取信号格式设置
|
||||
color_space = self.sdr_color_space_var.get() # BT.709/BT.601/BT.2020
|
||||
gamma_type = self.sdr_gamma_type_var.get() # 2.2/2.4/2.6
|
||||
data_range = self.sdr_data_range_var.get() # Full/Limited
|
||||
bit_depth = self.sdr_bit_depth_var.get() # 8bit/10bit/12bit
|
||||
|
||||
self.log_gui.log(f"信号格式: 色彩空间={color_space}, Gamma={gamma_type}", level="info")
|
||||
self.log_gui.log(f" 数据范围={data_range}, 编码位深={bit_depth}", level="info")
|
||||
self.log_gui.log(f"信号格式: 色彩空间={color_space}, 数据范围={data_range}, 编码位深={bit_depth}", level="info")
|
||||
|
||||
# 判断是否需要灰阶数据
|
||||
needs_gray_data = any(
|
||||
@@ -313,7 +309,20 @@ def send_fix_pattern(self, mode):
|
||||
|
||||
self.log_gui.log("=" * 50, level="separator")
|
||||
|
||||
# 4. 循环发送图案并采集数据
|
||||
# 信号格式设置后等待电视重新锁定 HDMI 信号
|
||||
# format_changed=True 表示本次 set_video_mode 的参数与上次不同,TV 需要重新锁定
|
||||
format_changed = getattr(getattr(self, "ucd", None), "format_changed", True)
|
||||
if format_changed:
|
||||
signal_settle = max(1.0, float(getattr(self, "signal_settle_time", 5.0)))
|
||||
self.log_gui.log(
|
||||
f"信号格式已变化,等待电视重新锁定: {signal_settle:.1f}s(可通过 signal_settle_time 调整)",
|
||||
level="info",
|
||||
)
|
||||
else:
|
||||
signal_settle = 0.5
|
||||
self.log_gui.log("信号格式未变化,短暂等待: 0.5s", level="info")
|
||||
time.sleep(signal_settle)
|
||||
|
||||
total_patterns = session.total_patterns
|
||||
self.log_gui.log(f"开始采集数据,共 {total_patterns} 个图案", level="info")
|
||||
settle_time = max(0.2, float(getattr(self, "pattern_settle_time", 1.0)))
|
||||
@@ -332,7 +341,8 @@ def send_fix_pattern(self, mode):
|
||||
return results
|
||||
|
||||
should_log_detail = (
|
||||
i == 0
|
||||
total_patterns <= progress_step
|
||||
or i == 0
|
||||
or (i + 1) == total_patterns
|
||||
or ((i + 1) % progress_step == 0)
|
||||
)
|
||||
@@ -477,12 +487,14 @@ def test_gamut(self, test_type):
|
||||
# SDR 测试:使用色彩空间设置
|
||||
color_space = self.sdr_color_space_var.get()
|
||||
|
||||
if color_space == "BT.709":
|
||||
if color_space in ("sRGB", "BT.709"):
|
||||
reference_standard = "BT.709"
|
||||
elif color_space == "BT.601":
|
||||
reference_standard = "BT.601"
|
||||
elif color_space == "BT.2020":
|
||||
reference_standard = "BT.2020"
|
||||
elif color_space == "DCI-P3":
|
||||
reference_standard = "DCI-P3"
|
||||
else:
|
||||
reference_standard = "BT.709"
|
||||
self.log_gui.log(
|
||||
@@ -665,7 +677,7 @@ def test_gamma(self, test_type, gray_data=None):
|
||||
"gamma", {"gamma": results_with_gamma_list, "L_bar": L_bar}
|
||||
)
|
||||
|
||||
# 绘制Gamma曲线
|
||||
# 绘制Gamma曲线(SDR 使用用户选择的参考值)
|
||||
if test_type == "sdr_movie":
|
||||
try:
|
||||
target_gamma = float(self.sdr_gamma_type_var.get())
|
||||
@@ -673,7 +685,6 @@ def test_gamma(self, test_type, gray_data=None):
|
||||
target_gamma = 2.2
|
||||
else:
|
||||
target_gamma = 2.2
|
||||
|
||||
self.plot_gamma(L_bar, results_with_gamma_list, target_gamma, test_type)
|
||||
self._save_chart_snapshot(test_type, "gamma", (L_bar, results_with_gamma_list, target_gamma, test_type))
|
||||
|
||||
@@ -877,7 +888,7 @@ def test_contrast(self, test_type, gray_data=None):
|
||||
def test_color_accuracy(self, test_type):
|
||||
"""测试色准 - 使用手工实现的 ΔE 2000(应用 Gamma)"""
|
||||
|
||||
# ========== 读取用户选择的 Gamma ==========
|
||||
# ========== Gamma 参考值 ==========
|
||||
if test_type == "sdr_movie":
|
||||
try:
|
||||
target_gamma = float(self.sdr_gamma_type_var.get())
|
||||
@@ -886,7 +897,7 @@ def test_color_accuracy(self, test_type):
|
||||
|
||||
self.log_gui.log("=" * 50, level="separator")
|
||||
self.log_gui.log(f"开始测试色准(SDR Movie 标准 - 29色)", level="info")
|
||||
self.log_gui.log(f"使用 Gamma: {target_gamma}", level="success") # ← 新增
|
||||
self.log_gui.log(f"使用 Gamma: {target_gamma}", level="success")
|
||||
self.log_gui.log("=" * 50, level="separator")
|
||||
|
||||
elif test_type == "hdr_movie":
|
||||
@@ -962,9 +973,9 @@ def test_color_accuracy(self, test_type):
|
||||
color_patches.append(name)
|
||||
|
||||
if delta_e < 3:
|
||||
grade, icon = "优秀", "✓"
|
||||
grade, icon = "优秀", "OK"
|
||||
elif delta_e < 5:
|
||||
grade, icon = "良好", "○"
|
||||
grade, icon = "良好", "WARN"
|
||||
else:
|
||||
grade, icon = "偏差", "[Error]"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user