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

Commit

Permalink
Add inverse option in lut_to_lut
Browse files Browse the repository at this point in the history
  • Loading branch information
mfe committed Nov 13, 2013
1 parent 7b59ae1 commit fd5d9ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lutLab/lut_to_lut.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LutToLutException(Exception):


def lut_to_lut(inlutfile, outlutfile=None, type='1D_CUBE',
lutsize=16, cubesize=17):
lutsize=16, cubesize=17, inverse=False):
"""Extract the tone mapping curve of a 3D LUT
Args:
Expand Down Expand Up @@ -53,7 +53,8 @@ def lut_to_lut(inlutfile, outlutfile=None, type='1D_CUBE',
raise LutToLutException("Unsupported export format!")
if not outlutfile:
outlutfile = get_default_out_path(inlutfile, ext)
processor = create_ocio_processor(inlutfile, interpolation=interp)
processor = create_ocio_processor(inlutfile, interpolation=interp,
inverse=inverse)
# init vars
max_value = samples_count - 1.0
red_values = []
Expand Down Expand Up @@ -106,11 +107,14 @@ def __get_options():
parser.add_argument("-ocs", "--out-cube-size", help=(
"Output cube size (3D only). Ex : 17, 32."
), default=17, type=int)
# inverse
parser.add_argument("-inv", "--inverse", help="Inverse input LUT",
action="store_true")
return parser.parse_args()

if __name__ == '__main__':
""" Command line interface
"""
args = __get_options()
lut_to_lut(args.inlutfile, args.outlutfile, args.out_type,
args.out_lut_size, args.out_cube_size)
args.out_lut_size, args.out_cube_size, args.inverse)

0 comments on commit fd5d9ca

Please sign in to comment.