lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
- lut_directory + '/' + lut,
+ os.path.join(lut_directory, lut),
ctls,
lut_resolution_1d,
'float',
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
- lut_directory + '/' + lut,
+ os.path.join(lut_directory, lut),
ctls,
lut_resolution_1d,
'uint16',
data.append(cid_to_rle(x))
lut = 'ADX_CID_to_RLE.spi1d'
- write_SPI_1d(lut_directory + '/' + lut, RANGE[0], RANGE[1],
+ write_SPI_1d(os.path.join(lut_directory, lut),
+ RANGE[0],
+ RANGE[1],
data,
NUM_SAMPLES, 1)
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
- lut_directory + '/' + lut,
+ os.path.join(lut_directory, lut),
ctls,
lut_resolution_1d,
'float',
shaper_params) = shaper_info
shaper_lut = '%s_to_aces.spi1d' % shaper_name
- if (not os.path.exists(lut_directory + '/' + shaper_lut)):
+ if (not os.path.exists(os.path.join(lut_directory, shaper_lut))):
ctls = [shaper_to_ACES_CTL % aces_CTL_directory]
# Remove spaces and parentheses
' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
- lut_directory + '/' + shaper_lut,
+ os.path.join(lut_directory, shaper_lut),
ctls,
lut_resolution_1d,
'float',
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
- lut_directory + '/' + lut,
+ os.path.join(lut_directory, lut),
ctls,
lut_resolution_3d,
'float',
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
- lut_directory + '/' + lut,
+ os.path.join(lut_directory, lut),
ctls,
lut_resolution_3d,
'half',
shaper_params['legalRange'] = 0
shaper_lut = '%s_to_aces.spi1d' % shaper_name
- if (not os.path.exists(lut_directory + '/' + shaper_lut)):
+ if (not os.path.exists(os.path.join(lut_directory, shaper_lut))):
ctls = [shaper_to_ACES_CTL % aces_CTL_directory]
# Remove spaces and parentheses
' ', '_').replace(')', '_').replace('(', '_')
generate_1d_LUT_from_CTL(
- lut_directory + '/' + shaper_lut,
+ os.path.join(lut_directory, shaper_lut),
ctls,
lut_resolution_1d,
'float',
# Copy into the lut dir
transform_LUT_file_name = os.path.basename(
odt_values['transformLUT'])
- lut = 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)
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
- generate_3d_LUT_from_CTL(lut_directory + '/' + lut,
- # shaperLUT,
- ctls,
- lut_resolution_3d,
- 'float',
- 1.0 / shaper_input_scale,
- 1.0,
- shaper_params,
- cleanup,
- aces_CTL_directory)
+ generate_3d_LUT_from_CTL(
+ os.path.join(lut_directory, lut),
+ # shaperLUT,
+ ctls,
+ lut_resolution_3d,
+ 'float',
+ 1.0 / shaper_input_scale,
+ 1.0,
+ shaper_params,
+ cleanup,
+ aces_CTL_directory)
cs.from_reference_transforms.append(shaper_OCIO_transform)
cs.from_reference_transforms.append({
# Copy into the lut dir
transform_LUT_inverse_file_name = os.path.basename(
odt_values['transformLUTInverse'])
- lut = 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({
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
generate_3d_LUT_from_CTL(
- lut_directory + '/' + lut,
+ os.path.join(lut_directory, lut),
# None,
ctls,
lut_resolution_3d,
import array
import math
+import os
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace, mat44_from_mat33
# Remove spaces and parentheses
lut = lut.replace(' ', '_').replace(')', '_').replace('(', '_')
- genlut.write_SPI_1d(lut_directory + '/' + lut,
- 0.0,
- 1.0,
- data,
- lut_resolution_1d,
- 1)
+ genlut.write_SPI_1d(
+ os.path.join(lut_directory, lut),
+ 0.0,
+ 1.0,
+ data,
+ lut_resolution_1d,
+ 1)
# print('Writing %s' % lut)
cs.to_reference_transforms.append({
cs.to_reference_transforms.append({
'type': 'matrix',
'matrix': mat44_from_mat33([0.680206, 0.236137, 0.083658,
- 0.085415, 1.017471, -0.102886,
- 0.002057, -0.062563, 1.060506]),
+ 0.085415, 1.017471, -0.102886,
+ 0.002057, -0.062563, 1.060506]),
'direction': 'forward'
})
"""
import array
+import os
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace
data[c] = c_log_to_linear(1023.0 * c / (lut_resolution_1d - 1))
lut = '%s_to_linear.spi1d' % transfer_function
- genlut.write_SPI_1d(lut_directory + '/' + lut,
- 0.0,
- 1.0,
- data,
- lut_resolution_1d,
- 1)
+ genlut.write_SPI_1d(
+ os.path.join(lut_directory, lut),
+ 0.0,
+ 1.0,
+ data,
+ lut_resolution_1d,
+ 1)
cs.to_reference_transforms.append({
'type': 'lutFile',
"""
import array
+import os
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace, mat44_from_mat33
data[c] = cineon_to_linear(1023.0 * c / (lut_resolution_1d - 1))
lut = 'CineonLog_to_linear.spi1d'
- genlut.write_SPI_1d(lut_directory + '/' + lut,
- 0.0,
- 1.0,
- data,
- lut_resolution_1d,
- 1)
+ genlut.write_SPI_1d(
+ os.path.join(lut_directory, lut),
+ 0.0,
+ 1.0,
+ data,
+ lut_resolution_1d,
+ 1)
cs.to_reference_transforms.append({
'type': 'lutFile',
"""
import array
+import os
import aces_ocio.generate_lut as genlut
from aces_ocio.utilities import ColorSpace, mat44_from_mat33
data[c] = s_log1_to_linear(1023.0 * c / (lut_resolution_1d - 1))
lut = '%s_to_linear.spi1d' % transfer_function
- genlut.write_SPI_1d(lut_directory + '/' + lut,
- 0.0,
- 1.0,
- data,
- lut_resolution_1d,
- 1)
+ genlut.write_SPI_1d(
+ os.path.join(lut_directory, lut),
+ 0.0,
+ 1.0,
+ data,
+ lut_resolution_1d,
+ 1)
# print('Writing %s' % lut)
data[c] = s_log2_to_linear(1023.0 * c / (lut_resolution_1d - 1))
lut = '%s_to_linear.spi1d' % transfer_function
- genlut.write_SPI_1d(lut_directory + '/' + lut,
- 0.0,
- 1.0,
- data,
- lut_resolution_1d,
- 1)
+ genlut.write_SPI_1d(
+ os.path.join(lut_directory, lut),
+ 0.0,
+ 1.0,
+ data,
+ lut_resolution_1d,
+ 1)
# print('Writing %s' % lut)
data[c] = s_log3_to_linear(1023.0 * c / (lut_resolution_1d - 1))
lut = '%s_to_linear.spi1d' % transfer_function
- genlut.write_SPI_1d(lut_directory + '/' + lut,
- 0.0,
- 1.0,
- data,
- lut_resolution_1d,
- 1)
+ genlut.write_SPI_1d(
+ os.path.join(lut_directory, lut),
+ 0.0,
+ 1.0,
+ data,
+ lut_resolution_1d,
+ 1)
# print('Writing %s' % lut)
"""
if output_path is None:
- output_path = ramp_1d_path + '.spi1d'
+ output_path = '%s.%s' % (ramp_1d_path, 'spi1d')
# open image
ramp = oiio.ImageInput.open(ramp_1d_path)
"""
if output_path is None:
- output_path = ramp_3d_path + '.spi3d'
+ output_path = '%s.%s' % (ramp_3d_path, 'spi1d')
args = ['--extract',
'--cubesize',
lut_path_base = os.path.splitext(lut_path)[0]
- identity_LUT_image_float = lut_path_base + '.float.tiff'
+ 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 != 'half':
- identity_LUT_image = lut_path_base + '.uint16.tiff'
+ 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
- transformed_LUT_image = lut_path_base + '.transformed.exr'
+ transformed_LUT_image = '%s.%s.%s' % (lut_path_base, 'transformed', 'exr')
apply_CTL_to_image(identity_LUT_image,
transformed_LUT_image,
ctl_paths,
lut_path_base = os.path.splitext(lut_path)[0]
- identity_LUT_image_float = lut_path_base + '.float.tiff'
+ 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 != 'half':
- identity_LUT_image = (lut_path_base +
- '.' +
- identity_LUT_bit_depth +
- '.tiff')
+ 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)
else:
identity_LUT_image = identity_LUT_image_float
- transformed_LUT_image = lut_path_base + '.transformed.exr'
+ transformed_LUT_image = '%s.%s.%s' % (lut_path_base, 'transformed', 'exr')
apply_CTL_to_image(identity_LUT_image,
transformed_LUT_image,
ctl_paths,
global_params,
aces_CTL_directory)
- corrected_LUT_image = lut_path_base + '.correct.exr'
+ 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)