2424__email__ = "ocio-dev@lists.aswf.io"
2525__status__ = "Production"
2626
27- __all__ = ["generate_clf_input" , "generate_clf_utility" ]
27+ __all__ = [
28+ "generate_clf_ocio_input" ,
29+ "generate_clf_vendor_input" ,
30+ "generate_clf_utility" ,
31+ ]
2832
2933THIS_DIR = Path (__file__ ).parent .resolve ()
3034
31- TF_ID_PREFIX = "urn:aswf:ocio:transformId:1.0:OCIO: "
35+ TF_ID_PREFIX = "urn:aswf:ocio:transformId:1.0:"
3236TF_ID_SUFFIX = ":1.0"
3337
34- CLF_PREFIX = "OCIO."
3538CLF_SUFFIX = ".clf"
3639
3740
38- def generate_clf_input ():
41+ def generate_clf_ocio_input ():
3942 """Generate OCIO Input CLF transforms."""
4043
4144 dest_dir = THIS_DIR / "input"
@@ -49,14 +52,36 @@ def generate_clf_input():
4952 create_gamma ("sRGB" ),
5053 ]
5154 ),
52- TF_ID_PREFIX + "Input:AP0_to_Rec709-sRGB" + TF_ID_SUFFIX ,
55+ TF_ID_PREFIX + "OCIO: Input:AP0_to_Rec709-sRGB" + TF_ID_SUFFIX ,
5356 "AP0 to Rec.709 - sRGB" ,
54- dest_dir / (CLF_PREFIX + " Input.AP0_to_Rec709-sRGB" + CLF_SUFFIX ),
57+ dest_dir / ("OCIO. Input.AP0_to_Rec709-sRGB" + CLF_SUFFIX ),
5558 "ACES2065-1" ,
5659 "sRGB" ,
5760 )
5861
5962
63+ def generate_clf_vendor_input ():
64+ """Generate Vendor Input CLF transforms."""
65+
66+ dest_dir = THIS_DIR / "input"
67+ if not dest_dir .exists ():
68+ dest_dir .mkdir ()
69+
70+ config = ocio .Config .CreateRaw ()
71+
72+ generate_clf (
73+ config .getProcessor (
74+ ocio .BuiltinTransform (style = "RED_LOG3G10-RWG_to_ACES2065-1" )
75+ ).createGroupTransform (),
76+ TF_ID_PREFIX + "RED:Input:Log3G10_RWG_to_ACES2065-1" + TF_ID_SUFFIX ,
77+ "RED Log3G10 REDWideGamutRGB to ACES2065-1" ,
78+ dest_dir / ("RED.Log3G10_RWG_to_ACES2065-1" + CLF_SUFFIX ),
79+ "RED Log3G10 REDWideGamutRGB" ,
80+ "ACES2065-1" ,
81+ "urn:ampas:aces:transformId:v1.5:IDT.RED.Log3G10_RWG.a1.v1" ,
82+ )
83+
84+
6085def generate_clf_utility ():
6186 """Generate OCIO Utility CLF transforms."""
6287
@@ -66,18 +91,18 @@ def generate_clf_utility():
6691
6792 generate_clf (
6893 ocio .GroupTransform (transforms = [create_gamma (2.4 )]),
69- TF_ID_PREFIX + "Utility:Linear_to_Rec1886" + TF_ID_SUFFIX ,
94+ TF_ID_PREFIX + "OCIO: Utility:Linear_to_Rec1886" + TF_ID_SUFFIX ,
7095 "Linear to Rec.1886" ,
71- dest_dir / (CLF_PREFIX + " Utility.Linear_to_Rec1886" + CLF_SUFFIX ),
96+ dest_dir / ("OCIO. Utility.Linear_to_Rec1886" + CLF_SUFFIX ),
7297 "generic linear RGB" ,
7398 "generic gamma-corrected RGB" ,
7499 )
75100
76101 generate_clf (
77102 ocio .GroupTransform (transforms = [create_gamma ("sRGB" )]),
78- TF_ID_PREFIX + "Utility:Linear_to_sRGB" + TF_ID_SUFFIX ,
103+ TF_ID_PREFIX + "OCIO: Utility:Linear_to_sRGB" + TF_ID_SUFFIX ,
79104 "Linear to sRGB" ,
80- dest_dir / (CLF_PREFIX + " Utility.Linear_to_sRGB" + CLF_SUFFIX ),
105+ dest_dir / ("OCIO. Utility.Linear_to_sRGB" + CLF_SUFFIX ),
81106 "generic linear RGB" ,
82107 "generic gamma-corrected RGB" ,
83108 )
@@ -86,9 +111,9 @@ def generate_clf_utility():
86111 ocio .GroupTransform (
87112 transforms = [create_conversion_matrix ("ACES2065-1" , "P3-D65" )]
88113 ),
89- TF_ID_PREFIX + "Utility:AP0_to_P3-D65-Linear" + TF_ID_SUFFIX ,
114+ TF_ID_PREFIX + "OCIO: Utility:AP0_to_P3-D65-Linear" + TF_ID_SUFFIX ,
90115 "AP0 to P3-D65 - Linear" ,
91- dest_dir / (CLF_PREFIX + " Utility.AP0_to_P3-D65-Linear" + CLF_SUFFIX ),
116+ dest_dir / ("OCIO. Utility.AP0_to_P3-D65-Linear" + CLF_SUFFIX ),
92117 "ACES2065-1" ,
93118 "linear P3 primaries, D65 white point" ,
94119 )
@@ -99,9 +124,9 @@ def generate_clf_utility():
99124 create_conversion_matrix ("ACES2065-1" , "ITU-R BT.2020" )
100125 ]
101126 ),
102- TF_ID_PREFIX + "Utility:AP0_to_Rec2020-Linear" + TF_ID_SUFFIX ,
127+ TF_ID_PREFIX + "OCIO: Utility:AP0_to_Rec2020-Linear" + TF_ID_SUFFIX ,
103128 "AP0 to Rec.2020 - Linear" ,
104- dest_dir / (CLF_PREFIX + " Utility.AP0_to_Rec2020-Linear" + CLF_SUFFIX ),
129+ dest_dir / ("OCIO. Utility.AP0_to_Rec2020-Linear" + CLF_SUFFIX ),
105130 "ACES2065-1" ,
106131 "linear Rec.2020 primaries, D65 white point" ,
107132 )
@@ -110,9 +135,9 @@ def generate_clf_utility():
110135 ocio .GroupTransform (
111136 transforms = [create_conversion_matrix ("ACES2065-1" , "ITU-R BT.709" )]
112137 ),
113- TF_ID_PREFIX + "Utility:AP0_to_Rec709-Linear" + TF_ID_SUFFIX ,
138+ TF_ID_PREFIX + "OCIO: Utility:AP0_to_Rec709-Linear" + TF_ID_SUFFIX ,
114139 "AP0 to Rec.709 - Linear" ,
115- dest_dir / (CLF_PREFIX + " Utility.AP0_to_Rec709-Linear" + CLF_SUFFIX ),
140+ dest_dir / ("OCIO. Utility.AP0_to_Rec709-Linear" + CLF_SUFFIX ),
116141 "ACES2065-1" ,
117142 "linear Rec.709 primaries, D65 white point" ,
118143 )
@@ -124,10 +149,9 @@ def generate_clf_utility():
124149 create_gamma (1.8 ),
125150 ]
126151 ),
127- TF_ID_PREFIX + "Utility:AP0_to_Rec709-Gamma1.8" + TF_ID_SUFFIX ,
152+ TF_ID_PREFIX + "OCIO: Utility:AP0_to_Rec709-Gamma1.8" + TF_ID_SUFFIX ,
128153 "AP0 to Rec.709 - Gamma 1.8" ,
129- dest_dir
130- / (CLF_PREFIX + "Utility.AP0_to_Rec709-Gamma1.8" + CLF_SUFFIX ),
154+ dest_dir / ("OCIO.Utility.AP0_to_Rec709-Gamma1.8" + CLF_SUFFIX ),
131155 "ACES2065-1" ,
132156 "1.8 gamma-corrected Rec.709 primaries, D65 white point" ,
133157 )
@@ -139,10 +163,9 @@ def generate_clf_utility():
139163 create_gamma (2.2 ),
140164 ]
141165 ),
142- TF_ID_PREFIX + "Utility:AP0_to_Rec709-Gamma2.2" + TF_ID_SUFFIX ,
166+ TF_ID_PREFIX + "OCIO: Utility:AP0_to_Rec709-Gamma2.2" + TF_ID_SUFFIX ,
143167 "AP0 to Rec.709 - Gamma 2.2" ,
144- dest_dir
145- / (CLF_PREFIX + "Utility.AP0_to_Rec709-Gamma2.2" + CLF_SUFFIX ),
168+ dest_dir / ("OCIO.Utility.AP0_to_Rec709-Gamma2.2" + CLF_SUFFIX ),
146169 "ACES2065-1" ,
147170 "2.2 gamma-corrected Rec.709 primaries, D65 white point" ,
148171 )
@@ -154,10 +177,9 @@ def generate_clf_utility():
154177 create_gamma (2.4 ),
155178 ]
156179 ),
157- TF_ID_PREFIX + "Utility:AP0_to_Rec709-Gamma2.4" + TF_ID_SUFFIX ,
180+ TF_ID_PREFIX + "OCIO: Utility:AP0_to_Rec709-Gamma2.4" + TF_ID_SUFFIX ,
158181 "AP0 to Rec.709 - Gamma 2.4" ,
159- dest_dir
160- / (CLF_PREFIX + "Utility.AP0_to_Rec709-Gamma2.4" + CLF_SUFFIX ),
182+ dest_dir / ("OCIO.Utility.AP0_to_Rec709-Gamma2.4" + CLF_SUFFIX ),
161183 "ACES2065-1" ,
162184 "2.4 gamma-corrected Rec.709 primaries, D65 white point" ,
163185 )
@@ -169,14 +191,15 @@ def generate_clf_utility():
169191 create_gamma (2.2 ),
170192 ]
171193 ),
172- TF_ID_PREFIX + "Utility:AP0_to_AP1-Gamma2.2" + TF_ID_SUFFIX ,
194+ TF_ID_PREFIX + "OCIO: Utility:AP0_to_AP1-Gamma2.2" + TF_ID_SUFFIX ,
173195 "AP0 to AP1 - Gamma 2.2" ,
174- dest_dir / (CLF_PREFIX + " Utility.AP0_to_AP1-Gamma2.2" + CLF_SUFFIX ),
196+ dest_dir / ("OCIO. Utility.AP0_to_AP1-Gamma2.2" + CLF_SUFFIX ),
175197 "ACES2065-1" ,
176198 "2.2 gamma-corrected AP1 primaries, D60 white point" ,
177199 )
178200
179201
180202if __name__ == "__main__" :
181- generate_clf_input ()
203+ generate_clf_ocio_input ()
204+ generate_clf_vendor_input ()
182205 generate_clf_utility ()
0 commit comments