using dcamprof '-s' matrix finding
[OpenColorIO-Configs.git] / aces_1.0.1 / python / aces_ocio / colorspaces / panasonic_gh4.py
index b5cdf28..11611fa 100644 (file)
@@ -220,7 +220,8 @@ def create_gh4_style(gamut,
                      lut_directory,
                      lut_resolution_1d,
                      aliases,
                      lut_directory,
                      lut_resolution_1d,
                      aliases,
-                     style=None):
+                     style=None,
+                     variant=''):
     """
     Creates colorspace covering the conversion from GH4 picture styles 
     to ACES based on empirical data
     """
     Creates colorspace covering the conversion from GH4 picture styles 
     to ACES based on empirical data
@@ -237,6 +238,10 @@ def create_gh4_style(gamut,
         The resolution of generated 1D LUTs
     aliases : list of str
         Aliases for this colorspace
         The resolution of generated 1D LUTs
     aliases : list of str
         Aliases for this colorspace
+    style : str
+        Associated Photo Style
+    variant : str
+        Variant of processing
 
     Returns
     -------
 
     Returns
     -------
@@ -245,9 +250,9 @@ def create_gh4_style(gamut,
     and identifying information for the requested colorspace.
     """
 
     and identifying information for the requested colorspace.
     """
 
-    name = 'GH4-%s - GH4-%s-Gamut' % (transfer_function, gamut)
+    name = ('GH4-%s - GH4-%s-Gamut %s' % (transfer_function, gamut, variant)).strip()
     if transfer_function == '':
     if transfer_function == '':
-        name = 'Linear - GH4-%s-Gamut' % gamut
+        name = ('Linear - GH4-%s-Gamut %s' % (gamut, variant)).strip()
     if gamut == '':
         name = 'Curve - GH4-%s' % transfer_function
 
     if gamut == '':
         name = 'Curve - GH4-%s' % transfer_function
 
@@ -344,20 +349,23 @@ def create_gh4_style(gamut,
                        0, 0, 0, 1.0],
             'direction': 'forward'})
 
                        0, 0, 0, 1.0],
             'direction': 'forward'})
 
-        if gamut.endswith('XYZ'):
+        if variant == ('XYZ'):
             cs.from_reference_transforms = []
             return cs
 
             cs.from_reference_transforms = []
             return cs
 
-        if gamut.endswith('Calibrated'):
+        if variant == ('Calibrated'):
             wb = [0.]*16
             wb = [0.]*16
-            wb[0] = calibration_wb[style][0]
-            wb[5] = calibration_wb[style][1]
-            wb[10] = calibration_wb[style][2]
+            wb[0] = 1/calibration_wb[style][0]
+            wb[5] = 1/calibration_wb[style][1]
+            wb[10] = 1/calibration_wb[style][2]
             wb[15] = 1.0
             cs.to_reference_transforms.append({
                 'type': 'matrix',
                 'matrix': wb,
                 'direction': 'forward'})
             wb[15] = 1.0
             cs.to_reference_transforms.append({
                 'type': 'matrix',
                 'matrix': wb,
                 'direction': 'forward'})
+
+            # calibrat_matrices = clibration_matrices_argyll
+            
             cs.to_reference_transforms.append({
                 'type': 'matrix',
                 'matrix': (calibration_matrices[style][0] + [0.0] +
             cs.to_reference_transforms.append({
                 'type': 'matrix',
                 'matrix': (calibration_matrices[style][0] + [0.0] +
@@ -371,14 +379,14 @@ def create_gh4_style(gamut,
         # colour.chromatic_adaptation_matrix_VonKries(
         #   colour.xy_to_XYZ(colour.ILLUMINANTS[
         #     'CIE 1931 2 Degree Standard Observer']['D50']),
         # colour.chromatic_adaptation_matrix_VonKries(
         #   colour.xy_to_XYZ(colour.ILLUMINANTS[
         #     'CIE 1931 2 Degree Standard Observer']['D50']),
-        #   colour.xy_to_XYZ(colour.V_GAMUT_COLOURSPACE.whitepoint),
+        #   colour.xy_to_XYZ(colour.ACES_2065_1_COLOURSPACE.whitepoint),
         #   'CAT02')
         
         cs.to_reference_transforms.append({
             'type': 'matrix',
         #   'CAT02')
         
         cs.to_reference_transforms.append({
             'type': 'matrix',
-            'matrix': [ 0.95991641, -0.02931741,  0.06566143, 0.0,
-                        -0.02119542,  0.99887268,  0.02613247, 0.0,
-                        0.00137075,  0.00443593,  1.31260073, 0.0,
+            'matrix': [ 9.71197151e-01,  -2.17328334e-02,  4.59761326e-02, 0.0,
+                        -1.56890302e-02,  1.00002082e+00,  1.83070138e-02, 0.0,
+                        9.70076767e-04,   3.08175255e-03,  1.21767128e+00, 0.0,
                         0, 0, 0, 1.0],
             'direction': 'forward'})
 
                         0, 0, 0, 1.0],
             'direction': 'forward'})
 
@@ -464,11 +472,12 @@ def create_colorspaces(lut_directory, lut_resolution_1d):
 
         # Linearization and XYZ conversion
         style_3 = create_gh4_style(
 
         # Linearization and XYZ conversion
         style_3 = create_gh4_style(
-            '%s-XYZ' % style,
+            '%s' % style,
             style,
             lut_directory,
             lut_resolution_1d,
             style,
             lut_directory,
             lut_resolution_1d,
-            ['gh4_%s_xyz' % style.lower().replace('-','_')])
+            ['gh4_%s_xyz' % style.lower().replace('-','_')],
+            variant='XYZ')
         colorspaces.append(style_3)
 
         # Primaries Only
         colorspaces.append(style_3)
 
         # Primaries Only
@@ -484,12 +493,13 @@ def create_colorspaces(lut_directory, lut_resolution_1d):
             
             # Full conversion calibrated
             style_5 = create_gh4_style(
             
             # Full conversion calibrated
             style_5 = create_gh4_style(
-                '%s-Calibrated' % style,
+                '%s' % style,
                 style, 
                 lut_directory,
                 lut_resolution_1d,
                 ['gh4_%s_gh4_calibrated_gamut'% style.lower().replace('-','_')],
                 style, 
                 lut_directory,
                 lut_resolution_1d,
                 ['gh4_%s_gh4_calibrated_gamut'% style.lower().replace('-','_')],
-                style)
+                style,
+                variant='Calibrated')
             colorspaces.append(style_5)
 
             # Primaries Only calibrated
             colorspaces.append(style_5)
 
             # Primaries Only calibrated
@@ -499,9 +509,9 @@ def create_colorspaces(lut_directory, lut_resolution_1d):
                 lut_directory,
                 lut_resolution_1d,
                 ['lin_gh4_%s_calibrated_gamut'%style.lower().replace('-','_')],
                 lut_directory,
                 lut_resolution_1d,
                 ['lin_gh4_%s_calibrated_gamut'%style.lower().replace('-','_')],
-                style)
+                style,
+                variant='Calibrated')
             colorspaces.append(style_6)
 
             
     return colorspaces
             colorspaces.append(style_6)
 
             
     return colorspaces
-