重构-抽纯函数
This commit is contained in:
19
app/tests/gamma.py
Normal file
19
app/tests/gamma.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Gamma 相关纯算法。"""
|
||||
|
||||
import algorithm.pq_algorithm as pq_algorithm
|
||||
|
||||
|
||||
def calculate_gamma(results, max_index_fix, pattern_params=None):
|
||||
"""计算 Gamma 值,返回 (results_with_gamma_list, L_bar)。
|
||||
|
||||
Args:
|
||||
results: 测量结果列表
|
||||
max_index_fix: 最大灰阶索引
|
||||
pattern_params: 8bit pattern 参数,用于计算 input_level
|
||||
(与 22293 Gamma 数据对齐)
|
||||
"""
|
||||
results_with_gamma_list = pq_algorithm.calculate_gamma(
|
||||
results, max_index_fix, pattern_params
|
||||
)
|
||||
L_bar = pq_algorithm.calculate_L_bar(results)
|
||||
return results_with_gamma_list, L_bar
|
||||
Reference in New Issue
Block a user