添加信号格式修改
This commit is contained in:
@@ -522,11 +522,7 @@ class UCDEnum:
|
||||
|
||||
@staticmethod
|
||||
def get_list():
|
||||
return [
|
||||
SignalFormat.GammaType.GAMMA_22,
|
||||
SignalFormat.GammaType.GAMMA_24,
|
||||
SignalFormat.GammaType.GAMMA_26,
|
||||
]
|
||||
return ["2.2", "2.4", "2.6"]
|
||||
|
||||
@staticmethod
|
||||
def get_gamma_value(gamma_str):
|
||||
@@ -542,12 +538,7 @@ class UCDEnum:
|
||||
|
||||
@staticmethod
|
||||
def get_list():
|
||||
return [SignalFormat.DataRange.FULL, SignalFormat.DataRange.LIMITED]
|
||||
|
||||
@staticmethod
|
||||
def is_full_range(range_str):
|
||||
"""判断是否为 Full Range"""
|
||||
return range_str == SignalFormat.DataRange.FULL
|
||||
return ["Full", "Limited"]
|
||||
|
||||
class BitDepth:
|
||||
"""编码位深枚举"""
|
||||
@@ -558,11 +549,7 @@ class UCDEnum:
|
||||
|
||||
@staticmethod
|
||||
def get_list():
|
||||
return [
|
||||
SignalFormat.BitDepth.BIT_8,
|
||||
SignalFormat.BitDepth.BIT_10,
|
||||
SignalFormat.BitDepth.BIT_12,
|
||||
]
|
||||
return ["8bit", "10bit", "12bit"]
|
||||
|
||||
@staticmethod
|
||||
def get_bit_value(bit_str):
|
||||
@@ -583,8 +570,44 @@ class UCDEnum:
|
||||
|
||||
@staticmethod
|
||||
def get_maxcll_list():
|
||||
return SignalFormat.HDRMetadata.MAX_CLL_OPTIONS
|
||||
return [400, 600, 800, 1000, 1200, 1500, 2000, 4000]
|
||||
|
||||
@staticmethod
|
||||
def get_maxfall_list():
|
||||
return SignalFormat.HDRMetadata.MAX_FALL_OPTIONS
|
||||
return [200, 300, 400, 500, 600, 800, 1000]
|
||||
|
||||
class OutputFormat:
|
||||
"""输出色彩格式枚举(决定信号是 RGB 还是 YCbCr 格式)"""
|
||||
|
||||
RGB = "RGB"
|
||||
YCBCR_422 = "YCbCr 4:2:2"
|
||||
YCBCR_444 = "YCbCr 4:4:4"
|
||||
YCBCR_420 = "YCbCr 4:2:0"
|
||||
Y_ONLY = "Y Only"
|
||||
IDO_DEFINED = "IDO Defined"
|
||||
RAW = "RAW"
|
||||
DSC = "DSC"
|
||||
|
||||
@staticmethod
|
||||
def get_list():
|
||||
return ["RGB", "YCbCr 4:4:4", "YCbCr 4:2:2", "YCbCr 4:2:0",
|
||||
"Y Only", "IDO Defined", "RAW", "DSC"]
|
||||
|
||||
@staticmethod
|
||||
def is_ycbcr(format_str):
|
||||
return "YCbCr" in (format_str or "")
|
||||
|
||||
@staticmethod
|
||||
def get_format_key(format_str):
|
||||
"""将显示字符串转换为 UCDEnum.ColorInfo.get_color_format() 的 key"""
|
||||
fmt_map = {
|
||||
"RGB": "rgb",
|
||||
"YCbCr 4:4:4": "ycbcr444",
|
||||
"YCbCr 4:2:2": "ycbcr422",
|
||||
"YCbCr 4:2:0": "ycbcr420",
|
||||
"Y Only": "yonly",
|
||||
"IDO Defined": "ido_defined",
|
||||
"RAW": "raw",
|
||||
"DSC": "dsc",
|
||||
}
|
||||
return fmt_map.get(format_str, "rgb")
|
||||
|
||||
Reference in New Issue
Block a user