Debian Codegraph @

DisplayCAL/argyll_names.py

raw
1 """Argyll CMS tool names and related configurations for DisplayCAL.
2
3 It includes predefined tool names, optional tools, alternative naming
4 conventions, viewing conditions, intents, video encodings, and observer types.
5 """
6
7 # Argyll CMS tools used by DisplayCAL
8 NAMES = [
9 "applycal",
10 "average",
11 "cctiff",
12 "ccxxmake",
13 "dispcal",
14 "dispread",
15 "collink",
16 "colprof",
17 "dispwin",
18 "fakeread",
19 "iccgamut",
20 "icclu",
21 "xicclu",
22 "spotread",
23 "spyd2en",
24 "spyd4en",
25 "targen",
26 "tiffgamut",
27 "timage",
28 "txt2ti3",
29 "i1d3ccss",
30 "viewgam",
31 "oeminst",
32 "profcheck",
33 "spec2cie",
34 "specplot",
35 ]
36
37 # Argyll CMS tools optionally used by DisplayCAL
38 OPTIONAL = [
39 "applycal",
40 "average",
41 "cctiff",
42 "ccxxmake",
43 "i1d3ccss",
44 "oeminst",
45 "specplot",
46 "spec2cie",
47 "spyd2en",
48 "spyd4en",
49 "tiffgamut",
50 "timage",
51 ]
52
53 PREFIXES_SUFFIXES = ["argyll"]
54
55 # Alternative tool names (from older Argyll CMS versions or with filename
56 # prefix/suffix like on some Linux distros)
57 ALTNAMES = {
58 "txt2ti3": ["logo2cgats"],
59 "icclu": ["xicclu"],
60 "ccxxmake": ["ccmxmake"],
61 "i1d3ccss": ["oeminst"],
62 "spyd2en": ["oeminst"],
63 "spyd4en": ["oeminst"],
64 }
65
66
67 def add_prefixes_suffixes(name: str, altname: str) -> None:
68 """Add prefixes and suffixes to the alternative tool names.
69
70 Args:
71 name (str): The original tool name.
72 altname (str): The alternative tool name.
73 """
74 for prefix_suffix in PREFIXES_SUFFIXES:
75 ALTNAMES[name].append(f"{altname}-{prefix_suffix}")
76 ALTNAMES[name].append(f"{prefix_suffix}-{altname}")
77
78
79 # Automatically populate the alternative tool names with prefixed/suffixed
80 # versions
81 for name in NAMES:
82 if name not in ALTNAMES:
83 ALTNAMES[name] = []
84 _altnames = list(ALTNAMES[name])
85 for altname in _altnames:
86 add_prefixes_suffixes(name, altname)
87 ALTNAMES[name].append(name)
88 add_prefixes_suffixes(name, name)
89 ALTNAMES[name].reverse()
90
91 # Viewing conditions supported by colprof (only predefined choices)
92 VIEWCONDS = [
93 "pp",
94 "pe",
95 "pc", # Argyll 1.1.1
96 "mt",
97 "mb",
98 "md",
99 "jm",
100 "jd",
101 "tv", # Argyll 1.6
102 "pcd",
103 "ob",
104 "cx",
105 ]
106
107 # Intents supported by colprof
108 # pa = Argyll >= 1.3.3
109 # lp = Argyll >= 1.8.3
110 INTENTS = ["a", "aa", "aw", "la", "lp", "ms", "p", "pa", "r", "s"]
111
112 # Video input/output encodings supported by collink (Argyll >= 1.6)
113 VIDEO_ENCODINGS = ["n", "t", "6", "7", "5", "2", "C", "x", "X"]
114
115 # Observers
116 # TODO: OBSERVERS should include 2012_2 and 2012_10.
117 OBSERVERS = ["1931_2", "1955_2", "1964_10", "1964_10c", "1978_2", "shaw"]