Skip to content
This repository was archived by the owner on Nov 22, 2019. It is now read-only.

Commit fd5d9ca

Browse files
author
mfe
committed
Add inverse option in lut_to_lut
1 parent 7b59ae1 commit fd5d9ca

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lutLab/lut_to_lut.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class LutToLutException(Exception):
2020

2121

2222
def lut_to_lut(inlutfile, outlutfile=None, type='1D_CUBE',
23-
lutsize=16, cubesize=17):
23+
lutsize=16, cubesize=17, inverse=False):
2424
"""Extract the tone mapping curve of a 3D LUT
2525
2626
Args:
@@ -53,7 +53,8 @@ def lut_to_lut(inlutfile, outlutfile=None, type='1D_CUBE',
5353
raise LutToLutException("Unsupported export format!")
5454
if not outlutfile:
5555
outlutfile = get_default_out_path(inlutfile, ext)
56-
processor = create_ocio_processor(inlutfile, interpolation=interp)
56+
processor = create_ocio_processor(inlutfile, interpolation=interp,
57+
inverse=inverse)
5758
# init vars
5859
max_value = samples_count - 1.0
5960
red_values = []
@@ -106,11 +107,14 @@ def __get_options():
106107
parser.add_argument("-ocs", "--out-cube-size", help=(
107108
"Output cube size (3D only). Ex : 17, 32."
108109
), default=17, type=int)
110+
# inverse
111+
parser.add_argument("-inv", "--inverse", help="Inverse input LUT",
112+
action="store_true")
109113
return parser.parse_args()
110114

111115
if __name__ == '__main__':
112116
""" Command line interface
113117
"""
114118
args = __get_options()
115119
lut_to_lut(args.inlutfile, args.outlutfile, args.out_type,
116-
args.out_lut_size, args.out_cube_size)
120+
args.out_lut_size, args.out_cube_size, args.inverse)

0 commit comments

Comments
 (0)