Skip to content

Commit f8954ee

Browse files
Add more utility CLFs, refactor RED (#64)
Signed-off-by: Doug Walker <doug.walker@autodesk.com> Co-authored-by: Thomas Mansencal <thomas.mansencal@gmail.com>
1 parent 986a74b commit f8954ee

File tree

11 files changed

+65768
-28
lines changed

11 files changed

+65768
-28
lines changed

opencolorio_config_aces/clf/transforms/ocio/generate.py

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
__all__ = [
2828
"generate_clf_ocio_input",
29-
"generate_clf_vendor_input",
3029
"generate_clf_utility",
3130
]
3231

@@ -60,28 +59,6 @@ def generate_clf_ocio_input():
6059
)
6160

6261

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-
8562
def generate_clf_utility():
8663
"""Generate OCIO Utility CLF transforms."""
8764

@@ -107,6 +84,28 @@ def generate_clf_utility():
10784
"generic gamma-corrected RGB",
10885
)
10986

87+
generate_clf(
88+
ocio.GroupTransform(transforms=[create_gamma("Rec709")]),
89+
TF_ID_PREFIX + "OCIO:Utility:Linear_to_Rec709-Camera" + TF_ID_SUFFIX,
90+
"Linear to Rec709-Camera",
91+
dest_dir / ("OCIO.Utility.Linear_to_Rec709-Camera" + CLF_SUFFIX),
92+
"generic linear RGB",
93+
"generic gamma-corrected RGB",
94+
)
95+
96+
generate_clf(
97+
ocio.GroupTransform(
98+
transforms=[
99+
ocio.BuiltinTransform(style="CURVE - LINEAR_to_ST-2084")
100+
]
101+
),
102+
TF_ID_PREFIX + "OCIO:Utility:Linear_to_ST2084" + TF_ID_SUFFIX,
103+
"Linear to ST2084",
104+
dest_dir / ("OCIO.Utility.Linear_to_ST2084" + CLF_SUFFIX),
105+
"generic linear RGB",
106+
"generic ST2084 (PQ) encoded RGB",
107+
)
108+
110109
generate_clf(
111110
ocio.GroupTransform(
112111
transforms=[create_conversion_matrix("ACES2065-1", "P3-D65")]
@@ -184,6 +183,20 @@ def generate_clf_utility():
184183
"2.4 gamma-corrected Rec.709 primaries, D65 white point",
185184
)
186185

186+
generate_clf(
187+
ocio.GroupTransform(
188+
transforms=[
189+
create_conversion_matrix("ACES2065-1", "ITU-R BT.709"),
190+
create_gamma("Rec709"),
191+
]
192+
),
193+
TF_ID_PREFIX + "OCIO:Utility:AP0_to_Rec709-Camera" + TF_ID_SUFFIX,
194+
"AP0 to Rec.709 - Camera",
195+
dest_dir / ("OCIO.Utility.AP0_to_Rec709-Camera" + CLF_SUFFIX),
196+
"ACES2065-1",
197+
"Rec.709 camera OETF Rec.709 primaries, D65 white point",
198+
)
199+
187200
generate_clf(
188201
ocio.GroupTransform(
189202
transforms=[
@@ -201,5 +214,4 @@ def generate_clf_utility():
201214

202215
if __name__ == "__main__":
203216
generate_clf_ocio_input()
204-
generate_clf_vendor_input()
205217
generate_clf_utility()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ProcessList compCLFversion="3" id="urn:aswf:ocio:transformId:1.0:OCIO:Utility:AP0_to_Rec709-Camera:1.0" name="AP0 to Rec.709 - Camera">
3+
<InputDescriptor>ACES2065-1</InputDescriptor>
4+
<OutputDescriptor>Rec.709 camera OETF Rec.709 primaries, D65 white point</OutputDescriptor>
5+
<Matrix inBitDepth="32f" outBitDepth="32f">
6+
<Array dim="3 3">
7+
2.52168618674388 -1.13413098823972 -0.387555198504163
8+
-0.276479914229922 1.37271908766826 -0.096239173438334
9+
-0.0153780649660342 -0.152975335867399 1.16835340083343
10+
</Array>
11+
</Matrix>
12+
<Exponent inBitDepth="32f" outBitDepth="32f" style="monCurveRev">
13+
<ExponentParams exponent="2.22222222222222" offset="0.099" />
14+
</Exponent>
15+
</ProcessList>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ProcessList compCLFversion="3" id="urn:aswf:ocio:transformId:1.0:OCIO:Utility:Linear_to_Rec709-Camera:1.0" name="Linear to Rec709-Camera">
3+
<InputDescriptor>generic linear RGB</InputDescriptor>
4+
<OutputDescriptor>generic gamma-corrected RGB</OutputDescriptor>
5+
<Exponent inBitDepth="32f" outBitDepth="32f" style="monCurveRev">
6+
<ExponentParams exponent="2.22222222222222" offset="0.099" />
7+
</Exponent>
8+
</ProcessList>

0 commit comments

Comments
 (0)