Added documentation for individual functions
[OpenColorIO-Configs.git] / aces_1.0.0 / python / aces_ocio / colorspaces / gopro.py
index 0f822b4..fbcafb8 100644 (file)
@@ -28,28 +28,35 @@ __all__ = ['create_protune',
 
 def create_protune(gamut,
                    transfer_function,
-                   name,
                    lut_directory,
                    lut_resolution_1d,
                    aliases):
     """
-    Object description.
-
-    Protune to ACES.
+    Creates colorspace covering the conversion from ProTune to ACES, with various transfer 
+    functions and encoding gamuts covered
 
     Parameters
     ----------
-    parameter : type
-        Parameter description.
+    gamut : str
+        The name of the encoding gamut to use.
+    transfer_function : str
+        The name of the transfer function to use
+    lut_directory : str or unicode 
+        The directory to use when generating LUTs
+    lut_resolution_1d : int
+        The resolution of generated 1D LUTs
+    aliases : list of str
+        Aliases for this colorspace
 
     Returns
     -------
-    type
-         Return value description.
+    ColorSpace
+         A ColorSpace container class referencing the LUTs, matrices and identifying
+         information for the requested colorspace.
     """
 
-    # The gamut should be marked as experimental until
-    # matrices are fully verified
+    # The gamut should be marked as experimental until  matrices are fully
+    # verified.
     name = '%s - %s - Experimental' % (transfer_function, gamut)
     if transfer_function == '':
         name = 'Linear - %s - Experimental' % gamut
@@ -63,7 +70,7 @@ def create_protune(gamut,
     cs.family = 'Input/GoPro'
     cs.is_data = False
 
-    # A linear space needs allocation variables
+    # A linear space needs allocation variables.
     if transfer_function == '':
         cs.allocation_type = ocio.Constants.ALLOCATION_LG2
         cs.allocation_vars = [-8, 5, 0.00390625]
@@ -72,7 +79,7 @@ def create_protune(gamut,
         c1 = 113.0
         c2 = 1.0
         c3 = 112.0
-        linear = ((pow(c1, (normalized_code_value)) - c2) / c3)
+        linear = ((pow(c1, normalized_code_value) - c2) / c3)
 
         return linear
 
@@ -99,7 +106,7 @@ def create_protune(gamut,
             'interpolation': 'linear',
             'direction': 'forward'})
 
-    if gamut == 'Protune Gamut':
+    if gamut == 'Protune Native':
         cs.to_reference_transforms.append({
             'type': 'matrix',
             'matrix': [0.533448429, 0.32413911, 0.142412421, 0,
@@ -118,13 +125,15 @@ def create_colorspaces(lut_directory, lut_resolution_1d):
 
     Parameters
     ----------
-    parameter : type
-        Parameter description.
+    lut_directory : str or unicode 
+        The directory to use when generating LUTs
+    lut_resolution_1d : int
+        The resolution of generated 1D LUTs
 
     Returns
     -------
-    type
-         Return value description.
+    list
+         A list of colorspaces for GoPro cameras and encodings 
     """
 
     colorspaces = []
@@ -133,30 +142,27 @@ def create_colorspaces(lut_directory, lut_resolution_1d):
     protune_1 = create_protune(
         'Protune Native',
         'Protune Flat',
-        'Protune',
         lut_directory,
         lut_resolution_1d,
-        ["protuneflat_protunegamutexp"])
+        ['protuneflat_protunegamutexp'])
     colorspaces.append(protune_1)
 
     # Linearization Only
     protune_2 = create_protune(
         '',
         'Protune Flat',
-        'Protune',
         lut_directory,
         lut_resolution_1d,
-        ["crv_protuneflat"])
+        ['crv_protuneflat'])
     colorspaces.append(protune_2)
 
     # Primaries Only
     protune_3 = create_protune(
         'Protune Native',
         '',
-        'Protune',
         lut_directory,
         lut_resolution_1d,
-        ["lin_protunegamutexp"])
+        ['lin_protunegamutexp'])
     colorspaces.append(protune_3)
 
     return colorspaces