Implement display and view aliases - #2341
Open
doug-walker wants to merge 1 commit into
Open
Conversation
Signed-off-by: Doug Walker <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows config authors to define aliases for displays and views, similar to aliases on color spaces. This allows display and view names to evolve over time while allowing the earlier names to continue to work in DisplayViewTransforms. In addition, it will now be possible to define aliases that simplify working with command-line tools such as oiiotool to apply DisplayViewTransforms.
This new flexibility in naming should be very useful with the upcoming built-in ACES configs.
For displays, this works by treating the aliases to the display's corresponding display color space as display aliases.
For views, this works by treating the name and aliases of the view's view_transform as aliases to the view. ViewTransforms did not already have aliases, so this PR adds those as well.
One design decision was to add the aliases to the ViewTransform class rather than the views themselves. There were a number of reasons for this choice, including:
This functionality is off by default and requires config authors to opt-in by adding the new use_display_view_aliases attribute to their config file. This avoids any unintended consequences related to existing configs that were not designed with this in mind. The new functionality requires the config file version to be at least 2.6 or higher.
While working on this, I wound up noticing and fixing a few bugs involving either aliases or the USE_DISPLAY_NAME token.
If application developers are directly using Config::getDisplayViewColorSpaceName, they will probably need to switch to the new Config::getResolvedDisplayViewColorSpaceName, in order to properly handle configs that use display/view aliases. I will mention that in the release notes.
The majority of the code is unit tests, as I was trying to anticipate all scenarios, though a lot of them are edge cases.
Addresses issues #2337 and #2210.
Assisted by: Claude Code / Sonnet 5.