AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.74k stars 431 forks source link

Enhance ociochecklut to print the output after each step in a multi-t… #1925

Closed pennelee closed 5 months ago

pennelee commented 6 months ago

…ransform LUT

-s option will print the output after each step in the transform.

Tested with single RGB input as well as -t predefined RGB values. Tested with various CLF files from OpenColorIO\tests\data\files\clf that have one, two and multiple operations. Tested with --inv, --gpu, --gpulegacy

For cases with multiple operations, there are some differences in ouptut due to precision. For example:

Example with 2 Transforms:

ociochecklut.exe lut1d_comp.clf 0.18 0.18 0.18 -v

OCIO Version: 2.4.0dev

Input [R G B]: [ 0.18 0.18 0.18] Output [R G B]: [0.5528838 0.525246 0.4975982]

ociochecklut.exe lut1d_comp.clf 0.18 0.18 0.18 -v -s

OCIO Version: 2.4.0dev

Transform 0: Input [R G B]: [ 0.18 0.18 0.18] Output [R G B]: [0.3441569 0.3441569 0.3441569] Transform 1: Input [R G B]: [0.3441569 0.3441569 0.3441569] Output [R G B]: [0.5528837 0.525246 0.4975982]

Example with 9 Transforms:

ociochecklut.exe multiple_ops.clf 0.18 0.18 0.18 -v

OCIO Version: 2.4.0dev

Input [R G B]: [ 0.18 0.18 0.18] Output [R G B]: [0.2754872 0.3039555 -0.06960445]

ociochecklut.exe multiple_ops.clf 0.18 0.18 0.18 -v -s

OCIO Version: 2.4.0dev

Transform 0: Input [R G B]: [ 0.18 0.18 0.18] Output [R G B]: [0.1866483 0.2251173 0.08405399] Transform 1: Input [R G B]: [0.1866483 0.2251173 0.08405399] Output [R G B]: [0.2978297 0.394014 0.01335724] Transform 2: Input [R G B]: [0.2978297 0.394014 0.01335724] Output [R G B]: [0.3367588 0.4664171 -0.04671562] Transform 3: Input [R G B]: [0.3367588 0.4664171 -0.04671562] Output [R G B]: [0.3179022 0.4337091 -0.01955034] Transform 4: Input [R G B]: [0.3179022 0.4337091 -0.01955034] Output [R G B]: [0.2819128 0.3884552 -0.01955034] Transform 5: Input [R G B]: [0.2819128 0.3884552 -0.01955034] Output [R G B]: [0.6754353 0.760067 -0.05077279] Transform 6: Input [R G B]: [0.6754353 0.760067 -0.05077279] Output [R G B]: [0.6506769 0.6723613 -0.08869568] Transform 7: Input [R G B]: [0.6506769 0.6723613 -0.08869568] Output [R G B]: [0.2754877 0.3039553 -0.0006977472] Transform 8: Input [R G B]: [0.2754877 0.3039553 -0.0006977472] Output [R G B]: [0.2754877 0.3039553 -0.06960447]

pennelee commented 6 months ago

Thank you @remia for the review and feedback! I added your suggestion to the changes.