X-Git-Url: http://users.mur.at/ms/git/gitweb/?a=blobdiff_plain;f=aces_1.0.0%2Fpython%2Faces_ocio%2Fcolorspaces%2Fgopro.py;h=fbcafb815f4f46d090189e789aef599aa0873767;hb=008ab628a49b703cd1141a39b7963947adce9e99;hp=b20853715038f6eeb524b7a0a7c7267be9b2940e;hpb=9404c06b163b18672794ced12638b6063fc2b8dd;p=OpenColorIO-Configs.git diff --git a/aces_1.0.0/python/aces_ocio/colorspaces/gopro.py b/aces_1.0.0/python/aces_ocio/colorspaces/gopro.py index b208537..fbcafb8 100644 --- a/aces_1.0.0/python/aces_ocio/colorspaces/gopro.py +++ b/aces_1.0.0/python/aces_ocio/colorspaces/gopro.py @@ -28,33 +28,40 @@ __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 if gamut == '': - name = '%s' % transfer_function + name = 'Curve - %s' % transfer_function cs = ColorSpace(name) cs.description = name @@ -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