X-Git-Url: http://users.mur.at/ms/git/gitweb/?p=OpenColorIO-Configs.git;a=blobdiff_plain;f=aces_1.0.0%2Fpython%2Faces_ocio%2Fcreate_general_colorspaces.py;h=a8bb7b9a3642ef29c9b84e247ebca654753e5b3c;hp=410f8443033a3c961e27b6048d53d333f7dd68f4;hb=f35f56a24d1a4ef67aeebd51c6211425976370ab;hpb=89360f70a6c71121580324ed3c125a83c3973887 diff --git a/aces_1.0.0/python/aces_ocio/create_general_colorspaces.py b/aces_1.0.0/python/aces_ocio/create_general_colorspaces.py index 410f844..a8bb7b9 100644 --- a/aces_1.0.0/python/aces_ocio/create_general_colorspaces.py +++ b/aces_1.0.0/python/aces_ocio/create_general_colorspaces.py @@ -7,6 +7,8 @@ Implements support for general colorspaces conversions and transfer functions. from __future__ import division +import PyOpenColorIO as ocio + import aces_ocio.create_aces_colorspaces as aces from aces_ocio.utilities import ColorSpace, mat44_from_mat33 @@ -21,7 +23,9 @@ __status__ = 'Production' __all__ = ['create_generic_matrix', 'create_colorspaces'] - +# ------------------------------------------------------------------------- +# *Simple Matrix Transform* +# ------------------------------------------------------------------------- def create_generic_matrix(name='matrix', from_reference_values=None, to_reference_values=None, @@ -53,6 +57,10 @@ def create_generic_matrix(name='matrix', cs.family = 'Utility' cs.is_data = False + # A linear space needs allocation variables + cs.allocation_type = ocio.Constants.ALLOCATION_LG2 + cs.allocation_vars = [-8, 5, 0.00390625] + cs.to_reference_transforms = [] if to_reference_values: for matrix in to_reference_values: @@ -71,7 +79,6 @@ def create_generic_matrix(name='matrix', return cs - def create_colorspaces(lut_directory, lut_resolution_1d, lut_resolution_3d): @@ -92,6 +99,7 @@ def create_colorspaces(lut_directory, colorspaces = [] cs = create_generic_matrix('XYZ', + to_reference_values=[aces.ACES_XYZ_TO_AP0], from_reference_values=[aces.ACES_AP0_TO_XYZ], aliases=["lin_xyz"]) colorspaces.append(cs) @@ -99,6 +107,7 @@ def create_colorspaces(lut_directory, cs = create_generic_matrix( 'Linear - AP1', to_reference_values=[aces.ACES_AP1_TO_AP0], + from_reference_values=[aces.ACES_AP0_TO_AP1], aliases=["lin_ap1"]) colorspaces.append(cs) @@ -152,7 +161,7 @@ def create_colorspaces(lut_directory, -0.0032853314, 0.0099796402, 0.9933056912] cs = create_generic_matrix( - 'Linear - ProPhoto', + 'Linear - RIMM ROMM (ProPhoto)', from_reference_values=[AP0_to_RIMM], aliases=["lin_prophoto", "lin_rimm"]) colorspaces.append(cs) @@ -168,6 +177,7 @@ def create_colorspaces(lut_directory, aliases=["lin_adobergb"]) colorspaces.append(cs) + # *ACES* to *Linear*, *Adobe Wide Gamut RGB* primaries. AP0_to_ADOBERGB = [1.3809814778, -0.1158594573, -0.2651220205, 0.0057015535, 1.0402949043, -0.0459964578, @@ -180,3 +190,17 @@ def create_colorspaces(lut_directory, colorspaces.append(cs) return colorspaces + +def create_raw(): + # *Raw* utility space + name = "Raw" + raw = ColorSpace(name) + raw.description = 'The %s color space' % name + raw.aliases = [] + raw.equality_group = name + raw.family = 'Utility' + raw.is_data = True + + return raw + +