config.setDescription('An ACES config generated from python')
# Setting configuration search path.
- searchPath = ['luts']
+ search_path = ['luts']
if custom_lut_dir:
- searchPath.append('custom')
- config.setSearchPath(':'.join(searchPath))
+ search_path.append('custom')
+ config.setSearchPath(':'.join(search_path))
# Defining the reference colorspace.
reference_data = config_data['referenceColorSpace']
display_cleaned = '%s with %s' % (
display_cleaned, look_names)
- viewsWithLooksAtEnd = False
+ views_with_looks_at_end = False
# Storing combo of display, view and colorspace name
# in a list so we can add them to the end of the list.
- if viewsWithLooksAtEnd:
+ if views_with_looks_at_end:
displays_views_colorspaces.append(
[single_display_name, display_cleaned,
colorspace.name])
views.append(display_cleaned)
# Add to config any display, view combinations that were saved
- # for later. This list will be empty unless viewsWithLooksAtEnd is
+ # for later. This list will be empty unless views_with_looks_at_end is
# set to True above.
for display_view_colorspace in displays_views_colorspaces:
single_display_name, display_cleaned, colorspace_name = (
# -------------------------------------------------------------------------
# *ARRI Log-C* to *ACES*.
- arri_colorSpaces = arri.create_colorspaces(lut_directory,
+ arri_colorspaces = arri.create_colorspaces(lut_directory,
lut_resolution_1d)
- for cs in arri_colorSpaces:
+ for cs in arri_colorspaces:
config_data['colorSpaces'].append(cs)
# *Canon-Log* to *ACES*.
config_data['colorSpaces'].append(cs)
# *Panasonic V-Log* to *ACES*.
- panasonic_colorSpaces = panasonic.create_colorspaces(lut_directory,
+ panasonic_colorspaces = panasonic.create_colorspaces(lut_directory,
lut_resolution_1d)
- for cs in panasonic_colorSpaces:
+ for cs in panasonic_colorspaces:
config_data['colorSpaces'].append(cs)
# *RED* colorspaces to *ACES*.
config_data['colorSpaces'].append(cs)
# *S-Log* to *ACES*.
- sony_colorSpaces = sony.create_colorspaces(lut_directory,
+ sony_colorspaces = sony.create_colorspaces(lut_directory,
lut_resolution_1d)
- for cs in sony_colorSpaces:
+ for cs in sony_colorspaces:
config_data['colorSpaces'].append(cs)
# -------------------------------------------------------------------------
# General Color Spaces
# -------------------------------------------------------------------------
- general_colorSpaces = general.create_colorspaces(lut_directory,
+ general_colorspaces = general.create_colorspaces(lut_directory,
lut_resolution_1d,
lut_resolution_3d)
- for cs in general_colorSpaces:
+ for cs in general_colorspaces:
config_data['colorSpaces'].append(cs)
# The *Raw* color space
def create_config_dir(config_directory,
- bake_secondary_LUTs=False,
+ bake_secondary_luts=False,
custom_lut_dir=None):
"""
Object description.
lut_directory = os.path.join(config_directory, 'luts')
dirs = [config_directory, lut_directory]
- if bake_secondary_LUTs:
+ if bake_secondary_luts:
dirs.extend([os.path.join(config_directory, 'baked'),
os.path.join(config_directory, 'baked', 'flame'),
os.path.join(config_directory, 'baked', 'photoshop'),
config_directory,
lut_resolution_1d=4096,
lut_resolution_3d=64,
- bake_secondary_LUTs=True,
+ bake_secondary_luts=True,
multiple_displays=False,
look_info=None,
copy_custom_luts=True,
custom_lut_dir = os.path.join(config_directory, 'custom')
lut_directory = create_config_dir(config_directory,
- bake_secondary_LUTs,
+ bake_secondary_luts,
custom_lut_dir)
odt_info = aces.get_ODTs_info(aces_ctl_directory)
write_config(config,
os.path.join(config_directory, 'config.ocio'))
- if bake_secondary_LUTs:
+ if bake_secondary_luts:
generate_baked_LUTs(odt_info,
shaper_name,
os.path.join(config_directory, 'baked'),
# Copied from *Alex Fry*'s *adx_cid_to_rle.py*
def create_CID_to_RLE_LUT():
- def interpolate_1D(x, xp, fp):
+ def interpolate_1d(x, xp, fp):
return numpy.interp(x, xp, fp)
- LUT_1D_xp = [-0.190000000000000,
+ LUT_1D_XP = [-0.190000000000000,
0.010000000000000,
0.028000000000000,
0.054000000000000,
0.500000000000000,
0.600000000000000]
- LUT_1D_fp = [-6.000000000000000,
+ LUT_1D_FP = [-6.000000000000000,
-2.721718645000000,
-2.521718645000000,
-2.321718645000000,
def cid_to_rle(x):
if x <= 0.6:
- return interpolate_1D(x, LUT_1D_xp, LUT_1D_fp)
+ return interpolate_1d(x, LUT_1D_XP, LUT_1D_FP)
return (100 / 55) * x - REF_PT
def fit(value, from_min, from_max, to_min, to_max):
# -------------------------------------------------------------------------
# *base Dolby PQ Transform*
# -------------------------------------------------------------------------
-def create_dolbypq(aces_CTL_directory,
+def create_Dolby_PQ(aces_ctl_directory,
lut_directory,
lut_resolution_1d,
cleanup,
cs.is_data = False
ctls = [os.path.join(
- aces_CTL_directory,
+ aces_ctl_directory,
'utilities',
'ACESlib.DolbyPQ_to_Lin.a1.0.0.ctl')]
lut = '%s_to_linear.spi1d' % name
1.0,
{},
cleanup,
- aces_CTL_directory,
+ aces_ctl_directory,
min_value,
max_value)
# -------------------------------------------------------------------------
# *Dolby PQ Transform that considers a fixed linear range*
# -------------------------------------------------------------------------
-def create_dolbypq_scaled(aces_CTL_directory,
+def create_Dolby_PQ_scaled(aces_ctl_directory,
lut_directory,
lut_resolution_1d,
cleanup,
cs.is_data = False
ctls = [os.path.join(
- aces_CTL_directory,
+ aces_ctl_directory,
'utilities',
'ACESlib.DolbyPQ_to_lin_param.a1.0.0.ctl')]
lut = '%s_to_linear.spi1d' % name
'minExposure': min_exposure,
'maxExposure': max_exposure},
cleanup,
- aces_CTL_directory,
+ aces_ctl_directory,
min_value,
max_value)
# Generating the *shaper* transform.
(shaper_name,
- shaper_to_ACES_CTL,
- shaper_from_ACES_CTL,
+ shaper_to_aces_ctl,
+ shaper_from_aces_ctl,
shaper_input_scale,
shaper_params) = shaper_info
shaper_lut = '%s_to_linear.spi1d' % shaper_name
shaper_lut = sanitize(shaper_lut)
- shaper_OCIO_transform = {
+ shaper_ocio_transform = {
'type': 'lutFile',
'path': shaper_lut,
'interpolation': 'linear',
cs.from_reference_transforms = []
if 'transformCTL' in lmt_values:
- ctls = [shaper_to_ACES_CTL % aces_ctl_directory,
+ ctls = [shaper_to_aces_ctl % aces_ctl_directory,
os.path.join(aces_ctl_directory,
lmt_values['transformCTL'])]
lut = '%s.%s.spi3d' % (shaper_name, lmt_name)
cleanup,
aces_ctl_directory)
- cs.from_reference_transforms.append(shaper_OCIO_transform)
+ cs.from_reference_transforms.append(shaper_ocio_transform)
cs.from_reference_transforms.append({
'type': 'lutFile',
'path': lut,
if 'transformCTLInverse' in lmt_values:
ctls = [os.path.join(aces_ctl_directory,
lmt_values['transformCTLInverse']),
- shaper_from_ACES_CTL % aces_ctl_directory]
+ shaper_from_aces_ctl % aces_ctl_directory]
lut = 'Inverse.%s.%s.spi3d' % (odt_name, shaper_name)
lut = sanitize(lut)
'interpolation': 'tetrahedral',
'direction': 'forward'})
- shaper_inverse = shaper_OCIO_transform.copy()
+ shaper_inverse = shaper_ocio_transform.copy()
shaper_inverse['direction'] = 'forward'
cs.to_reference_transforms.append(shaper_inverse)
shaper_input_scale_generic_log2,
lmt_params]
- sorted_LMTs = sorted(lmt_info.iteritems(), key=lambda x: x[1])
- print(sorted_LMTs)
- for lmt in sorted_LMTs:
+ sorted_lmts = sorted(lmt_info.iteritems(), key=lambda x: x[1])
+ print(sorted_lmts)
+ for lmt in sorted_lmts:
lmt_name, lmt_values = lmt
lmt_aliases = ['look_%s' % compact(lmt_values['transformUserName'])]
cs = create_ACES_LMT(
# Generating the *shaper* transform.
(shaper_name,
- shaper_to_ACES_CTL,
- shaper_from_ACES_CTL,
+ shaper_to_aces_ctl,
+ shaper_from_aces_ctl,
shaper_input_scale,
shaper_params) = shaper_info
shaper_lut = '%s_to_linear.spi1d' % shaper_name
shaper_lut = sanitize(shaper_lut)
- shaper_OCIO_transform = {
+ shaper_ocio_transform = {
'type': 'lutFile',
'path': shaper_lut,
'interpolation': 'linear',
cs.from_reference_transforms = []
if 'transformLUT' in odt_values:
- transform_LUT_file_name = os.path.basename(
+ transform_lut_file_name = os.path.basename(
odt_values['transformLUT'])
- lut = os.path.join(lut_directory, transform_LUT_file_name)
+ lut = os.path.join(lut_directory, transform_lut_file_name)
shutil.copy(odt_values['transformLUT'], lut)
- cs.from_reference_transforms.append(shaper_OCIO_transform)
+ cs.from_reference_transforms.append(shaper_ocio_transform)
cs.from_reference_transforms.append({
'type': 'lutFile',
- 'path': transform_LUT_file_name,
+ 'path': transform_lut_file_name,
'interpolation': 'tetrahedral',
'direction': 'forward'})
elif 'transformCTL' in odt_values:
ctls = [
- shaper_to_ACES_CTL % aces_ctl_directory,
+ shaper_to_aces_ctl % aces_ctl_directory,
os.path.join(aces_ctl_directory,
'rrt',
'RRT.a1.0.0.ctl'),
cleanup,
aces_ctl_directory)
- cs.from_reference_transforms.append(shaper_OCIO_transform)
+ cs.from_reference_transforms.append(shaper_ocio_transform)
cs.from_reference_transforms.append({
'type': 'lutFile',
'path': lut,
cs.to_reference_transforms = []
if 'transformLUTInverse' in odt_values:
- transform_LUT_inverse_file_name = os.path.basename(
+ transform_lut_inverse_file_name = os.path.basename(
odt_values['transformLUTInverse'])
- lut = os.path.join(lut_directory, transform_LUT_inverse_file_name)
+ lut = os.path.join(lut_directory, transform_lut_inverse_file_name)
shutil.copy(odt_values['transformLUTInverse'], lut)
cs.to_reference_transforms.append({
'type': 'lutFile',
- 'path': transform_LUT_inverse_file_name,
+ 'path': transform_lut_inverse_file_name,
'interpolation': 'tetrahedral',
'direction': 'forward'})
- shaper_inverse = shaper_OCIO_transform.copy()
+ shaper_inverse = shaper_ocio_transform.copy()
shaper_inverse['direction'] = 'forward'
cs.to_reference_transforms.append(shaper_inverse)
elif 'transformCTLInverse' in odt_values:
os.path.join(aces_ctl_directory,
'rrt',
'InvRRT.a1.0.0.ctl'),
- shaper_from_ACES_CTL % aces_ctl_directory]
+ shaper_from_aces_ctl % aces_ctl_directory]
lut = 'InvRRT.a1.0.0.%s.%s.spi3d' % (odt_name, shaper_name)
lut = sanitize(lut)
'interpolation': 'tetrahedral',
'direction': 'forward'})
- shaper_inverse = shaper_OCIO_transform.copy()
+ shaper_inverse = shaper_ocio_transform.copy()
shaper_inverse['direction'] = 'forward'
cs.to_reference_transforms.append(shaper_inverse)
dolbypq_shaper_name = 'Dolby PQ 10000'
dolbypq_shaper_name_aliases = ['crv_%s' % 'dolbypq_10000']
- dolbypq_shaper_colorspace = create_dolbypq(
+ dolbypq_shaper_colorspace = create_Dolby_PQ(
aces_ctl_directory,
lut_directory,
lut_resolution_1d,
dolbypq_scaled_shaper_name = 'Dolby PQ Scaled'
dolbypq_scaled_shaper_name_aliases = ['crv_%s' % 'dolbypq_scaled']
- dolbypq_scaled_shaper_colorspace = create_dolbypq_scaled(
+ dolbypq_scaled_shaper_colorspace = create_Dolby_PQ_scaled(
aces_ctl_directory,
lut_directory,
lut_resolution_1d,
for fname in file_list:
all_odt.append((os.path.join(dir_name, fname)))
- odt_CTLs = [x for x in all_odt if
+ odt_ctls = [x for x in all_odt if
('InvODT' not in x) and (os.path.split(x)[-1][0] != '.')]
odts = {}
- for odt_CTL in odt_CTLs:
- odt_tokens = os.path.split(odt_CTL)
+ for odt_ctl in odt_ctls:
+ odt_tokens = os.path.split(odt_ctl)
# Handling nested directories.
odt_path_tokens = os.path.split(odt_tokens[-2])
odt_dir = os.path.join(odt_path_tokens[-1], odt_dir)
# Building full name,
- transform_CTL = odt_tokens[-1]
- odt_name = string.join(transform_CTL.split('.')[1:-1], '.')
+ transform_ctl = odt_tokens[-1]
+ odt_name = string.join(transform_ctl.split('.')[1:-1], '.')
# Finding id, user name and user name prefix.
- (transform_ID,
+ (transform_id,
transform_user_name,
transform_user_name_prefix,
transform_full_legal_switch) = get_transform_info(
- os.path.join(aces_ctl_directory, 'odt', odt_dir, transform_CTL))
+ os.path.join(aces_ctl_directory, 'odt', odt_dir, transform_ctl))
# Finding inverse.
- transform_CTL_inverse = 'InvODT.%s.ctl' % odt_name
+ transform_ctl_inverse = 'InvODT.%s.ctl' % odt_name
if not os.path.exists(
- os.path.join(odt_tokens[-2], transform_CTL_inverse)):
- transform_CTL_inverse = None
+ os.path.join(odt_tokens[-2], transform_ctl_inverse)):
+ transform_ctl_inverse = None
# Add to list of ODTs
odts[odt_name] = {}
- odts[odt_name]['transformCTL'] = os.path.join(odt_dir, transform_CTL)
- if transform_CTL_inverse is not None:
+ odts[odt_name]['transformCTL'] = os.path.join(odt_dir, transform_ctl)
+ if transform_ctl_inverse is not None:
odts[odt_name]['transformCTLInverse'] = os.path.join(
- odt_dir, transform_CTL_inverse)
+ odt_dir, transform_ctl_inverse)
- odts[odt_name]['transformID'] = transform_ID
+ odts[odt_name]['transformID'] = transform_id
odts[odt_name]['transformUserNamePrefix'] = transform_user_name_prefix
odts[odt_name]['transformUserName'] = transform_user_name
odts[odt_name][
'transformHasFullLegalSwitch'] = transform_full_legal_switch
- forward_CTL = odts[odt_name]['transformCTL']
+ forward_ctl = odts[odt_name]['transformCTL']
print('ODT : %s' % odt_name)
- print('\tTransform ID : %s' % transform_ID)
+ print('\tTransform ID : %s' % transform_id)
print('\tTransform User Name Prefix : %s' % transform_user_name_prefix)
print('\tTransform User Name : %s' % transform_user_name)
print(
'\tHas Full / Legal Switch : %s' % transform_full_legal_switch)
- print('\tForward ctl : %s' % forward_CTL)
+ print('\tForward ctl : %s' % forward_ctl)
if 'transformCTLInverse' in odts[odt_name]:
- inverse_CTL = odts[odt_name]['transformCTLInverse']
- print('\tInverse ctl : %s' % inverse_CTL)
+ inverse_ctl = odts[odt_name]['transformCTLInverse']
+ print('\tInverse ctl : %s' % inverse_ctl)
else:
print('\tInverse ctl : %s' % 'None')
for fname in file_list:
all_lmt.append((os.path.join(dir_name, fname)))
- lmt_CTLs = [x for x in all_lmt if
+ lmt_ctls = [x for x in all_lmt if
('InvLMT' not in x) and ('README' not in x) and (
os.path.split(x)[-1][0] != '.')]
lmts = {}
- for lmt_CTL in lmt_CTLs:
- lmt_tokens = os.path.split(lmt_CTL)
+ for lmt_ctl in lmt_ctls:
+ lmt_tokens = os.path.split(lmt_ctl)
# Handlimg nested directories.
lmt_path_tokens = os.path.split(lmt_tokens[-2])
lmt_name = string.join(transform_CTL.split('.')[1:-1], '.')
# Finding id, user name and user name prefix.
- (transform_ID,
+ (transform_id,
transform_user_name,
transform_user_name_prefix,
transform_full_legal_switch) = get_transform_info(
os.path.join(aces_ctl_directory, lmt_dir, transform_CTL))
# Finding inverse.
- transform_CTL_inverse = 'InvLMT.%s.ctl' % lmt_name
+ transform_ctl_inverse = 'InvLMT.%s.ctl' % lmt_name
if not os.path.exists(
- os.path.join(lmt_tokens[-2], transform_CTL_inverse)):
- transform_CTL_inverse = None
+ os.path.join(lmt_tokens[-2], transform_ctl_inverse)):
+ transform_ctl_inverse = None
lmts[lmt_name] = {}
lmts[lmt_name]['transformCTL'] = os.path.join(lmt_dir, transform_CTL)
- if transform_CTL_inverse is not None:
+ if transform_ctl_inverse is not None:
lmts[lmt_name]['transformCTLInverse'] = os.path.join(
- lmt_dir, transform_CTL_inverse)
+ lmt_dir, transform_ctl_inverse)
- lmts[lmt_name]['transformID'] = transform_ID
+ lmts[lmt_name]['transformID'] = transform_id
lmts[lmt_name]['transformUserNamePrefix'] = transform_user_name_prefix
lmts[lmt_name]['transformUserName'] = transform_user_name
- forward_CTL = lmts[lmt_name]['transformCTL']
+ forward_ctl = lmts[lmt_name]['transformCTL']
print('LMT : %s' % lmt_name)
- print('\tTransform ID : %s' % transform_ID)
+ print('\tTransform ID : %s' % transform_id)
print('\tTransform User Name Prefix : %s' % transform_user_name_prefix)
print('\tTransform User Name : %s' % transform_user_name)
- print('\t Forward ctl : %s' % forward_CTL)
+ print('\t Forward ctl : %s' % forward_ctl)
if 'transformCTLInverse' in lmts[lmt_name]:
- inverse_CTL = lmts[lmt_name]['transformCTLInverse']
- print('\t Inverse ctl : %s' % inverse_CTL)
+ inverse_ctl = lmts[lmt_name]['transformCTLInverse']
+ print('\t Inverse ctl : %s' % inverse_ctl)
else:
print('\t Inverse ctl : %s' % 'None')
colorspaces.extend(odts)
# Wish there was an automatic way to get this from the CTL
- defaultDisplay = 'sRGB (D60 sim.)'
+ default_display = 'sRGB (D60 sim.)'
roles = {'color_picking': ACEScg.name,
'color_timing': ACEScc.name,
'scene_linear': ACEScg.name,
'texture_paint': ''}
- return ACES, colorspaces, displays, ACEScc, roles, defaultDisplay
+ return ACES, colorspaces, displays, ACEScc, roles, default_display
Return value description.
"""
- ocioFormatsToExtensions = {'cinespace': 'csp',
- 'flame': '3dl',
- 'icc': 'icc',
- 'houdini': 'lut',
- 'lustre': '3dl',
- 'ctl': 'ctl'}
-
- if format in ocioFormatsToExtensions:
- if ocioFormatsToExtensions[format] == 'csp':
+ ocio_formats_to_extensions = {'cinespace': 'csp',
+ 'flame': '3dl',
+ 'icc': 'icc',
+ 'houdini': 'lut',
+ 'lustre': '3dl',
+ 'ctl': 'ctl'}
+
+ if format in ocio_formats_to_extensions:
+ if ocio_formats_to_extensions[format] == 'csp':
write_CSP_1d(filename,
from_min,
from_max,
data_entries,
data_channels,
lut_components)
- elif ocioFormatsToExtensions[format] == 'ctl':
+ elif ocio_formats_to_extensions[format] == 'ctl':
write_CTL_1d(filename,
from_min,
from_max,
if output_path is None:
output_path = '%s.%s' % (ramp_3d_path, 'spi3d')
- ocioFormatsToExtensions = {'cinespace': 'csp',
- 'flame': '3dl',
- 'icc': 'icc',
- 'houdini': 'lut',
- 'lustre': '3dl'}
+ ocio_formats_to_extensions = {'cinespace': 'csp',
+ 'flame': '3dl',
+ 'icc': 'icc',
+ 'houdini': 'lut',
+ 'lustre': '3dl'}
- if format == 'spi3d' or not (format in ocioFormatsToExtensions):
+ if format == 'spi3d' or not (format in ocio_formats_to_extensions):
# Extract a spi3d LUT
args = ['--extract',
'--cubesize',
def generate_1d_LUT_from_CTL(lut_path,
ctl_paths,
lut_resolution=1024,
- identity_LUT_bit_depth='half',
+ identity_lut_bit_depth='half',
input_scale=1,
output_scale=1,
global_params=None,
lut_path_base = os.path.splitext(lut_path)[0]
- identity_LUT_image_float = '%s.%s.%s' % (lut_path_base, 'float', 'tiff')
- generate_1d_LUT_image(identity_LUT_image_float,
+ identity_lut_image_float = '%s.%s.%s' % (lut_path_base, 'float', 'tiff')
+ generate_1d_LUT_image(identity_lut_image_float,
lut_resolution,
min_value,
max_value)
- if identity_LUT_bit_depth not in ['half', 'float']:
- identity_LUT_image = '%s.%s.%s' % (lut_path_base, 'uint16', 'tiff')
- convert_bit_depth(identity_LUT_image_float,
- identity_LUT_image,
- identity_LUT_bit_depth)
+ if identity_lut_bit_depth not in ['half', 'float']:
+ identity_lut_image = '%s.%s.%s' % (lut_path_base, 'uint16', 'tiff')
+ convert_bit_depth(identity_lut_image_float,
+ identity_lut_image,
+ identity_lut_bit_depth)
else:
- identity_LUT_image = identity_LUT_image_float
+ identity_lut_image = identity_lut_image_float
- transformed_LUT_image = '%s.%s.%s' % (lut_path_base, 'transformed', 'exr')
- apply_CTL_to_image(identity_LUT_image,
- transformed_LUT_image,
+ transformed_lut_image = '%s.%s.%s' % (lut_path_base, 'transformed', 'exr')
+ apply_CTL_to_image(identity_lut_image,
+ transformed_lut_image,
ctl_paths,
input_scale,
output_scale,
global_params,
aces_ctl_directory)
- generate_1d_LUT_from_image(transformed_LUT_image,
+ generate_1d_LUT_from_image(transformed_lut_image,
lut_path,
min_value,
max_value,
format)
if cleanup:
- os.remove(identity_LUT_image)
- if identity_LUT_image != identity_LUT_image_float:
- os.remove(identity_LUT_image_float)
- os.remove(transformed_LUT_image)
+ os.remove(identity_lut_image)
+ if identity_lut_image != identity_lut_image_float:
+ os.remove(identity_lut_image_float)
+ os.remove(transformed_lut_image)
-def correct_LUT_image(transformed_LUT_image,
- corrected_LUT_image,
+def correct_LUT_image(transformed_lut_image,
+ corrected_lut_image,
lut_resolution):
"""
Object description.
Return value description.
"""
- transformed = oiio.ImageInput.open(transformed_LUT_image)
+ transformed = oiio.ImageInput.open(transformed_lut_image)
transformed_spec = transformed.spec()
width = transformed_spec.width
height,
lut_resolution * lut_resolution,
lut_resolution))
- print('Generating %s' % corrected_LUT_image)
+ print('Generating %s' % corrected_lut_image)
# Forcibly read data as float, the Python API doesn't handle half-float
# well yet.
type = oiio.FLOAT
source_data = transformed.read_image(type)
- correct = oiio.ImageOutput.create(corrected_LUT_image)
+ correct = oiio.ImageOutput.create(corrected_lut_image)
correct_spec = oiio.ImageSpec()
correct_spec.set_format(oiio.FLOAT)
correct_spec.height = width
correct_spec.nchannels = channels
- correct.open(corrected_LUT_image, correct_spec, oiio.Create)
+ correct.open(corrected_lut_image, correct_spec, oiio.Create)
dest_data = array.array('f',
('\0' * correct_spec.width *
correct.close()
else:
# shutil.copy(transformedLUTImage, correctedLUTImage)
- corrected_LUT_image = transformed_LUT_image
+ corrected_lut_image = transformed_lut_image
transformed.close()
- return corrected_LUT_image
+ return corrected_lut_image
def generate_3d_LUT_from_CTL(lut_path,
ctl_paths,
lut_resolution=64,
- identity_LUT_bit_depth='half',
+ identity_lut_bit_depth='half',
input_scale=1,
output_scale=1,
global_params=None,
lut_path_base = os.path.splitext(lut_path)[0]
- identity_LUT_image_float = '%s.%s.%s' % (lut_path_base, 'float', 'tiff')
- generate_3d_LUT_image(identity_LUT_image_float, lut_resolution)
+ identity_lut_image_float = '%s.%s.%s' % (lut_path_base, 'float', 'tiff')
+ generate_3d_LUT_image(identity_lut_image_float, lut_resolution)
- if identity_LUT_bit_depth not in ['half', 'float']:
- identity_LUT_image = '%s.%s.%s' % (lut_path_base,
- identity_LUT_bit_depth,
+ if identity_lut_bit_depth not in ['half', 'float']:
+ identity_lut_image = '%s.%s.%s' % (lut_path_base,
+ identity_lut_bit_depth,
'tiff')
- convert_bit_depth(identity_LUT_image_float,
- identity_LUT_image,
- identity_LUT_bit_depth)
+ convert_bit_depth(identity_lut_image_float,
+ identity_lut_image,
+ identity_lut_bit_depth)
else:
- identity_LUT_image = identity_LUT_image_float
+ identity_lut_image = identity_lut_image_float
- transformed_LUT_image = '%s.%s.%s' % (lut_path_base, 'transformed', 'exr')
- apply_CTL_to_image(identity_LUT_image,
- transformed_LUT_image,
+ transformed_lut_image = '%s.%s.%s' % (lut_path_base, 'transformed', 'exr')
+ apply_CTL_to_image(identity_lut_image,
+ transformed_lut_image,
ctl_paths,
input_scale,
output_scale,
global_params,
aces_ctl_directory)
- corrected_LUT_image = '%s.%s.%s' % (lut_path_base, 'correct', 'exr')
- corrected_LUT_image = correct_LUT_image(transformed_LUT_image,
- corrected_LUT_image,
+ corrected_lut_image = '%s.%s.%s' % (lut_path_base, 'correct', 'exr')
+ corrected_lut_image = correct_LUT_image(transformed_lut_image,
+ corrected_lut_image,
lut_resolution)
- generate_3d_LUT_from_image(corrected_LUT_image,
+ generate_3d_LUT_from_image(corrected_lut_image,
lut_path,
lut_resolution,
format)
if cleanup:
- os.remove(identity_LUT_image)
- if identity_LUT_image != identity_LUT_image_float:
- os.remove(identity_LUT_image_float)
- os.remove(transformed_LUT_image)
- if corrected_LUT_image != transformed_LUT_image:
- os.remove(corrected_LUT_image)
+ os.remove(identity_lut_image)
+ if identity_lut_image != identity_lut_image_float:
+ os.remove(identity_lut_image_float)
+ os.remove(transformed_lut_image)
+ if corrected_lut_image != transformed_lut_image:
+ os.remove(corrected_lut_image)
if format != 'spi3d':
lut_path_spi3d = '%s.%s' % (lut_path, 'spi3d')
os.remove(lut_path_spi3d)