Adsk Contrib - Enhanced methods to find an equivalent color space between configs#1788
Conversation
…ce and AreProcessorsEquivalent. - Remove some include of Processor.h where it wasn't needed. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…onfig.cpp instead. Fixing identations issues. Fixing styling issues. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Moving the creation of the editable config into the wrapper of isColorSpaceLinear instead of doing it inside the function. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…onfig and one for builtin. Adding back isColorSpaceLinear inside Config.cpp since we need access to getProcessorWithoutCaching. Refactor some of config utils function to return index instead of string. Creating editable config in the two wrappers to prevent processor caching. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
| // That should never happen. | ||
| return -1; | ||
| } | ||
|
|
There was a problem hiding this comment.
Lines 1097-1504 were moved to ConfigUtils.cpp, without significant changes. This is the heuristics code and we wanted to move this out of Config.cpp, since this module is already so long and the heuristics are essentially their own somewhat self-contained set of functions.
| getImpl()->setProcessorCacheFlags(flags); | ||
| } | ||
|
|
||
| ////////////////////////////////////////////////////////////////// |
There was a problem hiding this comment.
Lines 4740-4835 is simply a cut/paste move from farther down in this module. This code is from another one of our recent PRs and we decided it belongs better in this location.
|
Looks good to me, do we need Python bindings for the new methods? |
…pace methods. Adding a couple python unit tests to cover the new methods (same unit test as the C++ side, but not all of them) Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…ce and AreProcessorsEquivalent. - Remove some include of Processor.h where it wasn't needed. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…onfig.cpp instead. Fixing identations issues. Fixing styling issues. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Moving the creation of the editable config into the wrapper of isColorSpaceLinear instead of doing it inside the function. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…onfig and one for builtin. Adding back isColorSpaceLinear inside Config.cpp since we need access to getProcessorWithoutCaching. Refactor some of config utils function to return index instead of string. Creating editable config in the two wrappers to prevent processor caching. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
…pace methods. Adding a couple python unit tests to cover the new methods (same unit test as the C++ side, but not all of them) Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
…ttps://github.com/autodesk-forks/OpenColorIO into adsk_contrib/getProcessorToBuiltinCS-enhancements
…ments Signed-off-by: Cédrik Fuoco <105517825+cedrik-fuoco-adsk@users.noreply.github.com>
…ttps://github.com/autodesk-forks/OpenColorIO into adsk_contrib/getProcessorToBuiltinCS-enhancements
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
|
The failed workflow is expected as there was an issue with that workflow on the main branch. We merged the fix into the main branch yesterday. |
|
Taking note here that I verified that this PR fixes a bug in GetProcessorFromBuiltinColorSpace reported by a user of OCIO 2.2.1. As a result, we will plan to include this branch in the upcoming 2.2.2 release rather than waiting for 2.3. |
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
|
I'm going to go ahead and merge this since we need it for the config merge feature we're working on. The CI problem on macOS with docs=ON is unrelated to the code in this PR. |
…ween configs (AcademySoftwareFoundation#1788) * - Implementation of identifyInterchangeSpace, identifyBuiltinColorSpace and AreProcessorsEquivalent. - Remove some include of Processor.h where it wasn't needed. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Moving code from Config.cpp to ConfigUtils.cpp and using wrapper in Config.cpp instead. Fixing identations issues. Fixing styling issues. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Typo and comments tweaks Moving the creation of the editable config into the wrapper of isColorSpaceLinear instead of doing it inside the function. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Splitting identifyInterchangeSpace into two methods, one for source config and one for builtin. Adding back isColorSpaceLinear inside Config.cpp since we need access to getProcessorWithoutCaching. Refactor some of config utils function to return index instead of string. Creating editable config in the two wrappers to prevent processor caching. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Tentative change to phase out isProcessorEquivalent. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Refactor code and add tests Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Remove unused method Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Remove unused method, tk 2 Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Tweak comments Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Python binding for IdentifyInterchangeSpace and IdentifyBuiltinColorSpace methods. Adding a couple python unit tests to cover the new methods (same unit test as the C++ side, but not all of them) Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * - Implementation of identifyInterchangeSpace, identifyBuiltinColorSpace and AreProcessorsEquivalent. - Remove some include of Processor.h where it wasn't needed. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Moving code from Config.cpp to ConfigUtils.cpp and using wrapper in Config.cpp instead. Fixing identations issues. Fixing styling issues. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Typo and comments tweaks Moving the creation of the editable config into the wrapper of isColorSpaceLinear instead of doing it inside the function. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Splitting identifyInterchangeSpace into two methods, one for source config and one for builtin. Adding back isColorSpaceLinear inside Config.cpp since we need access to getProcessorWithoutCaching. Refactor some of config utils function to return index instead of string. Creating editable config in the two wrappers to prevent processor caching. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Tentative change to phase out isProcessorEquivalent. Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Refactor code and add tests Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Remove unused method Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Remove unused method, tk 2 Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Tweak comments Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Python binding for IdentifyInterchangeSpace and IdentifyBuiltinColorSpace methods. Adding a couple python unit tests to cover the new methods (same unit test as the C++ side, but not all of them) Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Fixing problem with the rebase Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> * Make sure the unit test is using the static method Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> --------- Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com> Signed-off-by: Doug Walker <doug.walker@autodesk.com> Signed-off-by: Cédrik Fuoco <105517825+cedrik-fuoco-adsk@users.noreply.github.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com> Signed-off-by: Doug Walker <Doug.Walker@autodesk.com>
Adds several new methods to be used to identify a common color space between a pair of configs that may be used as an interchange space. If the official interchange roles are not present, heuristics are used to search for a suitable color space.
IdentifyBuiltinColorSpace-- Searches a user config to find the name of an equivalent color space to a color space in one of the Built-in configs. For example, "What is the name in this config for thesRGB - Texturecolor space from the default Built-in config?"IdentifyInterchangeSpace-- Identifies the pair of color space names to be used as the interchange space to allow conversion between color spaces in a user config and one of the built-in configs. This is the fundamental function that contains the heuristics for trying to identify known color spaces and is used by IdentifyBuiltinColorSpace and in the GetProcessorFrom/ToBuiltinColorSpace methods added in PR #1710.This improves upon and extends upon PR #1710. One piece of feedback on that PR is that it would be helpful to be able to use the heuristics to extract the names of the interchange color spaces rather than a Processor. This gives the application more flexibility in how that information is persisted and may reduce the number of times that any heuristics (that search through a config's color spaces) need to be run.
In addition, following up on the TODO mentioned in PR #1710, we refactored most of the heuristics code to move it out of the already crowded
Config.cppand into the newConfigUtils.cppmodule. The heuristics themselves were not significantly changed.A lot of additional unit tests were added to test more scenarios involving the heuristics.
Finally, an issue was fixed in
GetProcessorFromConfigsso that the returned Processor is a no-op if either of the color spaces in the two configs is a data space.