Skip to content

Adsk Contrib - Write no-clamp Range for SMPTE CLF Broadcast Profile - #2349

Merged
doug-walker merged 2 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker/clf_noclamp_range
Sep 29, 2026
Merged

doug-walker merged 2 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker/clf_noclamp_range

Conversation

@doug-walker

@doug-walker doug-walker commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

As pointed out by Nick Shaw, OCIO is currently unable to write SMPTE ST2136-10 Broadcast Profile CLF files because of how OCIO handles the "noClamp" style attribute of a CLF Range process node. (These process nodes do a full-to-narrow conversion on input and a narrow-to-full conversion on output, allowing the CLFs to be universal files that may provide any combination of input or output range scaling.)

When reading a CLF, these are (exactly) converted to a Matrix. This allows an important simplification to the OCIO optimization process since in OCIO a Range always clamps and a Matrix does not. However, it poses a problem since there is currently no way to write the noClamp Range called for by ST2136-10. Writing these as a Matrix (which includes an offset) would be mathematically equivalent but would not be compliant with the spec.

I considered various possibilities for how to address this. I definitely don't want to allow the existence of non-clamping Ranges, since this would add a lot of internal complexity to OCIO. But there are other options, for example, I considered handling Broadcast Profile as a separate flavor of CLF (i.e. adding a new file format option to GroupTransform::write). But that only seemed the correct approach if OCIO is doing more stuff, for example, populating expected values of the CLF Info element. But there are some things there that only the person creating the file would know and I didn't want to make all that stuff arguments to the writer.

Ultimately, I decided to take the most minimalist approach. When the format argument to GroupTransform::write is "Academy/ASC Common LUT Format", this PR checks the first and last Transforms to see if they are a MatrixTransform that is equivalent to the specific noClamp Ranges expected by ST2136-10 and, if so, writes them as Ranges.

A test is provided to validate that an ST2136-10 file may now be written successfully.

Note regarding CLF version: Since PR #2265, CLF writing always hardcodes writeVersion = CTF_PROCESS_LIST_VERSION_2_0 (CTFTransform.cpp in TransformWriter::write), which is above the 1.7 version that introduced style="noClamp". So any CLF we write can safely carry style="noClamp" on a Range.

Assisted by: Claude Code / Sonnet 5

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

@cozdas cozdas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find any issues, looks good to me.

@doug-walker
doug-walker merged commit 1f0ca55 into AcademySoftwareFoundation:main Sep 29, 2026
23 checks passed
@doug-walker
doug-walker deleted the walker/clf_noclamp_range branch September 29, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants