From a40ef4f00c5325ee5bedcd67231e0a89046f95fd Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Sat, 19 Jun 2021 18:16:42 -0400 Subject: [PATCH 01/12] Adsk Contrib - Improve file rules for v1 configs Signed-off-by: Patrick Hodoul --- docs/guides/authoring/overview.rst | 16 +- docs/guides/authoring/rules.rst | 2 +- include/OpenColorIO/OpenColorIO.h | 9 +- src/OpenColorIO/Config.cpp | 107 +----- src/OpenColorIO/FileRules.cpp | 110 +++++- src/OpenColorIO/FileRules.h | 6 + src/OpenColorIO/OCIOYaml.cpp | 19 +- src/bindings/python/CMakeLists.txt | 12 +- src/bindings/python/PyConfig.cpp | 8 +- tests/cpu/FileRules_tests.cpp | 572 +++++++++++++++++++++++++---- 10 files changed, 676 insertions(+), 185 deletions(-) diff --git a/docs/guides/authoring/overview.rst b/docs/guides/authoring/overview.rst index 69e886dc50..7df06e669c 100644 --- a/docs/guides/authoring/overview.rst +++ b/docs/guides/authoring/overview.rst @@ -319,7 +319,7 @@ to use to control other types of tasks not listed below. * ``color_picking`` - colors in a color-selection UI can be displayed in this space, while selecting colors in a different working space - (e.g. ``scene_linear`` or ``texture_paint``) + (e.g. ``scene_linear`` or ``texture_paint``). * ``color_timing`` - color space used for applying color corrections, e.g. user-specified grade within an image viewer (if the application @@ -327,32 +327,32 @@ to use to control other types of tasks not listed below. * ``compositing_log`` - a log color space used for certain processing operations (plate resizing, pulling keys, degrain, etc). Used by the - OCIOLogConvert Nuke node + OCIOLogConvert Nuke node. * ``data`` - used when writing data outputs such as normals, depth data, and other "non color" data. The color space in this role should typically have ``data: true`` specified, so no color transforms are - applied + applied. * ``default`` - when ``strictparsing: false``, this color space is used - as a fallback. If not defined, the ``scene_linear`` role is used + as a fallback. * ``matte_paint`` - color space which matte-paintings are created in (for more information, :ref:`see the guide on baking ICC profiles for Photoshop `, and - :ref:`config-spivfx`) + :ref:`config-spivfx`). * ``reference`` - the color space against which the other color spaces - are defined + are defined. .. note:: The reference role has sometimes been misinterpreted as being the space in which "reference art" is stored in. * ``scene_linear`` - the scene-referred linear-to-light color space, - often the same as the reference space (see:ref:`faq-terminology`) + often the same as the reference space (see:ref:`faq-terminology`). * ``texture_paint`` - similar to ``matte_paint`` but for painting textures for 3D objects (see the description of texture painting in - :ref:`SPI's pipeline `) + :ref:`SPI's pipeline `). diff --git a/docs/guides/authoring/rules.rst b/docs/guides/authoring/rules.rst index 7a106185be..3c557dbf4a 100644 --- a/docs/guides/authoring/rules.rst +++ b/docs/guides/authoring/rules.rst @@ -115,7 +115,7 @@ determine the colorspace ``lnf`` (it being the right-most substring containing a colorspace name) However, if the colorspace cannot be determined and ``strictparsing: -true``, it will produce an error. +true``, it will return an empty string. If the colorspace cannot be determined and ``strictparsing: false``, the default role will be used. This allows unhandled images to operate diff --git a/include/OpenColorIO/OpenColorIO.h b/include/OpenColorIO/OpenColorIO.h index 5fead719e9..e49243aa3f 100644 --- a/include/OpenColorIO/OpenColorIO.h +++ b/include/OpenColorIO/OpenColorIO.h @@ -980,7 +980,8 @@ class OCIOEXPORT Config */ void setFileRules(ConstFileRulesRcPtr fileRules); - /// Get the color space of the first rule that matched filePath. + /// Get the color space of the first rule that matched filePath. (For v1 configs, this is + /// equivalent to calling parseColorSpaceFromString with strictparsing set to false.) const char * getColorSpaceFromFilepath(const char * filePath) const; /** @@ -1009,7 +1010,7 @@ class OCIOEXPORT Config * * If strict parsing is disabled, return ROLE_DEFAULT (if defined). * * If the default role is not defined, return an empty string. */ - OCIO_DEPRECATED("This is now deprecated, please use Config::getColorSpaceFromFilepath().") + OCIO_DEPRECATED("This is now deprecated starting at v2.0, please use Config::getColorSpaceFromFilepath().") const char * parseColorSpaceFromString(const char * str) const; bool isStrictParsingEnabled() const; @@ -1178,6 +1179,10 @@ extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Config&); * Getters and setters are using the rule position, they will throw if the position is not * valid. If the rule at the specified position does not implement the requested property * getter will return NULL and setter will throw. + * + * When loading a v1 config, a set of FileRules are created with ColorSpaceNamePathSearch followed + * by the Default rule pointing to the default role. This allows getColorSpaceFromFilepath to emulate + * OCIO v1 code that used parseColorSpaceFromString with strictparsing set to false. */ class OCIOEXPORT FileRules diff --git a/src/OpenColorIO/Config.cpp b/src/OpenColorIO/Config.cpp index 3685413df4..dab173bcf1 100644 --- a/src/OpenColorIO/Config.cpp +++ b/src/OpenColorIO/Config.cpp @@ -192,24 +192,6 @@ void GetColorSpaceReferences(std::set & colorSpaceNames, } } -static constexpr char AddedDefault[]{ "added_default_rule_colorspace" }; - -void FindAvailableName(const ColorSpaceSetRcPtr & colorspaces, std::string & csname) -{ - int i = 0; - csname = AddedDefault; - while (true) - { - if (!colorspaces->hasColorSpace(csname.c_str())) - { - break; - } - - csname = AddedDefault + std::to_string(i); - ++i; - } -} - // Views are stored in two vectors of objects, using pointers to temporarily group them. typedef std::vector ViewPtrVec; @@ -591,56 +573,6 @@ class Config::Impl static ConstConfigRcPtr Read(std::istream & istream, const char * filename); - // Upgrade from v1 to v2. - void upgradeFromVersion1ToVersion2() noexcept - { - // V2 adds file_rules and these require a default rule. We try to initialize the default - // rule using the default role. If the default role doesn't exist, we look for a Raw - // ColorSpace with isdata true. If that is not found either, we add new ColorSpace - // named "added_default_rule_colorspace". - - m_majorVersion = 2; - m_minorVersion = 0; - - const char * rname = LookupRole(m_roles, ROLE_DEFAULT); - if (!hasColorSpace(rname)) - { - std::string defaultCS; - bool addNewDefault = true; - // The default role doesn't exist so look for a color space named "raw" - // (not case-sensitive) with isdata true. - const int csindex = getColorSpaceIndex("raw"); - if (-1 != csindex) - { - auto cs = m_allColorSpaces->getColorSpaceByIndex(csindex); - if (cs->isData()) - { - // "Raw" color space can be used for default. - addNewDefault = false; - defaultCS = cs->getName(); - } - } - - if (addNewDefault) - { - FindAvailableName(m_allColorSpaces, defaultCS); - auto newCS = ColorSpace::Create(); - newCS->setName(defaultCS.c_str()); - newCS->setIsData(true); - m_allColorSpaces->addColorSpace(newCS); - // Put the added CS in the inactive list to avoid it showing up in user menus. - if (!m_inactiveColorSpaceNamesConf.empty()) - { - m_inactiveColorSpaceNamesConf += ","; - } - m_inactiveColorSpaceNamesConf += defaultCS; - setInactiveColorSpaces(m_inactiveColorSpaceNamesConf.c_str()); - } - - m_fileRules->setColorSpace(m_fileRules->getNumEntries() - 1, defaultCS.c_str()); - } - } - // Validate view object that can be a config defined shared view or a display-defined view. void validateView(const std::string & display, const View & view, bool checkUseDisplayName) const { @@ -1269,15 +1201,19 @@ void Config::upgradeToLatestVersion() noexcept { if (wasVersion == 1) { - m_impl->upgradeFromVersion1ToVersion2(); + UpdateFileRulesFromV1ToV2(*this, m_impl->m_fileRules); + + // The instance version is now 2.0 + m_impl->m_majorVersion = 2; + m_impl->m_minorVersion = 0; } + static_assert(LastSupportedMajorVersion == 2, "Config: Handle newer versions"); setMajorVersion(LastSupportedMajorVersion); setMinorVersion(LastSupportedMinorVersion[LastSupportedMajorVersion - 1]); } } - ConfigRcPtr Config::createEditableCopy() const { ConfigRcPtr config = Config::Create(); @@ -1757,26 +1693,17 @@ void Config::validate() const ///// FileRules - // All Config objects have a fileRules object, regardless of version. This object is - // initialized to have a defaultRule with the color space set to "default" (i.e., the default - // role). The fileRules->validate call will validate that all color spaces used in rules - // exist, or if they are roles that they point to a color space that exists. Because this would - // cause validate to improperly fail on v1 configs (since they are not required to actually - // contain file rules), we don't do this check on v1 configs when there is only one rule. - if (getMajorVersion() >= 2 || getImpl()->m_fileRules->getNumEntries() != 1) + try { - try - { - getImpl()->m_fileRules->getImpl()->validate(*this); - } - catch (const Exception & e) - { - std::ostringstream os; - os << "Config failed validation. File rules failed with: "; - os << e.what(); - getImpl()->m_validationtext = os.str(); - throw Exception(getImpl()->m_validationtext.c_str()); - } + getImpl()->m_fileRules->getImpl()->validate(*this); + } + catch (const Exception & e) + { + std::ostringstream os; + os << "Config failed validation. File rules failed with: "; + os << e.what(); + getImpl()->m_validationtext = os.str(); + throw Exception(getImpl()->m_validationtext.c_str()); } ///// Resolve all file Transforms using context variables. @@ -4718,7 +4645,7 @@ void Config::Impl::checkVersionConsistency() const // Check for the file rules. - if (m_majorVersion < 2 && m_fileRules->getNumEntries() > 1) + if (m_majorVersion < 2 && m_fileRules->getNumEntries() > 2) { throw Exception("Only version 2 (or higher) can have file rules."); } diff --git a/src/OpenColorIO/FileRules.cpp b/src/OpenColorIO/FileRules.cpp index 329f54f500..8a35472ff6 100644 --- a/src/OpenColorIO/FileRules.cpp +++ b/src/OpenColorIO/FileRules.cpp @@ -11,6 +11,7 @@ #include "CustomKeys.h" #include "FileRules.h" +#include "Logging.h" #include "PathUtils.h" #include "Platform.h" #include "utils/StringUtils.h" @@ -662,9 +663,23 @@ void FileRules::Impl::moveRule(size_t ruleIndex, int offset) void FileRules::Impl::validate(const Config & cfg) const { - for (auto & rule : m_rules) + // All Config objects have a fileRules object, regardless of version. This object is + // initialized to have a defaultRule with the color space set to "default" (i.e., the default + // role). The fileRules->validate call will validate that all color spaces used in rules + // exist, or if they are roles that they point to a color space that exists. + // + // Because this would cause validate to improperly fail on v1 configs (since they are not + // required to actually contain file rules), we don't do this check on v1 configs when there is + // only two rules. In some case (e.g. load a v1 config from disk), the two expected rules are + // the 'Default' and 'ColorSpaceNamePathSearch' ones. + + if (cfg.getMajorVersion() >= 2 + || (cfg.getMajorVersion() == 1 && m_rules.size() > 2)) { - rule->validate(cfg); + for (auto & rule : m_rules) + { + rule->validate(cfg); + } } } @@ -940,5 +955,96 @@ std::ostream & operator<< (std::ostream & os, const FileRules & fr) } return os; } + +void UpdateFileRulesFromV1ToV2(const Config & config, FileRulesRcPtr & fileRules) +{ + if (config.getMajorVersion() != 1) + { + return; + } + + // In order to preserve the v1 behavior using Config:getColorSpaceFromFilepath() (i.e. + // mimic the Config::parseColorSpaceFromString() behavior) add the file path search + // rule to the list of file rules. + + try + { + // Throws if the file rule does not exist. + fileRules->getIndexForRule(FileRules::FilePathSearchRuleName); + } + catch(const Exception & /* ex */) + { + fileRules->insertPathSearchRule(0); + } + + // Now, double-check the default rule (which is using the default role) to find the + // right alternative if the default role is missing. + + // In order to always return a valid color space, the algorithm for the default rule is: + // 1. Use the default role if it exists (i.e. that's the default implementation) + // 2. Use the "raw" color space (case insensitive) if it exists & is a 'data' color space + // 3. Use the first 'data' color space if one exists + // 4. Use the first active color space + // 5. finally, fallback to the first color space. + + auto defaultCS = config.getColorSpace(ROLE_DEFAULT); + + if (!defaultCS) + { + ConstColorSpaceRcPtr cs = config.getColorSpace("raw"); + if (cs && cs->isData()) + { + fileRules->setColorSpace(1, cs->getName()); + } + else + { + const int numColorSpaces + = config.getNumColorSpaces(SEARCH_REFERENCE_SPACE_SCENE, COLORSPACE_ALL); + + bool found = false; + for (int idx = 0; idx < numColorSpaces && !found; ++idx) + { + const char * csName + = config.getColorSpaceNameByIndex(SEARCH_REFERENCE_SPACE_SCENE, + COLORSPACE_ALL, + idx); + ConstColorSpaceRcPtr cs = config.getColorSpace(csName); + + if (cs->isData()) + { + fileRules->setColorSpace(1, csName); + found = true; + } + } + + if (!found) + { + if (config.getNumColorSpaces() > 0) + { + // Take the first active color space. + fileRules->setColorSpace(1, config.getColorSpaceNameByIndex(0)); + } + else + { + static constexpr char msg[] + = "The default rule creation fallbacks to the first color space because "\ + "no suitable color space exists."; + + LogWarning(msg); + + // Take the first available color space. + const char * csName + = config.getColorSpaceNameByIndex(SEARCH_REFERENCE_SPACE_SCENE, + COLORSPACE_ALL, + 0); + + fileRules->setColorSpace(1, csName); + } + } + } + } +} + + } // namespace OCIO_NAMESPACE diff --git a/src/OpenColorIO/FileRules.h b/src/OpenColorIO/FileRules.h index 882d2e3909..9b4d81598f 100644 --- a/src/OpenColorIO/FileRules.h +++ b/src/OpenColorIO/FileRules.h @@ -69,6 +69,12 @@ class FileRules::Impl std::vector m_rules; }; + +// Helper method to build valid v2 file rules from a v1 config. Note that it does not change +// the config instance version. +void UpdateFileRulesFromV1ToV2(const Config & config, FileRulesRcPtr & fileRules); + + } // namespace OCIO_NAMESPACE #endif diff --git a/src/OpenColorIO/OCIOYaml.cpp b/src/OpenColorIO/OCIOYaml.cpp index 6b7c370419..67cafdf164 100644 --- a/src/OpenColorIO/OCIOYaml.cpp +++ b/src/OpenColorIO/OCIOYaml.cpp @@ -4657,10 +4657,23 @@ inline void load(const YAML::Node& node, ConfigRcPtr & config, const char* filen auto defaultCS = config->getColorSpace(ROLE_DEFAULT); if (!fileRulesFound) { - if (!defaultCS && config->getMajorVersion() >= 2) + if (config->getMajorVersion() >= 2) { - throwError(node, "The config must contain either a Default file rule or " - "the 'default' role."); + if (!defaultCS) + { + throwError(node, "The config must contain either a Default file rule or " + "the 'default' role."); + } + } + else + { + // In order to use Config::getColorSpaceFromFilepath() method for any version of + // config instance, the method updates the in-memory file rules created by a v1 config + // to have valid file rules and most importantly, to mimic + // Config::parseColorSpaceFromString() which is now deprecated since v2. + UpdateFileRulesFromV1ToV2(*config.get(), fileRules); + + config->setFileRules(fileRules); } } else diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 3e9d70fd46..19c36451b0 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -134,10 +134,18 @@ if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 17) set(APP_CXX_STANDARD 11) endif() +set(CUSTOM_COMPILE_FLAGS ${PLATFORM_COMPILE_FLAGS}) + +# The Python binding contains deprecated methods for backward compatibility reason, +# so disable the warning. +if(USE_GCC OR USE_CLANG) + set(CUSTOM_COMPILE_FLAGS "${CUSTOM_COMPILE_FLAGS} -Wno-deprecated-declarations") +endif() + set_target_properties(PyOpenColorIO PROPERTIES - COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS}" - CXX_STANDARD ${APP_CXX_STANDARD} + COMPILE_FLAGS ${CUSTOM_COMPILE_FLAGS} + CXX_STANDARD ${APP_CXX_STANDARD} ) if(NOT BUILD_SHARED_LIBS) diff --git a/src/bindings/python/PyConfig.cpp b/src/bindings/python/PyConfig.cpp index 07aab80257..cb5ab28eee 100644 --- a/src/bindings/python/PyConfig.cpp +++ b/src/bindings/python/PyConfig.cpp @@ -292,14 +292,8 @@ void bindPyConfig(py::module & m) DOC(Config, isColorSpaceUsed)) .def("clearColorSpaces", &Config::clearColorSpaces, DOC(Config, clearColorSpaces)) - - .def("parseColorSpaceFromString", [](ConfigRcPtr & self, const char * str) - { - return self->getColorSpaceFromFilepath(str); - }, - "str"_a, + .def("parseColorSpaceFromString", &Config::parseColorSpaceFromString, "str"_a, DOC(Config, parseColorSpaceFromString)) - .def("isStrictParsingEnabled", &Config::isStrictParsingEnabled, DOC(Config, isStrictParsingEnabled)) .def("setStrictParsingEnabled", &Config::setStrictParsingEnabled, "enabled"_a, diff --git a/tests/cpu/FileRules_tests.cpp b/tests/cpu/FileRules_tests.cpp index 5d64b33327..f5b77ee923 100644 --- a/tests/cpu/FileRules_tests.cpp +++ b/tests/cpu/FileRules_tests.cpp @@ -14,27 +14,203 @@ namespace OCIO = OCIO_NAMESPACE; OCIO_ADD_TEST(FileRules, config_v1) { - static const char CONFIG[] = - "ocio_profile_version: 1\n" - "strictparsing: false\n" - "roles:\n" - " default: raw\n" - "displays:\n" - " sRGB:\n" - " - ! {name: Raw, colorspace: raw}\n" - "colorspaces:\n" - " - !\n" - " name: raw\n"; + // From a v1 config create valid file rules. + + { + static const char CONFIG[] = + "ocio_profile_version: 1\n" + "\n" + "search_path: \"\"\n" + "strictparsing: false\n" + "luma: [0.2126, 0.7152, 0.0722]\n" + "\n" + "roles:\n" + " default: raw\n" + "\n" + "displays:\n" + " sRGB:\n" + " - ! {name: Raw, colorspace: raw}\n" + "\n" + "active_displays: []\n" + "active_views: []\n" + "\n" + "colorspaces:\n" + " - !\n" + " name: raw\n" + " family: \"\"\n" + " equalitygroup: \"\"\n" + " bitdepth: unknown\n" + " isdata: false\n" + " allocation: uniform\n"; - std::istringstream is; - is.str(CONFIG); + std::istringstream is; + is.str(CONFIG); - OCIO::ConstConfigRcPtr config; - OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)); - OCIO_CHECK_NO_THROW(config->validate()); + OCIO::ConstConfigRcPtr config; + OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)); + OCIO_CHECK_NO_THROW(config->validate()); + + OCIO_REQUIRE_EQUAL(config->getFileRules()->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(1)), OCIO::FileRules::DefaultRuleName); + + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getColorSpace(1)), std::string("default")); + + // Check that the file rules are not saved in a v1 config. + std::stringstream ss; + OCIO_CHECK_NO_THROW(ss << *config.get()); + OCIO_CHECK_EQUAL(ss.str(), std::string(CONFIG)); + } + + // Test fallback 1: The default role is missing and there is a data color space named 'raw'. + + { + static const char CONFIG[] = + "ocio_profile_version: 1\n" + "displays:\n" + " sRGB:\n" + " - ! {name: Raw, colorspace: raw}\n" + "colorspaces:\n" + " - !\n" + " name: cs2\n" + " - !\n" + " name: raw\n" + " isdata: true\n"; + + std::istringstream is; + is.str(CONFIG); + + OCIO::ConstConfigRcPtr config; + OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)); + OCIO_CHECK_NO_THROW(config->validate()); + + OCIO_REQUIRE_EQUAL(config->getFileRules()->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(1)), OCIO::FileRules::DefaultRuleName); + + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getColorSpace(1)), std::string("raw")); + } + + // Test fallback 2: The default role is missing and there is a data color space. + // But 'raw' is not a data color space. + + { + static const char CONFIG[] = + "ocio_profile_version: 1\n" + "displays:\n" + " sRGB:\n" + " - ! {name: Raw, colorspace: raw}\n" + "colorspaces:\n" + " - !\n" + " name: cs2\n" + " - !\n" + " name: raw\n" + " - !\n" + " name: cs3\n" + " isdata: true\n"; + + std::istringstream is; + is.str(CONFIG); + + OCIO::ConstConfigRcPtr config; + OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)); + OCIO_CHECK_NO_THROW(config->validate()); + + OCIO_REQUIRE_EQUAL(config->getFileRules()->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(1)), OCIO::FileRules::DefaultRuleName); + + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getColorSpace(1)), std::string("cs3")); + } + + // Test fallback 3: The default role is missing and there is no data color space but there is + // an active color space. + + { + static const char CONFIG[] = + "ocio_profile_version: 1\n" + "displays:\n" + " sRGB:\n" + " - ! {name: Raw, colorspace: raw}\n" + "colorspaces:\n" + " - !\n" + " name: cs2\n" + " - !\n" + " name: raw\n"; + + std::istringstream is; + is.str(CONFIG); + + OCIO::ConstConfigRcPtr config; + OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)); + OCIO_CHECK_NO_THROW(config->validate()); + + OCIO_REQUIRE_EQUAL(config->getFileRules()->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(1)), OCIO::FileRules::DefaultRuleName); + + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getColorSpace(1)), std::string("cs2")); + } + + // Test that getColorSpaceFromFilePath works even with a v1 config (that pre-dates the + // introduction of file rules). + + { + static const char CONFIG[] = + "ocio_profile_version: 1\n" + "roles:\n" + " default: raw\n" + "displays:\n" + " sRGB:\n" + " - ! {name: Raw, colorspace: raw}\n" + "colorspaces:\n" + " - !\n" + " name: cs2\n" + " - !\n" + " name: raw\n" + " - !\n" + " name: cs3\n" + " isdata: true\n"; + + std::istringstream is; + is.str(CONFIG); - OCIO_CHECK_EQUAL(config->getFileRules()->getNumEntries(), 1); - OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(0)), "Default"); + OCIO::ConstConfigRcPtr config; + OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)); + OCIO_CHECK_NO_THROW(config->validate()); + + OCIO_REQUIRE_EQUAL(config->getFileRules()->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getName(1)), OCIO::FileRules::DefaultRuleName); + + OCIO_CHECK_EQUAL(std::string(config->getFileRules()->getColorSpace(1)), std::string("default")); + + // Test the file path search rule i.e. implemented using Config::parseColorSpaceFromString() + + size_t ruleIndex = size_t(-1); + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs2_file.exr", ruleIndex)), + std::string("cs2")); + OCIO_CHECK_EQUAL(ruleIndex, 0); + OCIO_CHECK_ASSERT(!config->filepathOnlyMatchesDefaultRule("/usr/cs2_file.exr")); + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs3/file.exr", ruleIndex)), + std::string("cs3")); + OCIO_CHECK_EQUAL(ruleIndex, 0); + OCIO_CHECK_ASSERT(!config->filepathOnlyMatchesDefaultRule("/usr/cs3/file.exr")); + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs3/cs2_file.exr", ruleIndex)), + std::string("cs2")); + OCIO_CHECK_EQUAL(ruleIndex, 0); + OCIO_CHECK_ASSERT(!config->filepathOnlyMatchesDefaultRule("/usr/cs3/cs2_file.exr")); + + // Test that it fallbacks to the default rule when nothing found. + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/file.exr", ruleIndex)), + std::string("default")); + OCIO_CHECK_EQUAL(ruleIndex, 1); + OCIO_CHECK_ASSERT(config->filepathOnlyMatchesDefaultRule("/usr/file.exr")); + } } OCIO_ADD_TEST(FileRules, config_read_only) @@ -1140,9 +1316,16 @@ strictparsing: true } -OCIO_ADD_TEST(FileRules, config_v1_to_v2) +OCIO_ADD_TEST(FileRules, config_v1_to_v2_from_file) { + // The unit test checks the file rules when loading a v1 config, the upgrade from v1 to v2 + // and finally, the use of file rules with the upgraded v2 in-memory config. + // + // Note: For now, only the file rules and the versions are impacted by the upgrade. + { + // Test the common use case i.e. read a v1 config file and upgrade it to v2. + constexpr char config_v1[] = { R"(ocio_profile_version: 1 strictparsing: true roles: @@ -1165,32 +1348,65 @@ strictparsing: true is.str(config_v1); OCIO::ConfigRcPtr config; OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)->createEditableCopy()); - OCIO_CHECK_NO_THROW(config->validate()); - config->setMajorVersion(2); + // Check the version. + + OCIO_CHECK_EQUAL(config->getMajorVersion(), 1); + + // Check the file rules. + + auto rules = config->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "default"); + + // Check the v1 in-memory file rules are working. + + // It checks that the rule 'FileRules::FilePathSearchRuleName' exists. + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs2_file.exr")), "cs2"); + // It checks that the rule 'Default' exists. + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/file.exr")), "default"); + + // Upgrading is making sure to build a valid v2 config. + + config->upgradeToLatestVersion(); OCIO_CHECK_NO_THROW(config->validate()); - auto rules = config->getFileRules()->createEditableCopy(); - OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(rules->getNumEntries() - 1)), - "default"); - rules->setDefaultRuleColorSpace("cs1"); - OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(rules->getNumEntries() - 1)), - "cs1"); + // Check the new version. + + OCIO_CHECK_EQUAL(config->getMajorVersion(), 2); + + // Check the new file rules. + + rules = config->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "default"); + + // Check the v1 in-memory file rules are working. + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs2_file.exr")), "cs2"); + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/file.exr")), "default"); } { - constexpr char config_v1_no_default[] = { R"(ocio_profile_version: 1 + // The default role is missing and there is a 'data' color space named rAw. + + constexpr char config_v1[] = { R"(ocio_profile_version: 1 strictparsing: true roles: role1: cs1 role2: cs2 displays: sRGB: - - ! {name: Raw, colorspace: raw} + - ! {name: Raw, colorspace: rAw} colorspaces: - ! - name: raw + name: rAw + isdata: true - ! name: cs1 - ! @@ -1198,85 +1414,301 @@ strictparsing: true )" }; std::istringstream is; - is.str(config_v1_no_default); - OCIO::ConstConfigRcPtr constConfig; - OCIO_CHECK_NO_THROW(constConfig = OCIO::Config::CreateFromStream(is)); - OCIO::ConfigRcPtr config = constConfig->createEditableCopy(); - + is.str(config_v1); + OCIO::ConfigRcPtr config; + OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)->createEditableCopy()); OCIO_CHECK_NO_THROW(config->validate()); - config->setMajorVersion(2); - // Default rule is using 'Default' role that does not exist. - OCIO_CHECK_THROW_WHAT(config->validate(), OCIO::Exception, "rule named 'Default' is " - "referencing 'default' that is neither a color space nor a named " - "transform"); + // Check the version. + + OCIO_CHECK_EQUAL(config->getMajorVersion(), 1); - config = constConfig->createEditableCopy(); - OCIO_CHECK_EQUAL(config->getNumColorSpaces(), 3); + // Check the file rules. + + auto rules = config->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "rAw"); + + // Check the v1 in-memory file rules are working. + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs2_file.exr")), "cs2"); + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/file.exr")), "rAw"); + + // Upgrading is making sure to build a valid v2 config. - // Upgrading is making sure that a valid v1 config will be a valid v2 config. config->upgradeToLatestVersion(); + OCIO_CHECK_NO_THROW(config->validate()); + + // Check the new version. OCIO_CHECK_EQUAL(config->getMajorVersion(), 2); - OCIO_CHECK_NO_THROW(config->validate()); - // 'Default' does not exist, 'Raw' is not a data color-space, so a new color-space has - // been created with a unique name. - OCIO_CHECK_EQUAL(config->getNumColorSpaces(), 3); - OCIO_CHECK_EQUAL(config->getNumColorSpaces(OCIO::SEARCH_REFERENCE_SPACE_ALL, - OCIO::COLORSPACE_ALL), 4); - OCIO_CHECK_EQUAL(std::string(config->getColorSpaceNameByIndex(OCIO::SEARCH_REFERENCE_SPACE_ALL, - OCIO::COLORSPACE_ALL, 3)), - "added_default_rule_colorspace"); + // Check the new file rules. + + rules = config->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "rAw"); + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs2_file.exr")), "cs2"); + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/file.exr")), "rAw"); } { - constexpr char config_v1_no_default[] = { R"(ocio_profile_version: 1 + // The default role is missing and there is no 'data' color space so, the first + // color space is used in v1, and the first active color space is used in v2. + + // Note that inactive color spaces do not exist in v1 explaining why the first color + // space is used. + + constexpr char config_v1[] = { R"(ocio_profile_version: 1 strictparsing: true roles: role1: cs1 role2: cs2 displays: sRGB: - - ! {name: Raw, colorspace: raw} + - ! {name: Raw, colorspace: rAw} colorspaces: - - ! - name: rAw - isdata: true - ! name: cs1 - ! name: cs2 + - ! + name: rAw )" }; std::istringstream is; - is.str(config_v1_no_default); - OCIO::ConstConfigRcPtr constConfig; - OCIO_CHECK_NO_THROW(constConfig = OCIO::Config::CreateFromStream(is)); - OCIO::ConfigRcPtr config = constConfig->createEditableCopy(); - + is.str(config_v1); + OCIO::ConstConfigRcPtr config; + OCIO_CHECK_NO_THROW(config = OCIO::Config::CreateFromStream(is)); OCIO_CHECK_NO_THROW(config->validate()); - config->setMajorVersion(2); + + // Check the version. + + OCIO_CHECK_EQUAL(config->getMajorVersion(), 1); + + // Check the file rules. + + auto rules = config->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "cs1"); + + // Check the v1 in-memory file rules are working. + + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/cs2_file.exr")), "cs2"); + OCIO_CHECK_EQUAL(std::string(config->getColorSpaceFromFilepath("/usr/file.exr")), "cs1"); + + { + // In v2, the first active color space is then used for the 'Default' rule. + + OCIO::ConfigRcPtr cfg; + OCIO_CHECK_NO_THROW(cfg = config->createEditableCopy()); + + // Upgrading is making sure to build a valid v2 config. + + cfg->setInactiveColorSpaces("cs1"); + cfg->upgradeToLatestVersion(); + OCIO_CHECK_NO_THROW(cfg->validate()); + + // Check the new version. + + OCIO_CHECK_EQUAL(cfg->getMajorVersion(), 2); + + // Check the new file rules. + + rules = cfg->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "cs2"); + + OCIO_CHECK_EQUAL(std::string(cfg->getColorSpaceFromFilepath("/usr/cs1_file.exr")), "cs1"); + OCIO_CHECK_EQUAL(std::string(cfg->getColorSpaceFromFilepath("/usr/file.exr")), "cs2"); + } + + { + // In v2, the first color space is used for the 'Default' rule because there no active + // color spaces. + + OCIO::ConfigRcPtr cfg; + OCIO_CHECK_NO_THROW(cfg = config->createEditableCopy()); + + // Upgrading is making sure to build a valid v2 config. + + cfg->setInactiveColorSpaces("cs1, cs2, raw"); + + { + OCIO::LogGuard l; + + cfg->upgradeToLatestVersion(); + + OCIO_CHECK_EQUAL( + std::string("[OpenColorIO Warning]: The default rule creation fallbacks to the"\ + " first color space because no suitable color space exists.\n"), + l.output()); + } + + OCIO_CHECK_NO_THROW(cfg->validate()); + + // Check the new version. + + OCIO_CHECK_EQUAL(cfg->getMajorVersion(), 2); + + // Check the new file rules. + + rules = cfg->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "cs1"); + + OCIO_CHECK_EQUAL(std::string(cfg->getColorSpaceFromFilepath("/usr/raw_file.exr")), "rAw"); + OCIO_CHECK_EQUAL(std::string(cfg->getColorSpaceFromFilepath("/usr/file.exr")), "cs1"); + } + } +} + +OCIO_ADD_TEST(FileRules, config_v1_to_v2_from_memory) +{ + // The unit test checks the file rules from an in-memory v1 config, the upgrade from v1 to v2, + // and finally, the file rules in the upgraded v2 in-memory config. + // + // Note: For now, only the file rules and the versions are impacted by the upgrade. + + // The following tests manually create an in-memory v1 config with faulty file rules. As the + // config file read (which automatically updates in-memory v1 file rules like in previous tests) + // is not used, only an explicit upgrade to the latest version, can fix the file rules. + + { + // The default role is missing but there is an active 'data' color space. + + OCIO::ConfigRcPtr config = OCIO::Config::Create(); + config->setMajorVersion(1); + config->addDisplayView("disp1", "view1", "cs1", nullptr); + OCIO::ColorSpaceRcPtr cs1 = OCIO::ColorSpace::Create(); + cs1->setName("cs1"); + cs1->setIsData(true); + config->addColorSpace(cs1); + OCIO::ColorSpaceRcPtr raw = OCIO::ColorSpace::Create(); + raw->setName("rAw"); + config->addColorSpace(raw); + OCIO_CHECK_NO_THROW(config->validate()); // because file rules are not validated. // Default rule is using 'Default' role that does not exist. + config->setMajorVersion(2); OCIO_CHECK_THROW_WHAT(config->validate(), OCIO::Exception, "rule named 'Default' is " "referencing 'default' that is neither a color space nor a named " "transform"); - config = constConfig->createEditableCopy(); - OCIO_CHECK_EQUAL(config->getNumColorSpaces(), 3); + // Upgrading is making sure to build a valid v2 config. + config->setMajorVersion(1); + config->upgradeToLatestVersion(); + OCIO_CHECK_NO_THROW(config->validate()); + + // Check the new version. + + OCIO_CHECK_EQUAL(config->getMajorVersion(), 2); + + // 'cs1' is an active & 'data' color space. + + auto rules = config->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "cs1"); + } + + // The default role is missing and there is no 'data' color space. + + { + OCIO::ConfigRcPtr config = OCIO::Config::Create(); + config->setMajorVersion(1); + config->addDisplayView("disp1", "view1", "cs1", nullptr); + OCIO::ColorSpaceRcPtr cs1 = OCIO::ColorSpace::Create(); + cs1->setName("cs1"); + config->addColorSpace(cs1); + OCIO::ColorSpaceRcPtr raw = OCIO::ColorSpace::Create(); + raw->setName("rAw"); + config->addColorSpace(raw); + OCIO_CHECK_NO_THROW(config->validate()); // because file rules are not validated. + + // Default rule is using 'Default' role but the associated color space does not exist. + config->setMajorVersion(2); + OCIO_CHECK_THROW_WHAT(config->validate(), OCIO::Exception, "rule named 'Default' is " + "referencing 'default' that is neither a color space nor a named " + "transform"); - // Upgrading is making sure that a valid v1 config will be a valid v2 config. + // Upgrading is making sure to build a valid v2 config. + config->setMajorVersion(1); config->upgradeToLatestVersion(); + OCIO_CHECK_NO_THROW(config->validate()); + + // Check the new version. OCIO_CHECK_EQUAL(config->getMajorVersion(), 2); + + // 'Default' role does not exist, 'Raw' is not a data color-space, so use the first active + // color space. + + auto rules = config->getFileRules(); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "cs1"); + } + + // The default role is missing and there is no 'data' & active color space. The algorithm then + // fallbacks to the first available color space and logs a warning. + + { + OCIO::ConfigRcPtr config = OCIO::Config::Create(); + config->setMajorVersion(1); + config->addDisplayView("disp1", "view1", "cs1", nullptr); + OCIO::ColorSpaceRcPtr cs1 = OCIO::ColorSpace::Create(); + cs1->setName("cs1"); + config->addColorSpace(cs1); + OCIO_CHECK_NO_THROW(config->validate()); // because file rules are not validated. + + // Default rule is using 'Default' role but the associated color space does not exist. + config->setInactiveColorSpaces("cs1"); + config->setMajorVersion(2); + OCIO_CHECK_THROW_WHAT(config->validate(), OCIO::Exception, "rule named 'Default' is " + "referencing 'default' that is neither a color space nor a named " + "transform"); + + config->setMajorVersion(1); + + { + OCIO::LogGuard l; + + config->upgradeToLatestVersion(); + + OCIO_CHECK_EQUAL( + std::string("[OpenColorIO Warning]: The default rule creation fallbacks to the"\ + " first color space because no suitable color space exists.\n"), + l.output()); + } + OCIO_CHECK_NO_THROW(config->validate()); - // 'Default' does not exist, 'Raw' is a data color-space. - OCIO_CHECK_EQUAL(config->getNumColorSpaces(), 3); + // Check the new version. + + OCIO_CHECK_EQUAL(config->getMajorVersion(), 2); + + // Check the 'default' rule. As there is not 'data' or active color space, the default + // rule is using an inactive color space. + auto rules = config->getFileRules(); - const auto numRules = rules->getNumEntries(); - OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(numRules - 1)), "rAw"); + OCIO_CHECK_EQUAL(rules->getNumEntries(), 2); + OCIO_CHECK_EQUAL(std::string(rules->getName(0)), OCIO::FileRules::FilePathSearchRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getName(1)), OCIO::FileRules::DefaultRuleName); + OCIO_CHECK_EQUAL(std::string(rules->getColorSpace(1)), "cs1"); } } From be65c844898beb4134ccc8dc7335cca6e8e4a5f0 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Tue, 11 May 2021 14:04:52 -0400 Subject: [PATCH 02/12] Adsk Contrib - Emergency GPU build fix (#1391) Signed-off-by: Patrick Hodoul --- src/libutils/oglapphelpers/oglapp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutils/oglapphelpers/oglapp.cpp b/src/libutils/oglapphelpers/oglapp.cpp index d6430dabd6..963389d095 100644 --- a/src/libutils/oglapphelpers/oglapp.cpp +++ b/src/libutils/oglapphelpers/oglapp.cpp @@ -301,7 +301,7 @@ void ScreenApp::printGLInfo() const noexcept #ifdef OCIO_HEADLESS_ENABLED -HeadlessApp::HeadlessApp(const char * winTitle, int bufWidth, int bufHeight) +HeadlessApp::HeadlessApp(const char * /* winTitle */, int bufWidth, int bufHeight) : OglApp(bufWidth, bufHeight) , m_pixBufferWidth(bufWidth) , m_pixBufferHeight(bufHeight) From 6653275536a2f00173acd270a8129840ce06ada7 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Fri, 28 May 2021 11:06:45 -0400 Subject: [PATCH 03/12] Adsk Contrib - Fix some bugs found by Maya and SonarCloud (#1403) * Adsk Contrib - Fix some bugs found by Maya and SonarCloud Signed-off-by: Patrick Hodoul * Fix a Windows warning Signed-off-by: Patrick Hodoul --- src/OpenColorIO/Config.cpp | 4 ++-- src/OpenColorIO/DynamicProperty.cpp | 8 ++++---- src/OpenColorIO/DynamicProperty.h | 2 +- src/OpenColorIO/OpOptimizers.cpp | 4 ++-- src/OpenColorIO/ops/allocation/AllocationOp.cpp | 1 - .../ops/gradingprimary/GradingPrimary.cpp | 12 ++++++------ src/OpenColorIO/ops/gradingprimary/GradingPrimary.h | 4 +++- .../cpu/ops/gradingprimary/GradingPrimary_tests.cpp | 7 +++++++ 8 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/OpenColorIO/Config.cpp b/src/OpenColorIO/Config.cpp index dab173bcf1..a3626bced6 100644 --- a/src/OpenColorIO/Config.cpp +++ b/src/OpenColorIO/Config.cpp @@ -997,7 +997,7 @@ class Config::Impl // Note that it adds it or updates the existing one. m_allColorSpaces->addColorSpace(cs); } - catch(const Exception & ex) + catch(const Exception & /* ex */) { DisplayMap::iterator iter = FindDisplay(m_displays, colorSpaceName); if (iter!=m_displays.end()) @@ -1007,7 +1007,7 @@ class Config::Impl m_allColorSpaces->removeColorSpace(colorSpaceName.c_str()); - throw ex; + throw; } // The display must be active. diff --git a/src/OpenColorIO/DynamicProperty.cpp b/src/OpenColorIO/DynamicProperty.cpp index 808fba4930..5885492cfe 100644 --- a/src/OpenColorIO/DynamicProperty.cpp +++ b/src/OpenColorIO/DynamicProperty.cpp @@ -76,25 +76,25 @@ bool DynamicPropertyImpl::equals(const DynamicPropertyImpl & rhs) const { auto lhst = dynamic_cast(this); auto rhst = dynamic_cast(&rhs); - return (lhst->getValue() == rhst->getValue()); + return lhst && rhst && (lhst->getValue() == rhst->getValue()); } case DYNAMIC_PROPERTY_GRADING_PRIMARY: { auto lhst = dynamic_cast(this); auto rhst = dynamic_cast(&rhs); - return (lhst->getValue() == rhst->getValue()); + return lhst && rhst && (lhst->getValue() == rhst->getValue()); } case DYNAMIC_PROPERTY_GRADING_RGBCURVE: { auto lhst = dynamic_cast(this); auto rhst = dynamic_cast(&rhs); - return (*lhst->getValue() == *rhst->getValue()); + return lhst && rhst && (*lhst->getValue() == *rhst->getValue()); } case DYNAMIC_PROPERTY_GRADING_TONE: { auto lhst = dynamic_cast(this); auto rhst = dynamic_cast(&rhs); - return (lhst->getValue() == rhst->getValue()); + return lhst && rhst && (lhst->getValue() == rhst->getValue()); } } // Different values. diff --git a/src/OpenColorIO/DynamicProperty.h b/src/OpenColorIO/DynamicProperty.h index 4bf49ea3c6..0e398d9b30 100644 --- a/src/OpenColorIO/DynamicProperty.h +++ b/src/OpenColorIO/DynamicProperty.h @@ -123,7 +123,7 @@ class DynamicPropertyGradingPrimaryImpl : public DynamicPropertyImpl, const Float3 & getSlope() const { return m_preRenderValues.getSlope(); } // Do not apply the op if all params are identity. - bool getLocalBypass() const { return m_preRenderValues.m_localBypass; } + bool getLocalBypass() const { return m_preRenderValues.getLocalBypass(); } DynamicPropertyGradingPrimaryImplRcPtr createEditableCopy() const; diff --git a/src/OpenColorIO/OpOptimizers.cpp b/src/OpenColorIO/OpOptimizers.cpp index 727e29674a..8b7e2c2fc7 100755 --- a/src/OpenColorIO/OpOptimizers.cpp +++ b/src/OpenColorIO/OpOptimizers.cpp @@ -207,7 +207,7 @@ int RemoveInverseOps(OpRcPtrVec & opVec, OptimizationFlags oFlags) int count = 0; int firstindex = 0; // this must be a signed int - while (firstindex < static_cast(opVec.size() - 1)) + while (firstindex < (static_cast(opVec.size()) - 1)) { ConstOpRcPtr op1 = opVec[firstindex]; ConstOpRcPtr op2 = opVec[firstindex + 1]; @@ -273,7 +273,7 @@ int CombineOps(OpRcPtrVec & opVec, OptimizationFlags oFlags) OpRcPtrVec tmpops; - while (firstindex < static_cast(opVec.size() - 1)) + while (firstindex < (static_cast(opVec.size()) - 1)) { ConstOpRcPtr op1 = opVec[firstindex]; ConstOpRcPtr op2 = opVec[firstindex + 1]; diff --git a/src/OpenColorIO/ops/allocation/AllocationOp.cpp b/src/OpenColorIO/ops/allocation/AllocationOp.cpp index 01fe03d8d2..e8141e38fb 100644 --- a/src/OpenColorIO/ops/allocation/AllocationOp.cpp +++ b/src/OpenColorIO/ops/allocation/AllocationOp.cpp @@ -113,7 +113,6 @@ void CreateAllocationOps(OpRcPtrVec & ops, } case ALLOCATION_UNKNOWN: throw Exception("Unsupported Allocation Type."); - break; } } diff --git a/src/OpenColorIO/ops/gradingprimary/GradingPrimary.cpp b/src/OpenColorIO/ops/gradingprimary/GradingPrimary.cpp index 98a500cf84..8f70916b22 100644 --- a/src/OpenColorIO/ops/gradingprimary/GradingPrimary.cpp +++ b/src/OpenColorIO/ops/gradingprimary/GradingPrimary.cpp @@ -150,8 +150,8 @@ void GradingPrimaryPreRender::update(GradingStyle style, m_isPowerIdentity = m_gamma[0] == 1.0f && m_gamma[1] == 1.0f && m_gamma[2] == 1.0f; m_pivot = 0.5 + v.m_pivot * 0.5; m_localBypass = m_localBypass && m_isPowerIdentity && - m_brightness[0] == 0.f && m_brightness[2] == 0.f && m_brightness[2] == 0.f && - m_contrast[0] == 1.f && m_contrast[2] == 1.f && m_contrast[2] == 1.f; + m_brightness[0] == 0.f && m_brightness[1] == 0.f && m_brightness[2] == 0.f && + m_contrast[0] == 1.f && m_contrast[1] == 1.f && m_contrast[2] == 1.f; break; } case GRADING_LIN: @@ -193,8 +193,8 @@ void GradingPrimaryPreRender::update(GradingStyle style, m_contrast[2] == 1.0f; m_pivot = 0.18 * std::pow(2., v.m_pivot); m_localBypass = m_localBypass && m_isPowerIdentity && - m_exposure[0] == 1.f && m_exposure[2] == 1.f && m_exposure[2] == 1.f && - m_offset[0] == 0.f && m_offset[2] == 0.f && m_offset[2] == 0.f; + m_exposure[0] == 1.f && m_exposure[1] == 1.f && m_exposure[2] == 1.f && + m_offset[0] == 0.f && m_offset[1] == 0.f && m_offset[2] == 0.f; break; } case GRADING_VIDEO: @@ -251,8 +251,8 @@ void GradingPrimaryPreRender::update(GradingStyle style, } m_isPowerIdentity = m_gamma[0] == 1.0f || m_gamma[1] == 1.0f || m_gamma[2] == 1.0f; m_localBypass = m_localBypass && m_isPowerIdentity && - m_slope[0] == 1.f && m_slope[2] == 1.f && m_slope[2] == 1.f && - m_offset[0] == 0.f && m_offset[2] == 0.f && m_offset[2] == 0.f; + m_slope[0] == 1.f && m_slope[1] == 1.f && m_slope[2] == 1.f && + m_offset[0] == 0.f && m_offset[1] == 0.f && m_offset[2] == 0.f; break; } } diff --git a/src/OpenColorIO/ops/gradingprimary/GradingPrimary.h b/src/OpenColorIO/ops/gradingprimary/GradingPrimary.h index 8fbda9a2a5..9a47be5a53 100644 --- a/src/OpenColorIO/ops/gradingprimary/GradingPrimary.h +++ b/src/OpenColorIO/ops/gradingprimary/GradingPrimary.h @@ -24,7 +24,7 @@ struct GradingPrimaryPreRender void update(GradingStyle style, TransformDirection dir, const GradingPrimary & v) noexcept; // Do not apply the op if all params are identity. - bool m_localBypass{ false }; + bool getLocalBypass() const { return m_localBypass; } // Access to the precomputed values. Note that values are already inversed based on the // direction so that no computation is required before using them. @@ -58,6 +58,8 @@ struct GradingPrimaryPreRender double m_pivot{ 0. }; bool m_isPowerIdentity{ false }; + + bool m_localBypass{ false }; }; bool operator==(const GradingRGBM & lhs, const GradingRGBM & rhs); diff --git a/tests/cpu/ops/gradingprimary/GradingPrimary_tests.cpp b/tests/cpu/ops/gradingprimary/GradingPrimary_tests.cpp index 16dca08f5f..a9d0f3e641 100644 --- a/tests/cpu/ops/gradingprimary/GradingPrimary_tests.cpp +++ b/tests/cpu/ops/gradingprimary/GradingPrimary_tests.cpp @@ -90,7 +90,14 @@ OCIO_ADD_TEST(GradingPrimary, precompute) OCIO_CHECK_CLOSE(comp.getPivot(), 0.4f, 1.e-6f); OCIO_CHECK_ASSERT(comp.isGammaIdentity()); + gp.m_brightness.m_green = 0.1 * 1023. / 6.25; + comp.update(OCIO::GRADING_LOG, OCIO::TRANSFORM_DIR_FORWARD, gp); + OCIO_CHECK_ASSERT(comp.getBrightness() == OCIO::Float3({ 0.f, 0.1f, 0.f })); + OCIO_CHECK_ASSERT(!comp.getLocalBypass()); + OCIO_CHECK_ASSERT(comp.isGammaIdentity()); + gp.m_brightness.m_red = 0.1 * 1023. / 6.25; + gp.m_brightness.m_green = 0.; gp.m_contrast.m_red = 0.; // Inverse will be 1. gp.m_contrast.m_green = 1.25; gp.m_gamma.m_blue = 0.8; From 1eebf7101e5e24c480fd0badde87777f594f3a9b Mon Sep 17 00:00:00 2001 From: Brendan Bolles Date: Wed, 2 Jun 2021 08:21:10 -0700 Subject: [PATCH 04/12] After Effects and Photoshop plug-in updates (#1373) * Set Mac OS deployment target to 10.10 Signed-off-by: Brendan Bolles * More 10.10 targets Signed-off-by: Brendan Bolles * Ditch ADD_EXTRA_BUILTINS Signed-off-by: Brendan Bolles * Getting strange callback when AE effect is pasted Signed-off-by: Brendan Bolles * Use NDEBUG in AE project Signed-off-by: Brendan Bolles * Disable radio buttons with no config Signed-off-by: Brendan Bolles * Update version Signed-off-by: Brendan Bolles * Move to AE 2021 SDK, set PF_OutFlag2_MUTABLE_RENDER_SEQUENCE_DATA_SLOWER Signed-off-by: Brendan Bolles * Define OCIO_DEPRECATED in After Effects builds Signed-off-by: Brendan Bolles * Verify change from color space menu Signed-off-by: Brendan Bolles * Handle situation where color space has a '/' in it Signed-off-by: Brendan Bolles * Windows family separator fix Signed-off-by: Brendan Bolles * Invert everything Signed-off-by: Brendan Bolles * Invert everything Windows Signed-off-by: Brendan Bolles * Disable more controls Signed-off-by: Brendan Bolles * Incorporate invert into LUT export Signed-off-by: Brendan Bolles * Get rid of fullPaths stuff Signed-off-by: Brendan Bolles * Fix changed config settings retention Signed-off-by: Brendan Bolles Co-authored-by: Patrick Hodoul Signed-off-by: Patrick Hodoul --- vendor/aftereffects/OpenColorIO_AE.cpp | 5 +- .../aftereffects/OpenColorIO_AE_Context.cpp | 118 +- vendor/aftereffects/OpenColorIO_AE_Context.h | 9 +- vendor/aftereffects/OpenColorIO_AE_PiPL.r | 2 +- vendor/aftereffects/OpenColorIO_AE_UI.cpp | 168 +- .../mac/OpenColorIO_AE_Dialogs_Cocoa.mm | 16 +- vendor/aftereffects/vc/vc15/OpenColorABI.h | 21 +- .../aftereffects/vc/vc15/OpenColorIO.vcxproj | 16 +- .../vc15/aftereffects/OpenColorIO_AE.vcxproj | 70 +- .../win/OpenColorIO_AE_Dialogs_Win.cpp | 20 +- .../aftereffects/xcode/xcode12/OpenColorABI.h | 23 +- .../OpenColorIO.xcodeproj/project.pbxproj | 8 +- .../OpenColorIO_AE.xcodeproj/project.pbxproj | 12 +- .../ext/expat.xcodeproj/project.pbxproj | 2 + .../ext/ilmbasehalf.xcodeproj/project.pbxproj | 2 + .../ext/lcms.xcodeproj/project.pbxproj | 2 + .../ext/pystring.xcodeproj/project.pbxproj | 4 +- .../ext/yaml.xcodeproj/project.pbxproj | 2 + .../aftereffects/xcode/xcode9/OpenColorABI.h | 23 +- .../OpenColorIO.xcodeproj/project.pbxproj | 8 +- .../OpenColorIO_AE.xcodeproj/project.pbxproj | 22 +- .../ext/expat.xcodeproj/project.pbxproj | 2 + .../ext/ilmbasehalf.xcodeproj/project.pbxproj | 2 + .../xcode9/ext/lcms.xcodeproj/project.pbxproj | 2 + .../ext/pystring.xcodeproj/project.pbxproj | 4 +- .../xcode9/ext/yaml.xcodeproj/project.pbxproj | 2 + vendor/photoshop/OpenColorIO_PS.cpp | 12 +- vendor/photoshop/OpenColorIO_PS_Context.cpp | 76 +- vendor/photoshop/OpenColorIO_PS_Context.h | 21 +- vendor/photoshop/OpenColorIO_PS_Version.h | 8 +- .../photoshop/mac/OpenColorIO_PS_Dialog.xib | 2256 ++--------------- .../mac/OpenColorIO_PS_Dialog_Controller.h | 10 +- .../mac/OpenColorIO_PS_Dialog_Controller.mm | 97 +- vendor/photoshop/win/OpenColorIO_PS_Dialog.rc | 2 +- .../win/OpenColorIO_PS_Dialogs_Win.cpp | 91 +- .../OpenColorIO_PS.xcodeproj/project.pbxproj | 8 +- .../OpenColorIO_PS.xcodeproj/project.pbxproj | 14 +- 37 files changed, 777 insertions(+), 2383 deletions(-) diff --git a/vendor/aftereffects/OpenColorIO_AE.cpp b/vendor/aftereffects/OpenColorIO_AE.cpp index a68c3dd090..29d91c9686 100755 --- a/vendor/aftereffects/OpenColorIO_AE.cpp +++ b/vendor/aftereffects/OpenColorIO_AE.cpp @@ -57,7 +57,8 @@ static PF_Err GlobalSetup( PF_OutFlag2_FLOAT_COLOR_AWARE | PF_OutFlag2_PPRO_DO_NOT_CLONE_SEQUENCE_DATA_FOR_RENDER | PF_OutFlag2_SUPPORTS_GET_FLATTENED_SEQUENCE_DATA | - PF_OutFlag2_SUPPORTS_THREADED_RENDERING; + PF_OutFlag2_SUPPORTS_THREADED_RENDERING | + PF_OutFlag2_MUTABLE_RENDER_SEQUENCE_DATA_SLOWER; GlobalSetup_GL(); @@ -389,7 +390,7 @@ static PF_Err SequenceResetup( PF_UNLOCK_HANDLE(in_data->sequence_data); } else - assert(FALSE); + err = SequenceSetup(in_data, out_data, params, output); // getting this after pasting the effect return err; } diff --git a/vendor/aftereffects/OpenColorIO_AE_Context.cpp b/vendor/aftereffects/OpenColorIO_AE_Context.cpp index 9d52e6b2b4..e8a532ab3d 100644 --- a/vendor/aftereffects/OpenColorIO_AE_Context.cpp +++ b/vendor/aftereffects/OpenColorIO_AE_Context.cpp @@ -336,15 +336,7 @@ OpenColorIO_AE_Context::OpenColorIO_AE_Context(const std::string &path, OCIO_Sou { const char *colorSpaceName = _config->getColorSpaceNameByIndex(i); - OCIO::ConstColorSpaceRcPtr colorSpace = _config->getColorSpace(colorSpaceName); - - const char *family = colorSpace->getFamily(); - - _inputs.push_back(colorSpaceName); - - const std::string fullPath = (family == NULL ? colorSpaceName : std::string(family) + "/" + colorSpaceName); - - _inputsFullPath.push_back(fullPath); + _colorSpaces.push_back(colorSpaceName); } @@ -359,7 +351,7 @@ OpenColorIO_AE_Context::OpenColorIO_AE_Context(const std::string &path, OCIO_Sou const char *defaultInputName = (defaultInput ? defaultInput->getName() : OCIO::ROLE_DEFAULT); - setupConvert(defaultInputName, defaultInputName); + setupConvert(defaultInputName, defaultInputName, OCIO_INVERT_OFF); const char *defaultDisplay = _config->getDefaultDisplay(); @@ -372,7 +364,7 @@ OpenColorIO_AE_Context::OpenColorIO_AE_Context(const std::string &path, OCIO_Sou { _config = OCIO::Config::Create(); - setupLUT(false, OCIO_INTERP_LINEAR); + setupLUT(OCIO_INVERT_OFF, OCIO_INTERP_LINEAR); } } else @@ -439,15 +431,7 @@ OpenColorIO_AE_Context::OpenColorIO_AE_Context(const ArbitraryData *arb_data, co { const char *colorSpaceName = _config->getColorSpaceNameByIndex(i); - OCIO::ConstColorSpaceRcPtr colorSpace = _config->getColorSpace(colorSpaceName); - - const char *family = colorSpace->getFamily(); - - _inputs.push_back(colorSpaceName); - - const std::string fullPath = (family == NULL ? colorSpaceName : std::string(family) + "/" + colorSpaceName); - - _inputsFullPath.push_back(fullPath); + _colorSpaces.push_back(colorSpaceName); } @@ -458,14 +442,14 @@ OpenColorIO_AE_Context::OpenColorIO_AE_Context(const ArbitraryData *arb_data, co if(arb_data->action == OCIO_ACTION_CONVERT) { - setupConvert(arb_data->input, arb_data->output); + setupConvert(arb_data->input, arb_data->output, arb_data->invert); _display = arb_data->display; _view = arb_data->view; } else { - setupDisplay(arb_data->input, arb_data->display, arb_data->view); + setupDisplay(arb_data->input, arb_data->display, arb_data->view, arb_data->invert); _output = arb_data->output; } @@ -550,9 +534,10 @@ bool OpenColorIO_AE_Context::Verify(const ArbitraryData *arb_data, const std::st { if(_input != arb_data->input || _output != arb_data->output || + _invert != arb_data->invert || force_reset) { - setupConvert(arb_data->input, arb_data->output); + setupConvert(arb_data->input, arb_data->output, arb_data->invert); } } else if(arb_data->action == OCIO_ACTION_DISPLAY) @@ -560,9 +545,10 @@ bool OpenColorIO_AE_Context::Verify(const ArbitraryData *arb_data, const std::st if(_input != arb_data->input || _display != arb_data->display || _view != arb_data->view || + _invert != arb_data->invert || force_reset) { - setupDisplay(arb_data->input, arb_data->display, arb_data->view); + setupDisplay(arb_data->input, arb_data->display, arb_data->view, arb_data->invert); } } else @@ -573,29 +559,39 @@ bool OpenColorIO_AE_Context::Verify(const ArbitraryData *arb_data, const std::st } -void OpenColorIO_AE_Context::setupConvert(const char *input, const char *output) +void OpenColorIO_AE_Context::setupConvert(const char *input, const char *output, OCIO_Invert invert) { OCIO::ColorSpaceTransformRcPtr transform = OCIO::ColorSpaceTransform::Create(); transform->setSrc(input); transform->setDst(output); - transform->setDirection(OCIO::TRANSFORM_DIR_FORWARD); + transform->setDirection(invert == OCIO_INVERT_OFF ? OCIO::TRANSFORM_DIR_FORWARD : OCIO::TRANSFORM_DIR_INVERSE); _input = input; _output = output; + _invert = invert; - _processor = _config->getProcessor(transform); - _cpu_processor = _processor->getDefaultCPUProcessor(); - _gpu_processor = _processor->getDefaultGPUProcessor(); + _processor = _config->getProcessor(transform); + if(invert == OCIO_INVERT_EXACT) + { + _cpu_processor = _processor->getOptimizedCPUProcessor(OCIO::OPTIMIZATION_LOSSLESS); + _gpu_processor = _processor->getOptimizedGPUProcessor(OCIO::OPTIMIZATION_LOSSLESS); + } + else + { + _cpu_processor = _processor->getDefaultCPUProcessor(); + _gpu_processor = _processor->getDefaultGPUProcessor(); + } + _action = OCIO_ACTION_CONVERT; UpdateOCIOGLState(); } -void OpenColorIO_AE_Context::setupDisplay(const char *input, const char *display, const char *view) +void OpenColorIO_AE_Context::setupDisplay(const char *input, const char *display, const char *view, OCIO_Invert invert) { _views.clear(); @@ -620,17 +616,27 @@ void OpenColorIO_AE_Context::setupDisplay(const char *input, const char *display transform->setSrc(input); transform->setDisplay(display); transform->setView(view); - + transform->setDirection(invert == OCIO_INVERT_OFF ? OCIO::TRANSFORM_DIR_FORWARD : OCIO::TRANSFORM_DIR_INVERSE); + _input = input; _display = display; _view = view; + _invert = invert; _processor = _config->getProcessor(transform); - _cpu_processor = _processor->getDefaultCPUProcessor(); - _gpu_processor = _processor->getDefaultGPUProcessor(); - + if(invert == OCIO_INVERT_EXACT) + { + _cpu_processor = _processor->getOptimizedCPUProcessor(OCIO::OPTIMIZATION_LOSSLESS); + _gpu_processor = _processor->getOptimizedGPUProcessor(OCIO::OPTIMIZATION_LOSSLESS); + } + else + { + _cpu_processor = _processor->getDefaultCPUProcessor(); + _gpu_processor = _processor->getDefaultGPUProcessor(); + } + _action = OCIO_ACTION_DISPLAY; UpdateOCIOGLState(); @@ -652,6 +658,7 @@ void OpenColorIO_AE_Context::setupLUT(OCIO_Invert invert, OCIO_Interp interpolat transform->setInterpolation(static_cast(interpolation)); transform->setDirection(invert > OCIO_INVERT_OFF ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); + _processor = _config->getProcessor(transform); if(invert == OCIO_INVERT_EXACT) @@ -676,22 +683,22 @@ void OpenColorIO_AE_Context::setupLUT(OCIO_Invert invert, OCIO_Interp interpolat bool OpenColorIO_AE_Context::ExportLUT(const std::string &path, const std::string &display_icc_path) { - std::string the_extension = path.substr( path.find_last_of('.') + 1 ); + const std::string the_extension = path.substr( path.find_last_of('.') + 1 ); try{ if(the_extension == "icc") { - int cubesize = 32; - int whitepointtemp = 6505; - std::string copyright = ""; + const int cubesize = 32; + const int whitepointtemp = 6505; + const std::string copyright = ""; // create a description tag from the filename - size_t filename_start = path.find_last_of(delimiter) + 1; - size_t filename_end = path.find_last_of('.') - 1; + const size_t filename_start = path.find_last_of(delimiter) + 1; + const size_t filename_end = path.find_last_of('.') - 1; - std::string description = path.substr(path.find_last_of(delimiter) + 1, - 1 + filename_end - filename_start); + const std::string description = path.substr(path.find_last_of(delimiter) + 1, + 1 + filename_end - filename_start); SaveICCProfileToFile(path, _cpu_processor, cubesize, whitepointtemp, display_icc_path, description, copyright, false); @@ -700,18 +707,22 @@ bool OpenColorIO_AE_Context::ExportLUT(const std::string &path, const std::strin { // this code lovingly pulled from ociobakelut - // need an extension->format map (yes, just did this one call up) - std::map extensions; + std::string format; for(int i=0; i < OCIO::Baker::getNumFormats(); ++i) { const char *extension = OCIO::Baker::getFormatExtensionByIndex(i); - const char *format = OCIO::Baker::getFormatNameByIndex(i); + const char *formatName = OCIO::Baker::getFormatNameByIndex(i); - extensions[ extension ] = format; + if(the_extension == extension) + { + format = formatName; + break; + } } - std::string format = extensions[ the_extension ]; + if(format.empty()) + return false; OCIO::BakerRcPtr baker = OCIO::Baker::Create(); @@ -721,8 +732,8 @@ bool OpenColorIO_AE_Context::ExportLUT(const std::string &path, const std::strin if(_action == OCIO_ACTION_CONVERT) { baker->setConfig(_config); - baker->setInputSpace(_input.c_str()); - baker->setTargetSpace(_output.c_str()); + baker->setInputSpace(_invert ? _output.c_str() : _input.c_str()); + baker->setTargetSpace(_invert ? _input.c_str() : _output.c_str()); std::ofstream f(path.c_str()); baker->bake(f); @@ -732,13 +743,13 @@ bool OpenColorIO_AE_Context::ExportLUT(const std::string &path, const std::strin OCIO::ConfigRcPtr editableConfig = _config->createEditableCopy(); OCIO::ColorSpaceRcPtr inputColorSpace = OCIO::ColorSpace::Create(); - std::string inputspace = "RawInput"; + const std::string inputspace = "RawInput"; inputColorSpace->setName(inputspace.c_str()); editableConfig->addColorSpace(inputColorSpace); OCIO::ColorSpaceRcPtr outputColorSpace = OCIO::ColorSpace::Create(); - std::string outputspace = "ProcessedOutput"; + const std::string outputspace = "ProcessedOutput"; outputColorSpace->setName(outputspace.c_str()); OCIO::DisplayViewTransformRcPtr transform = OCIO::DisplayViewTransform::Create(); @@ -746,6 +757,7 @@ bool OpenColorIO_AE_Context::ExportLUT(const std::string &path, const std::strin transform->setSrc(_input.c_str()); transform->setDisplay(_display.c_str()); transform->setView(_view.c_str()); + transform->setDirection(_invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); outputColorSpace->setTransform(transform, OCIO::COLORSPACE_DIR_FROM_REFERENCE); @@ -764,13 +776,13 @@ bool OpenColorIO_AE_Context::ExportLUT(const std::string &path, const std::strin OCIO::ConfigRcPtr editableConfig = OCIO::Config::Create(); OCIO::ColorSpaceRcPtr inputColorSpace = OCIO::ColorSpace::Create(); - std::string inputspace = "RawInput"; + const std::string inputspace = "RawInput"; inputColorSpace->setName(inputspace.c_str()); editableConfig->addColorSpace(inputColorSpace); OCIO::ColorSpaceRcPtr outputColorSpace = OCIO::ColorSpace::Create(); - std::string outputspace = "ProcessedOutput"; + const std::string outputspace = "ProcessedOutput"; outputColorSpace->setName(outputspace.c_str()); OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create(); diff --git a/vendor/aftereffects/OpenColorIO_AE_Context.h b/vendor/aftereffects/OpenColorIO_AE_Context.h index 026006b5b5..6259ff8fcc 100644 --- a/vendor/aftereffects/OpenColorIO_AE_Context.h +++ b/vendor/aftereffects/OpenColorIO_AE_Context.h @@ -57,8 +57,8 @@ class OpenColorIO_AE_Context bool Verify(const ArbitraryData *arb_data, const std::string &dir); - void setupConvert(const char *input, const char *output); - void setupDisplay(const char *input, const char *display, const char *view); + void setupConvert(const char *input, const char *output, OCIO_Invert invert); + void setupDisplay(const char *input, const char *display, const char *view, OCIO_Invert invert); void setupLUT(OCIO_Invert invert, OCIO_Interp interpolation); typedef std::vector SpaceVec; @@ -68,7 +68,7 @@ class OpenColorIO_AE_Context const std::string & getOutput() const { return _output; } const std::string & getDisplay() const { return _display; } const std::string & getView() const { return _view; } - const SpaceVec & getInputs(bool fullPath=false) const { return fullPath ? _inputsFullPath : _inputs; } + const SpaceVec & getColorSpaces() const { return _colorSpaces; } const SpaceVec & getDisplays() const { return _displays; } const SpaceVec & getViews() const { return _views; } @@ -96,8 +96,7 @@ class OpenColorIO_AE_Context std::string _output; std::string _display; std::string _view; - SpaceVec _inputs; - SpaceVec _inputsFullPath; + SpaceVec _colorSpaces; SpaceVec _displays; SpaceVec _views; diff --git a/vendor/aftereffects/OpenColorIO_AE_PiPL.r b/vendor/aftereffects/OpenColorIO_AE_PiPL.r index 6ed295886d..e22833835f 100644 --- a/vendor/aftereffects/OpenColorIO_AE_PiPL.r +++ b/vendor/aftereffects/OpenColorIO_AE_PiPL.r @@ -60,7 +60,7 @@ resource 'PiPL' (16000) { 50365504 }, AE_Effect_Global_OutFlags_2 { - 142644232 + 411079688 }, /* [11] */ AE_Effect_Match_Name { diff --git a/vendor/aftereffects/OpenColorIO_AE_UI.cpp b/vendor/aftereffects/OpenColorIO_AE_UI.cpp index 46dc8e90db..2d38dfb301 100644 --- a/vendor/aftereffects/OpenColorIO_AE_UI.cpp +++ b/vendor/aftereffects/OpenColorIO_AE_UI.cpp @@ -68,6 +68,7 @@ typedef enum { REGION_PATH, REGION_CONVERT_BUTTON, REGION_DISPLAY_BUTTON, + REGION_INVERT_BUTTON, REGION_EXPORT_BUTTON, REGION_MENU1, REGION_MENU2, @@ -109,13 +110,17 @@ static UIRegion WhichRegion(PF_Point ui_point, bool menus, bool third_menu) const int convert_right = convert_left + BUTTON_WIDTH; const int display_left = convert_right + BUTTONS_GAP_H; const int display_right = display_left + BUTTON_WIDTH; - const int export_left = display_right + BUTTONS_GAP_H; + const int invert_left = display_right + BUTTONS_GAP_H + BUTTONS_GAP_H; + const int invert_right = invert_left + BUTTON_WIDTH; + const int export_left = invert_right + BUTTONS_GAP_H; const int export_right = export_left + BUTTON_WIDTH; if(ui_point.h >= convert_left && ui_point.h <= convert_right) return REGION_CONVERT_BUTTON; else if(ui_point.h >= display_left && ui_point.h <= display_right) return REGION_DISPLAY_BUTTON; + else if(ui_point.h >= invert_left && ui_point.h <= invert_right) + return REGION_INVERT_BUTTON; else if(ui_point.h >= export_left && ui_point.h <= export_right) return REGION_EXPORT_BUTTON; } @@ -405,28 +410,28 @@ static PF_Err DrawEvent( } #endif - // Export button if(arb_data->action != OCIO_ACTION_NONE) { - bot.MoveTo(panel_left + BUTTONS_INDENT_H + (2 * (BUTTON_WIDTH + BUTTONS_GAP_H)), buttons_top); + // Export button + bot.MoveTo(panel_left + BUTTONS_INDENT_H + (3 * (BUTTON_WIDTH + BUTTONS_GAP_H)) + BUTTONS_GAP_H, buttons_top); DrawButton(bot, "Export...", BUTTON_WIDTH, false); - } - - if(arb_data->action == OCIO_ACTION_LUT) - { + // Invert button - bot.MoveTo(panel_left + BUTTONS_INDENT_H, buttons_top); + bot.Move(-(BUTTON_WIDTH + BUTTONS_GAP_H)); DrawButton(bot, "Invert", BUTTON_WIDTH, arb_data->invert > OCIO_INVERT_OFF); if(arb_data->invert == OCIO_INVERT_EXACT) { - bot.Move(BUTTON_WIDTH + FIELD_TEXT_INDENT_H, BUTTON_HEIGHT * 3 / 4); + bot.Move((BUTTON_WIDTH / 2) + 2, (BUTTON_HEIGHT * 7 / 4) - 2); - bot.DrawString("Exact"); + bot.DrawString("Exact", kDRAWBOT_TextAlignment_Center); } - + } + + if(arb_data->action == OCIO_ACTION_LUT) + { // interpolation menu const int buttons_bottom = buttons_top + BUTTON_HEIGHT; @@ -441,8 +446,7 @@ static PF_Err DrawEvent( DrawMenu(bot, menu_width, "Interpolation:", txt); } - else if(arb_data->action == OCIO_ACTION_CONVERT || - arb_data->action == OCIO_ACTION_DISPLAY) + else if(arb_data->action == OCIO_ACTION_CONVERT || arb_data->action == OCIO_ACTION_DISPLAY) { // Convert/Display buttons bot.MoveTo(panel_left + BUTTONS_INDENT_H, buttons_top); @@ -631,9 +635,8 @@ static void DoClickPath( (OCIO_ACTION_LUT == new_context->getAction() && OCIO_ACTION_LUT != arb_data->action) || (OCIO_ACTION_LUT != new_context->getAction() && OCIO_ACTION_LUT == arb_data->action) || (OCIO_ACTION_LUT != new_context->getAction() && - (-1 == FindInVec(new_context->getInputs(), arb_data->input) || - -1 == FindInVec(new_context->getInputs(), arb_data->output) || - -1 == FindInVec(new_context->getViews(), arb_data->view) || + (-1 == FindInVec(new_context->getColorSpaces(), arb_data->input) || + -1 == FindInVec(new_context->getColorSpaces(), arb_data->output) || -1 == FindInVec(new_context->getDisplays(), arb_data->display) ) ) ) { // Configuration is different, so initialize defaults @@ -661,11 +664,11 @@ static void DoClickPath( } else if(arb_data->action == OCIO_ACTION_CONVERT) { - seq_data->context->setupConvert(arb_data->input, arb_data->output); + seq_data->context->setupConvert(arb_data->input, arb_data->output, arb_data->invert); } else if(arb_data->action == OCIO_ACTION_DISPLAY) { - seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view); + seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view, arb_data->invert); // view may have changed nt_strncpy(arb_data->view, seq_data->context->getView().c_str(), ARB_SPACE_LEN+1); @@ -803,9 +806,8 @@ static void DoClickConfig( (OCIO_ACTION_LUT == new_context->getAction() && OCIO_ACTION_LUT != arb_data->action) || (OCIO_ACTION_LUT != new_context->getAction() && OCIO_ACTION_LUT == arb_data->action) || (OCIO_ACTION_LUT != new_context->getAction() && - (-1 == FindInVec(new_context->getInputs(), arb_data->input) || - -1 == FindInVec(new_context->getInputs(), arb_data->output) || - -1 == FindInVec(new_context->getViews(), arb_data->view) || + (-1 == FindInVec(new_context->getColorSpaces(), arb_data->input) || + -1 == FindInVec(new_context->getColorSpaces(), arb_data->output) || -1 == FindInVec(new_context->getDisplays(), arb_data->display) ) ) ) { // Configuration is different, so initialize defaults @@ -833,11 +835,11 @@ static void DoClickConfig( } else if(arb_data->action == OCIO_ACTION_CONVERT) { - seq_data->context->setupConvert(arb_data->input, arb_data->output); + seq_data->context->setupConvert(arb_data->input, arb_data->output, arb_data->invert); } else if(arb_data->action == OCIO_ACTION_DISPLAY) { - seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view); + seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view, arb_data->invert); // view may have changed nt_strncpy(arb_data->view, seq_data->context->getView().c_str(), ARB_SPACE_LEN+1); @@ -862,46 +864,61 @@ static void DoClickConvertDisplay( SequenceData *seq_data, UIRegion reg ) { - if(arb_data->action == OCIO_ACTION_LUT) + if(reg == REGION_CONVERT_BUTTON && arb_data->action == OCIO_ACTION_DISPLAY) { - if(reg == REGION_CONVERT_BUTTON) // i.e. Invert - { - // doing it this way so that any exceptions thrown by setupLUT - // because the LUT can't be inverted are thrown before - // I actually chenge the ArbData setting - const OCIO_Invert new_invert = (arb_data->invert == OCIO_INVERT_OFF ? - (event_extra->u.do_click.modifiers == PF_Mod_NONE ? OCIO_INVERT_ON : OCIO_INVERT_EXACT) : - OCIO_INVERT_OFF); - - seq_data->context->setupLUT(new_invert, arb_data->interpolation); - - arb_data->invert = new_invert; + arb_data->action = OCIO_ACTION_CONVERT; - params[OCIO_DATA]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE; - } + seq_data->context->setupConvert(arb_data->input, arb_data->output, arb_data->invert); + + params[OCIO_DATA]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE; } - else if(arb_data->action == OCIO_ACTION_CONVERT || arb_data->action == OCIO_ACTION_DISPLAY) + else if(reg == REGION_DISPLAY_BUTTON && arb_data->action == OCIO_ACTION_CONVERT) { - if(reg == REGION_CONVERT_BUTTON && arb_data->action != OCIO_ACTION_CONVERT) - { - arb_data->action = OCIO_ACTION_CONVERT; - - seq_data->context->setupConvert(arb_data->input, arb_data->output); + arb_data->action = OCIO_ACTION_DISPLAY; - params[OCIO_DATA]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE; - } - else if(reg == REGION_DISPLAY_BUTTON && arb_data->action != OCIO_ACTION_DISPLAY) - { - arb_data->action = OCIO_ACTION_DISPLAY; - - seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view); - - // view may have changed - nt_strncpy(arb_data->view, seq_data->context->getView().c_str(), ARB_SPACE_LEN+1); - - params[OCIO_DATA]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE; - } + seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view, arb_data->invert); + + // view may have changed + nt_strncpy(arb_data->view, seq_data->context->getView().c_str(), ARB_SPACE_LEN+1); + + params[OCIO_DATA]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE; + } +} + + +static void DoClickInvert( + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *output, + PF_EventExtra *event_extra, + ArbitraryData *arb_data, + SequenceData *seq_data, + UIRegion reg ) +{ + // doing it this way so that any exceptions thrown by setupXXX + // because the LUT can't be inverted are thrown before + // I actually chenge the ArbData setting + const OCIO_Invert new_invert = (arb_data->invert == OCIO_INVERT_OFF ? + (event_extra->u.do_click.modifiers == PF_Mod_NONE ? OCIO_INVERT_ON : OCIO_INVERT_EXACT) : + OCIO_INVERT_OFF); + + if(arb_data->action == OCIO_ACTION_LUT) + { + seq_data->context->setupLUT(new_invert, arb_data->interpolation); } + else if(arb_data->action == OCIO_ACTION_CONVERT) + { + seq_data->context->setupConvert(arb_data->input, arb_data->output, new_invert); + } + else if(arb_data->action == OCIO_ACTION_DISPLAY) + { + seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view, new_invert); + } + + arb_data->invert = new_invert; + + params[OCIO_DATA]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE; } @@ -966,7 +983,12 @@ static void DoClickExport( } if(do_export) - seq_data->context->ExportLUT(the_path, monitor_icc_path); + { + const bool exported = seq_data->context->ExportLUT(the_path, monitor_icc_path); + + if(!exported) + throw OCIO::Exception("Failed to Export LUT"); + } } } @@ -1019,6 +1041,15 @@ static void DoClickMenus( nt_strncpy(arb_data->output, selected_item.c_str(), ARB_SPACE_LEN+1); } + if(arb_data->action == OCIO_ACTION_CONVERT) + { + seq_data->context->setupConvert(arb_data->input, arb_data->output, arb_data->invert); + } + else if(arb_data->action == OCIO_ACTION_DISPLAY) + { + seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view, arb_data->invert); + } + params[OCIO_DATA]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE; } } @@ -1049,7 +1080,9 @@ static void DoClickMenus( } else if(arb_data->action == OCIO_ACTION_CONVERT) { - menu_items = seq_data->context->getInputs(); + assert(FALSE); + + menu_items = seq_data->context->getColorSpaces(); if(reg == REGION_MENU1) { @@ -1064,7 +1097,9 @@ static void DoClickMenus( { if(reg == REGION_MENU1) { - menu_items = seq_data->context->getInputs(); + assert(FALSE); + + menu_items = seq_data->context->getColorSpaces(); selected_item = FindInVec(menu_items, arb_data->input); } @@ -1112,6 +1147,8 @@ static void DoClickMenus( } else if(arb_data->action == OCIO_ACTION_CONVERT) { + assert(FALSE); + if(reg == REGION_MENU1) { nt_strncpy(arb_data->input, color_space.c_str(), ARB_SPACE_LEN+1); @@ -1121,12 +1158,14 @@ static void DoClickMenus( nt_strncpy(arb_data->output, color_space.c_str(), ARB_SPACE_LEN+1); } - seq_data->context->setupConvert(arb_data->input, arb_data->output); + seq_data->context->setupConvert(arb_data->input, arb_data->output, arb_data->invert); } else if(arb_data->action == OCIO_ACTION_DISPLAY) { if(reg == REGION_MENU1) { + assert(FALSE); + nt_strncpy(arb_data->input, color_space.c_str(), ARB_SPACE_LEN+1); } else if(reg == REGION_MENU2) @@ -1138,7 +1177,7 @@ static void DoClickMenus( nt_strncpy(arb_data->view, color_space.c_str(), ARB_SPACE_LEN+1); } - seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view); + seq_data->context->setupDisplay(arb_data->input, arb_data->display, arb_data->view, arb_data->invert); // view may have changed nt_strncpy(arb_data->view, seq_data->context->getView().c_str(), ARB_SPACE_LEN+1); @@ -1207,6 +1246,11 @@ static PF_Err DoClick( DoClickConvertDisplay(in_data, out_data, params, output, event_extra, arb_data, seq_data, reg); } + else if(reg == REGION_INVERT_BUTTON) + { + DoClickInvert(in_data, out_data, params, output, + event_extra, arb_data, seq_data, reg); + } else if(reg == REGION_EXPORT_BUTTON) { DoClickExport(in_data, out_data, params, output, diff --git a/vendor/aftereffects/mac/OpenColorIO_AE_Dialogs_Cocoa.mm b/vendor/aftereffects/mac/OpenColorIO_AE_Dialogs_Cocoa.mm index 0e45bcff7b..bead170172 100644 --- a/vendor/aftereffects/mac/OpenColorIO_AE_Dialogs_Cocoa.mm +++ b/vendor/aftereffects/mac/OpenColorIO_AE_Dialogs_Cocoa.mm @@ -223,21 +223,17 @@ bool ColorSpacePopUpMenu(OCIO::ConstConfigRcPtr config, std::string &colorSpace, const char *family = colorSpacePtr->getFamily(); - NSString *colorSpacePath = nil; + NSMutableArray *pathComponents = [NSMutableArray array]; - if(family == NULL || family == std::string("")) + if(family != NULL && family != std::string("")) { - colorSpacePath = [NSString stringWithUTF8String:colorSpaceName]; - } - else - { - colorSpacePath = [NSString stringWithFormat:@"%s/%s", family, colorSpaceName]; + assert(config->getFamilySeparator() == '/'); + + [pathComponents addObjectsFromArray:[[NSString stringWithUTF8String:family] pathComponents]]; } + [pathComponents addObject:[NSString stringWithUTF8String:colorSpaceName]]; - assert(config->getFamilySeparator() == '/'); - - NSArray *pathComponents = [colorSpacePath pathComponents]; NSMenu *currentMenu = menu; diff --git a/vendor/aftereffects/vc/vc15/OpenColorABI.h b/vendor/aftereffects/vc/vc15/OpenColorABI.h index 4dea5741f0..77be7ec33c 100644 --- a/vendor/aftereffects/vc/vc15/OpenColorABI.h +++ b/vendor/aftereffects/vc/vc15/OpenColorABI.h @@ -7,9 +7,9 @@ // Makefile configuration options #define OCIO_NAMESPACE OpenColorIO -#define OCIO_VERSION_STR "2.0.0" +#define OCIO_VERSION_STR "2.1.0" #define OCIO_VERSION_STATUS_STR "" -#define OCIO_VERSION_FULL_STR "2.0.0" +#define OCIO_VERSION_FULL_STR "2.1.0" /* Version as a single 4-byte hex number, e.g. 0x01050200 == 1.5.2 Use this for numeric comparisons, e.g. #if OCIO_VERSION_HEX >= ... @@ -17,11 +17,24 @@ this will reflect the original API version number. */ #define OCIO_VERSION_HEX ((2 << 24) | \ - (0 << 16) | \ + (1 << 16) | \ (0 << 8)) #define OCIO_VERSION_MAJOR 2 -#define OCIO_VERSION_MINOR 0 +#define OCIO_VERSION_MINOR 1 + + +// Highlight deprecated methods or classes. +#if defined(_MSC_VER) + #define OCIO_DEPRECATED(msg) __declspec(deprecated(msg)) +#elif __cplusplus >= 201402L + #define OCIO_DEPRECATED(msg) [[deprecated(msg)]] +#elif defined(__GNUC__) || defined(__clang__) + #define OCIO_DEPRECATED(msg) __attribute__((deprecated(msg))) +#else + #define OCIO_DEPRECATED(msg) /* unsupported on this platform */ +#endif + // shared_ptr / dynamic_pointer_cast #include diff --git a/vendor/aftereffects/vc/vc15/OpenColorIO.vcxproj b/vendor/aftereffects/vc/vc15/OpenColorIO.vcxproj index 531aee0e52..f0e32267ea 100644 --- a/vendor/aftereffects/vc/vc15/OpenColorIO.vcxproj +++ b/vendor/aftereffects/vc/vc15/OpenColorIO.vcxproj @@ -476,7 +476,7 @@ Disabled true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;_SCL_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;_SCL_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 @@ -491,7 +491,7 @@ Disabled true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;_SCL_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;_SCL_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 @@ -508,7 +508,7 @@ Level3 Disabled true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 @@ -524,7 +524,7 @@ Level3 Disabled true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 @@ -542,7 +542,7 @@ true true true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 @@ -562,7 +562,7 @@ true true true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 @@ -581,7 +581,7 @@ true true true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;_SCL_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;_SCL_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 @@ -600,7 +600,7 @@ true true true - OpenColorIO_SKIP_IMPORTS;XML_STATIC;ADD_EXTRA_BUILTINS;_SCL_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) + OpenColorIO_SKIP_IMPORTS;XML_STATIC;_SCL_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) true .;..\..\..\..\include;..\..\..\..\src;..\..\..\..\src\OpenColorIO;..\..\..\..\ext\openexr\IlmBase;..\..\..\..\ext\yaml-cpp\include;..\..\..\..\ext\libexpat\expat\expat;..\..\..\..\ext\pystring;..\..\..\..\ext\sampleicc\src\include;%(AdditionalIncludeDirectories) /wd4146 diff --git a/vendor/aftereffects/vc/vc15/aftereffects/OpenColorIO_AE.vcxproj b/vendor/aftereffects/vc/vc15/aftereffects/OpenColorIO_AE.vcxproj index 0f7eeecb9d..b4aab12517 100644 --- a/vendor/aftereffects/vc/vc15/aftereffects/OpenColorIO_AE.vcxproj +++ b/vendor/aftereffects/vc/vc15/aftereffects/OpenColorIO_AE.vcxproj @@ -75,7 +75,7 @@ Disabled - ..;..\..\..;..\..\..\..\..\include;..\..\..\..\..\src\libutils\oglapphelpers;..\..\..\..\..\src\apps\ociobakelut;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers\SP;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers\Win;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Resources;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Util;..\..\..\..\..\ext\glew-2.2.0\include;..\..\..\..\..\ext\Little-CMS\include;%(AdditionalIncludeDirectories) + ..;..\..\..;..\..\..\..\..\include;..\..\..\..\..\src\libutils\oglapphelpers;..\..\..\..\..\src\apps\ociobakelut;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers\SP;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers\Win;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Resources;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Util;..\..\..\..\..\ext\glew-2.2.0\include;..\..\..\..\..\ext\Little-CMS\include;%(AdditionalIncludeDirectories) OpenColorIO_SKIP_IMPORTS;GLEW_STATIC;MSWindows;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) MultiThreadedDebug 4Bytes @@ -128,8 +128,8 @@ MaxSpeed - ..;..\..\..;..\..\..\..\..\include;..\..\..\..\..\src\libutils\oglapphelpers;..\..\..\..\..\src\apps\ociobakelut;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers\SP;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers\Win;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Resources;..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Util;..\..\..\..\..\ext\glew-2.2.0\include;..\..\..\..\..\ext\Little-CMS\include;%(AdditionalIncludeDirectories) - OpenColorIO_SKIP_IMPORTS;GLEW_STATIC;MSWindows;WIN32;_WINDOWS;%(PreprocessorDefinitions) + ..;..\..\..;..\..\..\..\..\include;..\..\..\..\..\src\libutils\oglapphelpers;..\..\..\..\..\src\apps\ociobakelut;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers\SP;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers\Win;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Resources;..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Util;..\..\..\..\..\ext\glew-2.2.0\include;..\..\..\..\..\ext\Little-CMS\include;%(AdditionalIncludeDirectories) + OpenColorIO_SKIP_IMPORTS;GLEW_STATIC;MSWindows;WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) MultiThreaded 4Bytes @@ -171,31 +171,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -208,12 +208,12 @@ Compiling the PiPL Compiling the PiPL - cl /I "$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers" /EP "..\..\..\%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" -"$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" + cl /I "$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers" /EP "..\..\..\%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" +"$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc - cl /I "$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Headers" /EP "..\..\..\%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" -"$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2020 Win SDK\Examples\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" + cl /I "$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Headers" /EP "..\..\..\%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" +"$(ProjectDir)..\..\..\..\..\ext\Adobe After Effects 2021 Win SDK\Examples\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc $(ProjectDir)%(Filename).rc;%(Outputs) @@ -225,9 +225,9 @@ cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir) - - - + + + diff --git a/vendor/aftereffects/win/OpenColorIO_AE_Dialogs_Win.cpp b/vendor/aftereffects/win/OpenColorIO_AE_Dialogs_Win.cpp index 8e1e1f8eed..d86a8e8ca8 100644 --- a/vendor/aftereffects/win/OpenColorIO_AE_Dialogs_Win.cpp +++ b/vendor/aftereffects/win/OpenColorIO_AE_Dialogs_Win.cpp @@ -571,25 +571,17 @@ bool ColorSpacePopUpMenu(OCIO::ConstConfigRcPtr config, std::string &colorSpace, const char *family = colorSpacePtr->getFamily(); - std::string colorSpacePath; + std::vector pathComponents; - if(family == NULL || family == std::string("")) + if(family != NULL && family != std::string("")) { - colorSpacePath = colorSpaceName; - } - else - { - colorSpacePath = std::string(family) + "/" + colorSpaceName; + assert(config->getFamilySeparator() == '/'); + + tokenize(pathComponents, family, std::string(1, config->getFamilySeparator())); } + pathComponents.push_back(colorSpaceName); - assert(config->getFamilySeparator() == '/'); - - std::vector pathComponents; - - tokenize(pathComponents, colorSpacePath, "/"); - - HMENU currentMenu = menu; diff --git a/vendor/aftereffects/xcode/xcode12/OpenColorABI.h b/vendor/aftereffects/xcode/xcode12/OpenColorABI.h index 4bdf0e7d6f..0ad4af5ac7 100644 --- a/vendor/aftereffects/xcode/xcode12/OpenColorABI.h +++ b/vendor/aftereffects/xcode/xcode12/OpenColorABI.h @@ -7,12 +7,12 @@ // Makefile configuration options #define OCIO_NAMESPACE OpenColorIO -#define OCIO_VERSION_STR "2.0.0" +#define OCIO_VERSION_STR "2.1.0" #define OCIO_VERSION_STATUS_STR "" -#define OCIO_VERSION_FULL_STR "2.0.0" +#define OCIO_VERSION_FULL_STR "2.1.0" // Deprecated synonym for downstream projects that expect the 1.x name -#define OCIO_VERSION "2.0.0" +#define OCIO_VERSION "2.1.0" /* Version as a single 4-byte hex number, e.g. 0x01050200 == 1.5.2 Use this for numeric comparisons, e.g. #if OCIO_VERSION_HEX >= ... @@ -20,11 +20,24 @@ this will reflect the original API version number. */ #define OCIO_VERSION_HEX ((2 << 24) | \ - (0 << 16) | \ + (1 << 16) | \ (0 << 8)) #define OCIO_VERSION_MAJOR 2 -#define OCIO_VERSION_MINOR 0 +#define OCIO_VERSION_MINOR 1 + + +// Highlight deprecated methods or classes. +#if defined(_MSC_VER) + #define OCIO_DEPRECATED(msg) __declspec(deprecated(msg)) +#elif __cplusplus >= 201402L + #define OCIO_DEPRECATED(msg) [[deprecated(msg)]] +#elif defined(__GNUC__) || defined(__clang__) + #define OCIO_DEPRECATED(msg) __attribute__((deprecated(msg))) +#else + #define OCIO_DEPRECATED(msg) /* unsupported on this platform */ +#endif + // shared_ptr / dynamic_pointer_cast #include diff --git a/vendor/aftereffects/xcode/xcode12/OpenColorIO.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode12/OpenColorIO.xcodeproj/project.pbxproj index 572c2ad51f..841e38c457 100644 --- a/vendor/aftereffects/xcode/xcode12/OpenColorIO.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode12/OpenColorIO.xcodeproj/project.pbxproj @@ -1790,10 +1790,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - TIXML_USE_STL, - ADD_EXTRA_BUILTINS, - ); + GCC_PREPROCESSOR_DEFINITIONS = TIXML_USE_STL; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( @@ -1807,6 +1804,7 @@ ../../../../ext/libexpat/expat, ../../../../ext/sampleicc/src/include, ); + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -1822,7 +1820,6 @@ GCC_PREPROCESSOR_DEFINITIONS = ( NDEBUG, TIXML_USE_STL, - ADD_EXTRA_BUILTINS, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -1837,6 +1834,7 @@ ../../../../ext/libexpat/expat, ../../../../ext/sampleicc/src/include, ); + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode12/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode12/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj index 296959db67..85a399ec95 100755 --- a/vendor/aftereffects/xcode/xcode12/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode12/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj @@ -155,9 +155,9 @@ 2AF56B93147A431100F9968C /* OpenColorIO_AE_UI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenColorIO_AE_UI.cpp; path = ../../../OpenColorIO_AE_UI.cpp; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56B94147A431100F9968C /* OpenColorIO_AE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenColorIO_AE.cpp; path = ../../../OpenColorIO_AE.cpp; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56B95147A431100F9968C /* OpenColorIO_AE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenColorIO_AE.h; path = ../../../OpenColorIO_AE.h; sourceTree = SOURCE_ROOT; usesTabs = 0; }; - 2AF56B9D147A458800F9968C /* AEGP_SuiteHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AEGP_SuiteHandler.cpp; path = "../../../../../ext/Adobe After Effects 2020 Mac SDK/Examples/Util/AEGP_SuiteHandler.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; - 2AF56B9E147A458800F9968C /* AEGP_SuiteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AEGP_SuiteHandler.h; path = "../../../../../ext/Adobe After Effects 2020 Mac SDK/Examples/Util/AEGP_SuiteHandler.h"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; - 2AF56B9F147A458800F9968C /* MissingSuiteError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MissingSuiteError.cpp; path = "../../../../../ext/Adobe After Effects 2020 Mac SDK/Examples/Util/MissingSuiteError.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; + 2AF56B9D147A458800F9968C /* AEGP_SuiteHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AEGP_SuiteHandler.cpp; path = "../../../../../ext/Adobe After Effects 2021 Mac SDK/Examples/Util/AEGP_SuiteHandler.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; + 2AF56B9E147A458800F9968C /* AEGP_SuiteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AEGP_SuiteHandler.h; path = "../../../../../ext/Adobe After Effects 2021 Mac SDK/Examples/Util/AEGP_SuiteHandler.h"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; + 2AF56B9F147A458800F9968C /* MissingSuiteError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MissingSuiteError.cpp; path = "../../../../../ext/Adobe After Effects 2021 Mac SDK/Examples/Util/MissingSuiteError.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56D04147AB5C900F9968C /* DrawbotBot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawbotBot.cpp; path = ../../../DrawbotBot.cpp; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56D05147AB5C900F9968C /* DrawbotBot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawbotBot.h; path = ../../../DrawbotBot.h; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56EE2147AD10E00F9968C /* OpenColorIO.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OpenColorIO.xcodeproj; path = ../OpenColorIO.xcodeproj; sourceTree = SOURCE_ROOT; }; @@ -519,7 +519,7 @@ 2A1BAC2310C3C82A00244D12 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - AE_SDK = "\"../../../../../ext/Adobe After Effects 2020 Mac SDK\""; + AE_SDK = "\"../../../../../ext/Adobe After Effects 2021 Mac SDK\""; ARCHS = x86_64; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -538,6 +538,7 @@ "../../../../../ext/yaml-cpp/include", "../../../../../ext/Little-CMS/include", ); + MACOSX_DEPLOYMENT_TARGET = 10.10; REZ_PREPROCESSOR_DEFINITIONS = __MACH__; REZ_SEARCH_PATHS = "$(SDK_PATH)/Developer/Headers/FlatCarbon"; SDKROOT = macosx; @@ -565,7 +566,7 @@ C4E61880095A3C800012CA3F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - AE_SDK = "\"../../../../../ext/Adobe After Effects 2020 Mac SDK\""; + AE_SDK = "\"../../../../../ext/Adobe After Effects 2021 Mac SDK\""; ARCHS = x86_64; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; COPY_PHASE_STRIP = NO; @@ -583,6 +584,7 @@ "../../../../../ext/yaml-cpp/include", "../../../../../ext/Little-CMS/include", ); + MACOSX_DEPLOYMENT_TARGET = 10.10; REZ_PREPROCESSOR_DEFINITIONS = __MACH__; REZ_SEARCH_PATHS = "$(SDK_PATH)/Developer/Headers/FlatCarbon"; SDKROOT = macosx; diff --git a/vendor/aftereffects/xcode/xcode12/ext/expat.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode12/ext/expat.xcodeproj/project.pbxproj index 7311c8695e..6c33563637 100644 --- a/vendor/aftereffects/xcode/xcode12/ext/expat.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode12/ext/expat.xcodeproj/project.pbxproj @@ -265,6 +265,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = .; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -283,6 +284,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = .; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode12/ext/ilmbasehalf.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode12/ext/ilmbasehalf.xcodeproj/project.pbxproj index a651ace3f4..96576a805b 100644 --- a/vendor/aftereffects/xcode/xcode12/ext/ilmbasehalf.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode12/ext/ilmbasehalf.xcodeproj/project.pbxproj @@ -357,6 +357,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -372,6 +373,7 @@ GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode12/ext/lcms.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode12/ext/lcms.xcodeproj/project.pbxproj index 599d2ec417..783b729bce 100644 --- a/vendor/aftereffects/xcode/xcode12/ext/lcms.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode12/ext/lcms.xcodeproj/project.pbxproj @@ -268,6 +268,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -282,6 +283,7 @@ GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode12/ext/pystring.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode12/ext/pystring.xcodeproj/project.pbxproj index bdafb92ff1..bcebb0f626 100644 --- a/vendor/aftereffects/xcode/xcode12/ext/pystring.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode12/ext/pystring.xcodeproj/project.pbxproj @@ -198,7 +198,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -250,7 +250,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode12/ext/yaml.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode12/ext/yaml.xcodeproj/project.pbxproj index 8d2109fb71..6cea3ddd7e 100644 --- a/vendor/aftereffects/xcode/xcode12/ext/yaml.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode12/ext/yaml.xcodeproj/project.pbxproj @@ -555,6 +555,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../../../ext/yaml-cpp/include"; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -571,6 +572,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../../../ext/yaml-cpp/include"; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode9/OpenColorABI.h b/vendor/aftereffects/xcode/xcode9/OpenColorABI.h index 4bdf0e7d6f..0ad4af5ac7 100644 --- a/vendor/aftereffects/xcode/xcode9/OpenColorABI.h +++ b/vendor/aftereffects/xcode/xcode9/OpenColorABI.h @@ -7,12 +7,12 @@ // Makefile configuration options #define OCIO_NAMESPACE OpenColorIO -#define OCIO_VERSION_STR "2.0.0" +#define OCIO_VERSION_STR "2.1.0" #define OCIO_VERSION_STATUS_STR "" -#define OCIO_VERSION_FULL_STR "2.0.0" +#define OCIO_VERSION_FULL_STR "2.1.0" // Deprecated synonym for downstream projects that expect the 1.x name -#define OCIO_VERSION "2.0.0" +#define OCIO_VERSION "2.1.0" /* Version as a single 4-byte hex number, e.g. 0x01050200 == 1.5.2 Use this for numeric comparisons, e.g. #if OCIO_VERSION_HEX >= ... @@ -20,11 +20,24 @@ this will reflect the original API version number. */ #define OCIO_VERSION_HEX ((2 << 24) | \ - (0 << 16) | \ + (1 << 16) | \ (0 << 8)) #define OCIO_VERSION_MAJOR 2 -#define OCIO_VERSION_MINOR 0 +#define OCIO_VERSION_MINOR 1 + + +// Highlight deprecated methods or classes. +#if defined(_MSC_VER) + #define OCIO_DEPRECATED(msg) __declspec(deprecated(msg)) +#elif __cplusplus >= 201402L + #define OCIO_DEPRECATED(msg) [[deprecated(msg)]] +#elif defined(__GNUC__) || defined(__clang__) + #define OCIO_DEPRECATED(msg) __attribute__((deprecated(msg))) +#else + #define OCIO_DEPRECATED(msg) /* unsupported on this platform */ +#endif + // shared_ptr / dynamic_pointer_cast #include diff --git a/vendor/aftereffects/xcode/xcode9/OpenColorIO.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode9/OpenColorIO.xcodeproj/project.pbxproj index 572c2ad51f..841e38c457 100644 --- a/vendor/aftereffects/xcode/xcode9/OpenColorIO.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode9/OpenColorIO.xcodeproj/project.pbxproj @@ -1790,10 +1790,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - TIXML_USE_STL, - ADD_EXTRA_BUILTINS, - ); + GCC_PREPROCESSOR_DEFINITIONS = TIXML_USE_STL; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( @@ -1807,6 +1804,7 @@ ../../../../ext/libexpat/expat, ../../../../ext/sampleicc/src/include, ); + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -1822,7 +1820,6 @@ GCC_PREPROCESSOR_DEFINITIONS = ( NDEBUG, TIXML_USE_STL, - ADD_EXTRA_BUILTINS, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -1837,6 +1834,7 @@ ../../../../ext/libexpat/expat, ../../../../ext/sampleicc/src/include, ); + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode9/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode9/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj index 0bac266b7e..c6c5521827 100755 --- a/vendor/aftereffects/xcode/xcode9/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode9/aftereffects/OpenColorIO_AE.xcodeproj/project.pbxproj @@ -155,9 +155,9 @@ 2AF56B93147A431100F9968C /* OpenColorIO_AE_UI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenColorIO_AE_UI.cpp; path = ../../../OpenColorIO_AE_UI.cpp; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56B94147A431100F9968C /* OpenColorIO_AE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenColorIO_AE.cpp; path = ../../../OpenColorIO_AE.cpp; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56B95147A431100F9968C /* OpenColorIO_AE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenColorIO_AE.h; path = ../../../OpenColorIO_AE.h; sourceTree = SOURCE_ROOT; usesTabs = 0; }; - 2AF56B9D147A458800F9968C /* AEGP_SuiteHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AEGP_SuiteHandler.cpp; path = "../../../../../ext/Adobe After Effects 2020 Mac SDK/Examples/Util/AEGP_SuiteHandler.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; - 2AF56B9E147A458800F9968C /* AEGP_SuiteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AEGP_SuiteHandler.h; path = "../../../../../ext/Adobe After Effects 2020 Mac SDK/Examples/Util/AEGP_SuiteHandler.h"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; - 2AF56B9F147A458800F9968C /* MissingSuiteError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MissingSuiteError.cpp; path = "../../../../../ext/Adobe After Effects 2020 Mac SDK/Examples/Util/MissingSuiteError.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; + 2AF56B9D147A458800F9968C /* AEGP_SuiteHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AEGP_SuiteHandler.cpp; path = "../../../../../ext/Adobe After Effects 2021 Mac SDK/Examples/Util/AEGP_SuiteHandler.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; + 2AF56B9E147A458800F9968C /* AEGP_SuiteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AEGP_SuiteHandler.h; path = "../../../../../ext/Adobe After Effects 2021 Mac SDK/Examples/Util/AEGP_SuiteHandler.h"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; + 2AF56B9F147A458800F9968C /* MissingSuiteError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MissingSuiteError.cpp; path = "../../../../../ext/Adobe After Effects 2021 Mac SDK/Examples/Util/MissingSuiteError.cpp"; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56D04147AB5C900F9968C /* DrawbotBot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawbotBot.cpp; path = ../../../DrawbotBot.cpp; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56D05147AB5C900F9968C /* DrawbotBot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawbotBot.h; path = ../../../DrawbotBot.h; sourceTree = SOURCE_ROOT; usesTabs = 0; }; 2AF56EE2147AD10E00F9968C /* OpenColorIO.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OpenColorIO.xcodeproj; path = ../OpenColorIO.xcodeproj; sourceTree = SOURCE_ROOT; }; @@ -302,9 +302,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C4E618CB095A3CE80012CA3F /* OpenColorIO */ = { + C4E618CB095A3CE80012CA3F /* OpenColorIO_AE */ = { isa = PBXNativeTarget; - buildConfigurationList = C4E618CE095A3CE90012CA3F /* Build configuration list for PBXNativeTarget "OpenColorIO" */; + buildConfigurationList = C4E618CE095A3CE90012CA3F /* Build configuration list for PBXNativeTarget "OpenColorIO_AE" */; buildPhases = ( C4E618C8095A3CE80012CA3F /* Resources */, C4E618C9095A3CE80012CA3F /* Sources */, @@ -321,7 +321,7 @@ 2AF999CD147E1DDB00FEB83B /* PBXTargetDependency */, 2AF57017147AE18600F9968C /* PBXTargetDependency */, ); - name = OpenColorIO; + name = OpenColorIO_AE; productName = SDK_Backwards.plugin; productReference = C4E618CC095A3CE80012CA3F /* OpenColorIO.plugin */; productType = "com.apple.product-type.bundle"; @@ -374,7 +374,7 @@ ); projectRoot = ""; targets = ( - C4E618CB095A3CE80012CA3F /* OpenColorIO */, + C4E618CB095A3CE80012CA3F /* OpenColorIO_AE */, ); }; /* End PBXProject section */ @@ -519,7 +519,7 @@ 2A1BAC2310C3C82A00244D12 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - AE_SDK = "\"../../../../../ext/Adobe After Effects 2020 Mac SDK\""; + AE_SDK = "\"../../../../../ext/Adobe After Effects 2021 Mac SDK\""; ARCHS = "$(ARCHS_STANDARD)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -538,6 +538,7 @@ "../../../../../ext/yaml-cpp/include", "../../../../../ext/Little-CMS/include", ); + MACOSX_DEPLOYMENT_TARGET = 10.10; REZ_PREPROCESSOR_DEFINITIONS = __MACH__; REZ_SEARCH_PATHS = "$(SDK_PATH)/Developer/Headers/FlatCarbon"; SDKROOT = macosx; @@ -565,7 +566,7 @@ C4E61880095A3C800012CA3F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - AE_SDK = "\"../../../../../ext/Adobe After Effects 2020 Mac SDK\""; + AE_SDK = "\"../../../../../ext/Adobe After Effects 2021 Mac SDK\""; ARCHS = "$(ARCHS_STANDARD)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; COPY_PHASE_STRIP = NO; @@ -583,6 +584,7 @@ "../../../../../ext/yaml-cpp/include", "../../../../../ext/Little-CMS/include", ); + MACOSX_DEPLOYMENT_TARGET = 10.10; REZ_PREPROCESSOR_DEFINITIONS = __MACH__; REZ_SEARCH_PATHS = "$(SDK_PATH)/Developer/Headers/FlatCarbon"; SDKROOT = macosx; @@ -620,7 +622,7 @@ defaultConfigurationIsVisible = 1; defaultConfigurationName = Debug; }; - C4E618CE095A3CE90012CA3F /* Build configuration list for PBXNativeTarget "OpenColorIO" */ = { + C4E618CE095A3CE90012CA3F /* Build configuration list for PBXNativeTarget "OpenColorIO_AE" */ = { isa = XCConfigurationList; buildConfigurations = ( C4E618CF095A3CE90012CA3F /* Debug */, diff --git a/vendor/aftereffects/xcode/xcode9/ext/expat.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode9/ext/expat.xcodeproj/project.pbxproj index 7311c8695e..6c33563637 100644 --- a/vendor/aftereffects/xcode/xcode9/ext/expat.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode9/ext/expat.xcodeproj/project.pbxproj @@ -265,6 +265,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = .; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -283,6 +284,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = .; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode9/ext/ilmbasehalf.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode9/ext/ilmbasehalf.xcodeproj/project.pbxproj index a651ace3f4..96576a805b 100644 --- a/vendor/aftereffects/xcode/xcode9/ext/ilmbasehalf.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode9/ext/ilmbasehalf.xcodeproj/project.pbxproj @@ -357,6 +357,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -372,6 +373,7 @@ GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode9/ext/lcms.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode9/ext/lcms.xcodeproj/project.pbxproj index 599d2ec417..783b729bce 100644 --- a/vendor/aftereffects/xcode/xcode9/ext/lcms.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode9/ext/lcms.xcodeproj/project.pbxproj @@ -268,6 +268,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -282,6 +283,7 @@ GCC_PREPROCESSOR_DEFINITIONS = NDEBUG; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode9/ext/pystring.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode9/ext/pystring.xcodeproj/project.pbxproj index bdafb92ff1..bcebb0f626 100644 --- a/vendor/aftereffects/xcode/xcode9/ext/pystring.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode9/ext/pystring.xcodeproj/project.pbxproj @@ -198,7 +198,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -250,7 +250,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; diff --git a/vendor/aftereffects/xcode/xcode9/ext/yaml.xcodeproj/project.pbxproj b/vendor/aftereffects/xcode/xcode9/ext/yaml.xcodeproj/project.pbxproj index 8d2109fb71..6cea3ddd7e 100644 --- a/vendor/aftereffects/xcode/xcode9/ext/yaml.xcodeproj/project.pbxproj +++ b/vendor/aftereffects/xcode/xcode9/ext/yaml.xcodeproj/project.pbxproj @@ -555,6 +555,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../../../ext/yaml-cpp/include"; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx; @@ -571,6 +572,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "../../../../../ext/yaml-cpp/include"; + MACOSX_DEPLOYMENT_TARGET = 10.10; PREBINDING = NO; SDKROOT = macosx; }; diff --git a/vendor/photoshop/OpenColorIO_PS.cpp b/vendor/photoshop/OpenColorIO_PS.cpp index 10df38ec73..13fb7ee5c6 100644 --- a/vendor/photoshop/OpenColorIO_PS.cpp +++ b/vendor/photoshop/OpenColorIO_PS.cpp @@ -200,7 +200,6 @@ static OSErr WriteScriptParams(GPtr globals) if(globals->action == OCIO_ACTION_LUT) { - PIPutBool(token, ocioKeyInvert, globals->invert); PIPutEnum(token, ocioKeyInterpolation, typeInterpolation, (globals->interpolation == OCIO_INTERP_NEAREST ? interpNearest : globals->interpolation == OCIO_INTERP_LINEAR ? interpLinear : globals->interpolation == OCIO_INTERP_TETRAHEDRAL ? interpTetrahedral : @@ -222,7 +221,8 @@ static OSErr WriteScriptParams(GPtr globals) PIPutStr(token, ocioKeyOutputSpace, globals->outputSpace); } - + PIPutBool(token, ocioKeyInvert, globals->invert); + gotErr = CloseWriter(&token); // closes and sets dialog optional } } @@ -646,21 +646,19 @@ static void DoStart(GPtr globals) globals->interpolation == OCIO_INTERP_CUBIC ? OCIO::INTERP_CUBIC : OCIO::INTERP_BEST); - const OCIO::TransformDirection direction = (globals->invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); - - processor = context.getLUTProcessor(interpolation, direction); + processor = context.getLUTProcessor(interpolation, globals->invert); } else { if(globals->action == OCIO_ACTION_DISPLAY) { - processor = context.getDisplayProcessor(myP2CString(globals->inputSpace), myP2CString(globals->display), myP2CString(globals->view)); + processor = context.getDisplayProcessor(myP2CString(globals->inputSpace), myP2CString(globals->display), myP2CString(globals->view), globals->invert); } else { assert(globals->action == OCIO_ACTION_CONVERT); - processor = context.getConvertProcessor(myP2CString(globals->inputSpace), myP2CString(globals->outputSpace)); + processor = context.getConvertProcessor(myP2CString(globals->inputSpace), myP2CString(globals->outputSpace), globals->invert); } } diff --git a/vendor/photoshop/OpenColorIO_PS_Context.cpp b/vendor/photoshop/OpenColorIO_PS_Context.cpp index 2c7f5c1f3d..8d8052e1d0 100644 --- a/vendor/photoshop/OpenColorIO_PS_Context.cpp +++ b/vendor/photoshop/OpenColorIO_PS_Context.cpp @@ -41,16 +41,7 @@ OpenColorIO_PS_Context::OpenColorIO_PS_Context(const std::string &path) : { const std::string colorSpaceName = _config->getColorSpaceNameByIndex(i); - OCIO::ConstColorSpaceRcPtr colorSpace = _config->getColorSpace( colorSpaceName.c_str() ); - - const std::string colorSpaceFamily = colorSpace->getFamily(); - - const std::string colorSpacePath = (colorSpaceFamily.empty() ? colorSpaceName : - (colorSpaceFamily + "/" + colorSpaceName)); - _colorSpaces.push_back(colorSpaceName); - - _colorSpacesFullPaths.push_back(colorSpacePath); } OCIO::ConstColorSpaceRcPtr defaultInput = _config->getColorSpace(OCIO::ROLE_SCENE_LINEAR); @@ -81,28 +72,11 @@ OpenColorIO_PS_Context::OpenColorIO_PS_Context(const std::string &path) : OCIO::ConstProcessorRcPtr forwardProcessor = _config->getProcessor(forwardTransform); _isLUT = true; - - _canInvertLUT = true; - - try - { - OCIO::FileTransformRcPtr inverseTransform = OCIO::FileTransform::Create(); - - inverseTransform->setSrc( _path.c_str() ); - inverseTransform->setInterpolation(OCIO::INTERP_LINEAR); - inverseTransform->setDirection(OCIO::TRANSFORM_DIR_INVERSE); - - OCIO::ConstProcessorRcPtr inverseProcessor = _config->getProcessor(inverseTransform); - } - catch(...) - { - _canInvertLUT = false; - } } } OCIO::ConstCPUProcessorRcPtr -OpenColorIO_PS_Context::getConvertProcessor(const std::string &inputSpace, const std::string &outputSpace) const +OpenColorIO_PS_Context::getConvertProcessor(const std::string &inputSpace, const std::string &outputSpace, bool invert) const { assert( !isLUT() ); @@ -110,7 +84,7 @@ OpenColorIO_PS_Context::getConvertProcessor(const std::string &inputSpace, const transform->setSrc( inputSpace.c_str() ); transform->setDst( outputSpace.c_str() ); - transform->setDirection(OCIO::TRANSFORM_DIR_FORWARD); + transform->setDirection(invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); OCIO::ConstProcessorRcPtr processor = _config->getProcessor(transform); @@ -121,17 +95,18 @@ OpenColorIO_PS_Context::getConvertProcessor(const std::string &inputSpace, const OCIO::ConstCPUProcessorRcPtr -OpenColorIO_PS_Context::getDisplayProcessor(const std::string &inputSpace, const std::string &display, const std::string &view) const +OpenColorIO_PS_Context::getDisplayProcessor(const std::string &inputSpace, const std::string &display, const std::string &view, bool invert) const { assert( !isLUT() ); - OCIO::DisplayViewTransformRcPtr ocio_transform = OCIO::DisplayViewTransform::Create(); + OCIO::DisplayViewTransformRcPtr transform = OCIO::DisplayViewTransform::Create(); - ocio_transform->setSrc( inputSpace.c_str() ); - ocio_transform->setDisplay( display.c_str() ); - ocio_transform->setView( view.c_str() ); + transform->setSrc( inputSpace.c_str() ); + transform->setDisplay( display.c_str() ); + transform->setView( view.c_str() ); + transform->setDirection(invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); - OCIO::ConstProcessorRcPtr processor = _config->getProcessor(ocio_transform); + OCIO::ConstProcessorRcPtr processor = _config->getProcessor(transform); OCIO::ConstCPUProcessorRcPtr cpu_processor = processor->getDefaultCPUProcessor(); @@ -140,7 +115,7 @@ OpenColorIO_PS_Context::getDisplayProcessor(const std::string &inputSpace, const OCIO::ConstCPUProcessorRcPtr -OpenColorIO_PS_Context::getLUTProcessor(OCIO::Interpolation interpolation, OCIO::TransformDirection direction) const +OpenColorIO_PS_Context::getLUTProcessor(OCIO::Interpolation interpolation, bool invert) const { assert( isLUT() ); @@ -148,7 +123,7 @@ OpenColorIO_PS_Context::getLUTProcessor(OCIO::Interpolation interpolation, OCIO: transform->setSrc( _path.c_str() ); transform->setInterpolation(interpolation); - transform->setDirection(direction); + transform->setDirection(invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); OCIO::ConstProcessorRcPtr processor = _config->getProcessor(transform); @@ -159,22 +134,22 @@ OpenColorIO_PS_Context::getLUTProcessor(OCIO::Interpolation interpolation, OCIO: OCIO::BakerRcPtr -OpenColorIO_PS_Context::getConvertBaker(const std::string &inputSpace, const std::string &outputSpace) const +OpenColorIO_PS_Context::getConvertBaker(const std::string &inputSpace, const std::string &outputSpace, bool invert) const { assert( !isLUT() ); OCIO::BakerRcPtr baker = OCIO::Baker::Create(); baker->setConfig(_config); - baker->setInputSpace( inputSpace.c_str() ); - baker->setTargetSpace( outputSpace.c_str() ); - + baker->setInputSpace(invert ? outputSpace.c_str() : inputSpace.c_str()); + baker->setTargetSpace(invert ? inputSpace.c_str() : outputSpace.c_str() ); + return baker; } OCIO::BakerRcPtr -OpenColorIO_PS_Context::getDisplayBaker(const std::string &inputSpace, const std::string &display, const std::string &view) const +OpenColorIO_PS_Context::getDisplayBaker(const std::string &inputSpace, const std::string &display, const std::string &view, bool invert) const { assert( !isLUT() ); @@ -190,13 +165,14 @@ OpenColorIO_PS_Context::getDisplayBaker(const std::string &inputSpace, const std const std::string output_space = "ProcessedOutput"; outputColorSpace->setName( output_space.c_str() ); - OCIO::DisplayViewTransformRcPtr transformPtr = OCIO::DisplayViewTransform::Create(); + OCIO::DisplayViewTransformRcPtr transform = OCIO::DisplayViewTransform::Create(); - transformPtr->setSrc( inputSpace.c_str() ); - transformPtr->setDisplay( display.c_str() ); - transformPtr->setView( view.c_str() ); + transform->setSrc( inputSpace.c_str() ); + transform->setDisplay( display.c_str() ); + transform->setView( view.c_str() ); + transform->setDirection(invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); - outputColorSpace->setTransform(transformPtr, OCIO::COLORSPACE_DIR_FROM_REFERENCE); + outputColorSpace->setTransform(transform, OCIO::COLORSPACE_DIR_FROM_REFERENCE); editableConfig->addColorSpace(outputColorSpace); @@ -212,20 +188,20 @@ OpenColorIO_PS_Context::getDisplayBaker(const std::string &inputSpace, const std OCIO::BakerRcPtr -OpenColorIO_PS_Context::getLUTBaker(OCIO::Interpolation interpolation, OCIO::TransformDirection direction) const +OpenColorIO_PS_Context::getLUTBaker(OCIO::Interpolation interpolation, bool invert) const { assert( isLUT() ); OCIO::ConfigRcPtr editableConfig = OCIO::Config::Create(); OCIO::ColorSpaceRcPtr inputColorSpace = OCIO::ColorSpace::Create(); - std::string inputspace = "RawInput"; + const std::string inputspace = "RawInput"; inputColorSpace->setName(inputspace.c_str()); editableConfig->addColorSpace(inputColorSpace); OCIO::ColorSpaceRcPtr outputColorSpace = OCIO::ColorSpace::Create(); - std::string outputspace = "ProcessedOutput"; + const std::string outputspace = "ProcessedOutput"; outputColorSpace->setName(outputspace.c_str()); OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create(); @@ -233,7 +209,7 @@ OpenColorIO_PS_Context::getLUTBaker(OCIO::Interpolation interpolation, OCIO::Tra transform = OCIO::FileTransform::Create(); transform->setSrc(_path.c_str()); transform->setInterpolation(interpolation); - transform->setDirection(direction); + transform->setDirection(invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); outputColorSpace->setTransform(transform, OCIO::COLORSPACE_DIR_FROM_REFERENCE); diff --git a/vendor/photoshop/OpenColorIO_PS_Context.h b/vendor/photoshop/OpenColorIO_PS_Context.h index 2fddcb422b..030ab029f6 100644 --- a/vendor/photoshop/OpenColorIO_PS_Context.h +++ b/vendor/photoshop/OpenColorIO_PS_Context.h @@ -22,22 +22,19 @@ class OpenColorIO_PS_Context OpenColorIO_PS_Context(const std::string &path); ~OpenColorIO_PS_Context() {} - //const std::string getPath() const { return _path; } - bool isLUT() const { return _isLUT; } - bool canInvertLUT() const { return (isLUT() && _canInvertLUT); } - + OCIO::ConstConfigRcPtr getConfig() const { return _config; } - OCIO::ConstCPUProcessorRcPtr getConvertProcessor(const std::string &inputSpace, const std::string &outputSpace) const; - OCIO::ConstCPUProcessorRcPtr getDisplayProcessor(const std::string &inputSpace, const std::string &display, const std::string &view) const; - OCIO::ConstCPUProcessorRcPtr getLUTProcessor(OCIO::Interpolation interpolation, OCIO::TransformDirection direction) const; + OCIO::ConstCPUProcessorRcPtr getConvertProcessor(const std::string &inputSpace, const std::string &outputSpace, bool invert) const; + OCIO::ConstCPUProcessorRcPtr getDisplayProcessor(const std::string &inputSpace, const std::string &display, const std::string &view, bool invert) const; + OCIO::ConstCPUProcessorRcPtr getLUTProcessor(OCIO::Interpolation interpolation, bool invert) const; - OCIO::BakerRcPtr getConvertBaker(const std::string &inputSpace, const std::string &outputSpace) const; - OCIO::BakerRcPtr getDisplayBaker(const std::string &inputSpace, const std::string &display, const std::string &view) const; - OCIO::BakerRcPtr getLUTBaker(OCIO::Interpolation interpolation, OCIO::TransformDirection direction) const; + OCIO::BakerRcPtr getConvertBaker(const std::string &inputSpace, const std::string &outputSpace, bool invert) const; + OCIO::BakerRcPtr getDisplayBaker(const std::string &inputSpace, const std::string &display, const std::string &view, bool invert) const; + OCIO::BakerRcPtr getLUTBaker(OCIO::Interpolation interpolation, bool invert) const; - const SpaceVec & getColorSpaces(bool fullPath=false) const { return (fullPath ? _colorSpacesFullPaths : _colorSpaces); } + const SpaceVec & getColorSpaces() const { return _colorSpaces; } const std::string & getDefaultColorSpace() const { return _defaultColorSpace; } const SpaceVec & getDisplays() const { return _displays; }; @@ -56,13 +53,11 @@ class OpenColorIO_PS_Context OCIO::ConstConfigRcPtr _config; SpaceVec _colorSpaces; - SpaceVec _colorSpacesFullPaths; std::string _defaultColorSpace; SpaceVec _displays; std::string _defaultDisplay; bool _isLUT; - bool _canInvertLUT; }; #endif // _OPENCOLORIO_PS_CONTEXT_H_ diff --git a/vendor/photoshop/OpenColorIO_PS_Version.h b/vendor/photoshop/OpenColorIO_PS_Version.h index e367029573..6f70d31024 100644 --- a/vendor/photoshop/OpenColorIO_PS_Version.h +++ b/vendor/photoshop/OpenColorIO_PS_Version.h @@ -6,11 +6,11 @@ #define OpenColorIO_PS_Major_Version 2 -#define OpenColorIO_PS_Minor_Version 0 -#define OpenColorIO_PS_Version_String "2.0.0" +#define OpenColorIO_PS_Minor_Version 1 +#define OpenColorIO_PS_Version_String "2.1.0" #define OpenColorIO_PS_Build_Date __DATE__ -#define OpenColorIO_PS_Build_Date_Manual "3 March 2021" -#define OpenColorIO_PS_Build_Complete_Manual "v2.2.0 - " OpenColorIO_PS_Build_Date +#define OpenColorIO_PS_Build_Date_Manual "14 April 2021" +#define OpenColorIO_PS_Build_Complete_Manual "v2.1.0 - " OpenColorIO_PS_Build_Date #define OpenColorIO_PS_Copyright_Year "2021" #define OpenColorIO_PS_Build_Year "2021" diff --git a/vendor/photoshop/mac/OpenColorIO_PS_Dialog.xib b/vendor/photoshop/mac/OpenColorIO_PS_Dialog.xib index 96cf1bba67..57095003ae 100644 --- a/vendor/photoshop/mac/OpenColorIO_PS_Dialog.xib +++ b/vendor/photoshop/mac/OpenColorIO_PS_Dialog.xib @@ -1,2005 +1,253 @@ - - - 1050 - 10K549 - 851 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 851 - - - YES - - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - YES - - - - YES - - OpenColorIO_PS_Dialog_Controller - - - FirstResponder - - - NSApplication - - - 1 - 2 - {{196, 240}, {500, 270}} - 544735232 - OpenColorIO - NSWindow - - {3.40282e+38, 3.40282e+38} - - - 256 - - YES - - - 268 - {{206, 226}, {171, 26}} - - YES - - -2076049856 - 2048 - - LucidaGrande - 13 - 1044 - - - 109199615 - 129 - - - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - 1 - YES - YES - 2 - - - - - 268 - {{109, 232}, {95, 17}} - - YES - - 68288064 - 71304192 - Configuration: - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2ODY1AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 268 - {{134, 192}, {216, 18}} - - YES - 1 - 2 - - YES - - -2080244224 - 0 - Convert - - - 1 - 1211912703 - 0 - - NSRadioButton - - - - 200 - 25 - - - 67239424 - 0 - Display - - - 1211912703 - 0 - - 400 - 75 - - - {106, 18} - {4, 2} - 1151868928 - NSActionCell - - 67239424 - 0 - Radio - - 1211912703 - 0 - - 549453824 - {18, 18} - - YES - - YES - - - - TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw -IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ -29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 -dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA -AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG -AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ -0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ -7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ -5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ -3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD -AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns -AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ -6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ -/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ -///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl -YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA -AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD -AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu -AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB -AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES -AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS -AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - - - - - - 3 - MCAwAA - - - - 400 - 75 - - - - - 3 - MQA - - - - - - 268 - {{206, 146}, {171, 26}} - - YES - - -2076049856 - 2048 - - - 109199615 - 129 - - - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - 1 - YES - YES - 2 - - - - - 268 - {{109, 152}, {95, 17}} - - YES - - 68288064 - 71304192 - Input Space: - - - - - - - - - 268 - {{383, 12}, {103, 32}} - - YES - - 67239424 - 134217728 - OK - - - -2038284033 - 129 - - DQ - 200 - 25 - - - - - 268 - {{280, 12}, {103, 32}} - - YES - - 67239424 - 134217728 - Cancel - - - -2038284033 - 129 - - Gw - 200 - 25 - - - - - 268 - {{14, 12}, {111, 32}} - - YES - - 67239424 - 134217728 - Export… - - - -2038284033 - 129 - - Gw - 200 - 25 - - - - - 268 - {{205, 106}, {171, 26}} - - YES - - -2076049856 - 2048 - - - 109199615 - 129 - - - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - 1 - YES - YES - 2 - - - - - 268 - {{108, 112}, {95, 17}} - - YES - - 68288064 - 71304192 - Output Space: - - - - - - - - - 268 - {{205, 66}, {171, 26}} - - YES - - -2076049856 - 2048 - - - 109199615 - 129 - - - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - 1 - YES - YES - 2 - - - - - 268 - {{108, 72}, {95, 17}} - - YES - - 68288064 - 71304192 - Transform: - - - - - - - - - 268 - {{408, 151}, {74, 18}} - - YES - - -2080244224 - 0 - Invert - - - 1211912703 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - - - - 268 - {{377, 146}, {29, 26}} - - YES - - -2080244224 - 134217728 - - - - -2032910081 - 166 - - - 400 - 75 - - - - - 268 - {{377, 106}, {29, 26}} - - YES - - -2080244224 - 134217728 - - - - -2032910081 - 166 - - - 400 - 75 - - - - {500, 270} - - - {{0, 0}, {1680, 1028}} - {3.40282e+38, 3.40282e+38} - - - - - YES - - - actionRadios - - - - 99 - - - - configurationMenu - - - - 100 - - - - invertCheck - - - - 104 - - - - window - - - - 108 - - - - clickedOK: - - - - 109 - - - - clickedExport: - - - - 110 - - - - clickedCancel: - - - - 111 - - - - trackConfigMenu: - - - - 112 - - - - menu1 - - - - 150 - - - - menu2 - - - - 151 - - - - menu3 - - - - 152 - - - - label1 - - - - 153 - - - - label2 - - - - 154 - - - - label3 - - - - 155 - - - - trackActionRadios: - - - - 156 - - - - trackMenu1: - - - - 157 - - - - trackMenu2: - - - - 158 - - - - trackMenu3: - - - - 159 - - - - inputSpaceButton - - - - 166 - - - - outputSpaceButton - - - - 167 - - - - popInputSpaceMenu: - - - - 168 - - - - popOutputSpaceMenu: - - - - 169 - - - - trackInvert: - - - - 170 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - YES - - - - - - 2 - - - YES - - - - - - - - - - - - - - - - - - - - 3 - - - YES - - - - - - 4 - - - YES - - - - - - 5 - - - YES - - - - - - - - 6 - - - - - 7 - - - - - 8 - - - - - 9 - - - YES - - - - - - 10 - - - - - 11 - - - YES - - - - - - - - 12 - - - - - 14 - - - - - 15 - - - - - 25 - - - YES - - - - - - 26 - - - YES - - - - - - 27 - - - - - 28 - - - YES - - - - - - 29 - - - YES - - - - - - - - 30 - - - - - 31 - - - - - 32 - - - - - 76 - - - YES - - - - - - 77 - - - - - 95 - - - YES - - - - - - 96 - - - - - 97 - - - YES - - - - - - 98 - - - - - 134 - - - YES - - - - - - 135 - - - YES - - - - - - 136 - - - - - 137 - - - YES - - - - - - 138 - - - YES - - - - - - - - 139 - - - - - 140 - - - - - 141 - - - - - 142 - - - YES - - - - - - 143 - - - YES - - - - - - 144 - - - - - 145 - - - YES - - - - - - 146 - - - YES - - - - - - - - 147 - - - - - 148 - - - - - 149 - - - - - 41 - - - YES - - - - - - 42 - - - - - 160 - - - YES - - - - - - 161 - - - - - 164 - - - YES - - - - - - 165 - - - - - - - YES - - YES - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 1.IBWindowTemplateEditedContentRect - 1.NSWindowTemplate.visibleAtLaunch - 1.WindowOrigin - 1.editorWindowContentRectSynchronizationRect - 10.IBPluginDependency - 11.IBPluginDependency - 11.IBViewBoundsToFrameTransform - 12.IBPluginDependency - 134.IBPluginDependency - 134.IBViewBoundsToFrameTransform - 135.IBPluginDependency - 135.IBViewBoundsToFrameTransform - 136.IBPluginDependency - 137.IBPluginDependency - 138.IBEditorWindowLastContentRect - 138.IBPluginDependency - 139.IBPluginDependency - 14.IBPluginDependency - 140.IBPluginDependency - 141.IBPluginDependency - 142.IBPluginDependency - 142.IBViewBoundsToFrameTransform - 143.IBPluginDependency - 143.IBViewBoundsToFrameTransform - 144.IBPluginDependency - 145.IBPluginDependency - 146.IBEditorWindowLastContentRect - 146.IBPluginDependency - 147.IBPluginDependency - 148.IBPluginDependency - 149.IBPluginDependency - 160.IBPluginDependency - 160.IBViewBoundsToFrameTransform - 161.IBPluginDependency - 164.IBPluginDependency - 164.IBViewBoundsToFrameTransform - 165.IBPluginDependency - 2.IBPluginDependency - 25.IBPluginDependency - 25.IBViewBoundsToFrameTransform - 26.IBPluginDependency - 26.IBViewBoundsToFrameTransform - 27.IBPluginDependency - 28.IBPluginDependency - 29.IBEditorWindowLastContentRect - 29.IBPluginDependency - 3.IBPluginDependency - 3.IBViewBoundsToFrameTransform - 30.IBPluginDependency - 31.IBPluginDependency - 32.IBPluginDependency - 4.IBPluginDependency - 41.IBPluginDependency - 41.IBViewBoundsToFrameTransform - 42.IBPluginDependency - 5.IBEditorWindowLastContentRect - 5.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 76.IBPluginDependency - 76.IBViewBoundsToFrameTransform - 77.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - 9.IBViewBoundsToFrameTransform - 95.IBPluginDependency - 95.IBViewBoundsToFrameTransform - 96.IBPluginDependency - 97.IBPluginDependency - 97.IBViewBoundsToFrameTransform - 98.IBPluginDependency - - - YES - {{463, 726}, {500, 270}} - com.apple.InterfaceBuilder.CocoaPlugin - {{463, 726}, {500, 270}} - - {196, 240} - {{202, 428}, {480, 270}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDBgAAw0IAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDTQAAw8EAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC2AAAw7+AAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{804, 573}, {110, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDTQAAw7QAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC2AAAw7KAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{804, 573}, {110, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDvIAAwyoAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDvQAAwwIAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDTgAAw9UAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC2gAAw9OAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{804, 573}, {110, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDTgAAw3oAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDzIAAwycAAA - - com.apple.InterfaceBuilder.CocoaPlugin - {{658, 915}, {171, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDv4AAwigAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC2gAAw3cAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDjAAAwigAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABBYAAAwigAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 183 - - - - YES - - OpenColorIO_PS_Dialog_Controller - NSObject - - YES - - YES - clickedCancel: - clickedExport: - clickedOK: - popInputSpaceMenu: - popOutputSpaceMenu: - trackActionRadios: - trackConfigMenu: - trackInvert: - trackMenu1: - trackMenu2: - trackMenu3: - - - YES - id - id - id - id - id - id - id - id - id - id - id - - - - YES - - YES - clickedCancel: - clickedExport: - clickedOK: - popInputSpaceMenu: - popOutputSpaceMenu: - trackActionRadios: - trackConfigMenu: - trackInvert: - trackMenu1: - trackMenu2: - trackMenu3: - - - YES - - clickedCancel: - id - - - clickedExport: - id - - - clickedOK: - id - - - popInputSpaceMenu: - id - - - popOutputSpaceMenu: - id - - - trackActionRadios: - id - - - trackConfigMenu: - id - - - trackInvert: - id - - - trackMenu1: - id - - - trackMenu2: - id - - - trackMenu3: - id - - - - - YES - - YES - actionRadios - configurationMenu - inputSpaceButton - invertCheck - label1 - label2 - label3 - menu1 - menu2 - menu3 - outputSpaceButton - window - - - YES - NSMatrix - NSPopUpButton - NSButton - NSButton - NSTextField - NSTextField - NSTextField - NSPopUpButton - NSPopUpButton - NSPopUpButton - NSButton - NSWindow - - - - YES - - YES - actionRadios - configurationMenu - inputSpaceButton - invertCheck - label1 - label2 - label3 - menu1 - menu2 - menu3 - outputSpaceButton - window - - - YES - - actionRadios - NSMatrix - - - configurationMenu - NSPopUpButton - - - inputSpaceButton - NSButton - - - invertCheck - NSButton - - - label1 - NSTextField - - - label2 - NSTextField - - - label3 - NSTextField - - - menu1 - NSPopUpButton - - - menu2 - NSPopUpButton - - - menu3 - NSPopUpButton - - - outputSpaceButton - NSButton - - - window - NSWindow - - - - - IBProjectSource - ../mac/OpenColorIO_PS_Dialog_Controller.h - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSMatrix - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSMatrix.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSMenuItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSMenuItemCell - NSButtonCell - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItemCell.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSPopUpButton - NSButton - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButton.h - - - - NSPopUpButtonCell - NSMenuItemCell - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButtonCell.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - ../xcode/OpenColorIO_PS.xcodeproj - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - NSSwitch - - - YES - {9, 8} - {7, 2} - {15, 15} - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.h b/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.h index 6cea6d04f1..ec53b95420 100644 --- a/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.h +++ b/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.h @@ -3,21 +3,21 @@ #import -typedef enum ControllerSource +enum ControllerSource { CSOURCE_ENVIRONMENT, CSOURCE_STANDARD, CSOURCE_CUSTOM }; -typedef enum ControllerAction +enum ControllerAction { CACTION_LUT, CACTION_CONVERT, CACTION_DISPLAY }; -typedef enum ControllerInterp +enum ControllerInterp { CINTERP_NEAREST, CINTERP_LINEAR, @@ -31,15 +31,17 @@ typedef enum ControllerInterp @interface OpenColorIO_PS_Dialog_Controller : NSObject { + IBOutlet NSButton *okButton; + IBOutlet NSButton *exportButton; IBOutlet NSPopUpButton *configurationMenu; IBOutlet NSMatrix *actionRadios; + IBOutlet NSButton *invertCheck; IBOutlet NSTextField *label1; IBOutlet NSTextField *label2; IBOutlet NSTextField *label3; IBOutlet NSPopUpButton *menu1; IBOutlet NSPopUpButton *menu2; IBOutlet NSPopUpButton *menu3; - IBOutlet NSButton *invertCheck; IBOutlet NSButton *inputSpaceButton; IBOutlet NSButton *outputSpaceButton; diff --git a/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.mm b/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.mm index daa9b35867..b954065409 100644 --- a/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.mm +++ b/vendor/photoshop/mac/OpenColorIO_PS_Dialog_Controller.mm @@ -115,8 +115,6 @@ - (id)initWithSource:(ControllerSource)initSource [[configurationMenu lastItem] setTag:CSOURCE_CUSTOM]; - [invertCheck setHidden:YES]; - [menu1 removeAllItems]; [menu2 removeAllItems]; [menu3 removeAllItems]; @@ -194,11 +192,11 @@ - (void)exportPanelDidEnd:(NSSavePanel *)panel returnCode:(int)returnCode contex if(action == CACTION_CONVERT) { - processor = context->getConvertProcessor([inputSpace UTF8String], [outputSpace UTF8String]); + processor = context->getConvertProcessor([inputSpace UTF8String], [outputSpace UTF8String], invert); } else if(action == CACTION_DISPLAY) { - processor = context->getDisplayProcessor([inputSpace UTF8String], [display UTF8String], [view UTF8String]); + processor = context->getDisplayProcessor([inputSpace UTF8String], [display UTF8String], [view UTF8String], invert); } else { @@ -210,9 +208,7 @@ - (void)exportPanelDidEnd:(NSSavePanel *)panel returnCode:(int)returnCode contex interpolation == CINTERP_CUBIC ? OCIO::INTERP_CUBIC : OCIO::INTERP_BEST); - const OCIO::TransformDirection direction = (invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); - - processor = context->getLUTProcessor(interp, direction); + processor = context->getLUTProcessor(interp, invert); } @@ -276,11 +272,11 @@ - (void)exportPanelDidEnd:(NSSavePanel *)panel returnCode:(int)returnCode contex if(action == CACTION_CONVERT) { - baker = context->getConvertBaker([inputSpace UTF8String], [outputSpace UTF8String]); + baker = context->getConvertBaker([inputSpace UTF8String], [outputSpace UTF8String], invert); } else if(action == CACTION_DISPLAY) { - baker = context->getDisplayBaker([inputSpace UTF8String], [display UTF8String], [view UTF8String]); + baker = context->getDisplayBaker([inputSpace UTF8String], [display UTF8String], [view UTF8String], invert); } else { @@ -292,9 +288,7 @@ - (void)exportPanelDidEnd:(NSSavePanel *)panel returnCode:(int)returnCode contex interpolation == CINTERP_CUBIC ? OCIO::INTERP_CUBIC : OCIO::INTERP_BEST); - const OCIO::TransformDirection direction = (invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); - - baker = context->getLUTBaker(interp, direction); + baker = context->getLUTBaker(interp, invert); } baker->setFormat( format.c_str() ); @@ -476,6 +470,19 @@ - (IBAction)trackConfigMenu:(id)sender if(configPath != nil && [[NSFileManager defaultManager] isReadableFileAtPath:configPath]) { + [okButton setEnabled:YES]; + [exportButton setEnabled:YES]; + [actionRadios setEnabled:YES]; + [invertCheck setEnabled:YES]; + [label1 setEnabled:YES]; + [label2 setEnabled:YES]; + [label3 setEnabled:YES]; + [menu1 setEnabled:YES]; + [menu2 setEnabled:YES]; + [menu3 setEnabled:YES]; + [inputSpaceButton setEnabled:YES]; + [outputSpaceButton setEnabled:YES]; + try { OpenColorIO_PS_Context *oldContext = (OpenColorIO_PS_Context *)contextPtr; @@ -492,24 +499,11 @@ - (IBAction)trackConfigMenu:(id)sender { action = CACTION_LUT; - [invertCheck setHidden:NO]; - - if( context->canInvertLUT() ) - { - [invertCheck setEnabled:YES]; - } - else - { - [invertCheck setEnabled:NO]; - - invert = NO; - } - - [invertCheck setState:(invert ? NSOnState : NSOffState)]; - [actionRadios setHidden:YES]; + [invertCheck setState:(invert ? NSOnState : NSOffState)]; + NSTextField *interpolationLabel = label1; NSPopUpButton *interpolationMenu = menu1; @@ -548,14 +542,14 @@ - (IBAction)trackConfigMenu:(id)sender } else { - [invertCheck setHidden:YES]; - if(action == CACTION_LUT) { action = CACTION_CONVERT; } [actionRadios setHidden:NO]; + + [invertCheck setState:(invert ? NSOnState : NSOffState)]; const SpaceVec &colorSpaces = context->getColorSpaces(); @@ -600,6 +594,19 @@ - (IBAction)trackConfigMenu:(id)sender } catch(const std::exception &e) { + [okButton setEnabled:NO]; + [exportButton setEnabled:NO]; + [actionRadios setEnabled:NO]; + [invertCheck setEnabled:NO]; + [label1 setEnabled:NO]; + [label2 setEnabled:NO]; + [label3 setEnabled:NO]; + [menu1 setEnabled:NO]; + [menu2 setEnabled:NO]; + [menu3 setEnabled:NO]; + [inputSpaceButton setEnabled:NO]; + [outputSpaceButton setEnabled:NO]; + NSBeep(); NSString *ocioString = [NSString stringWithUTF8String:e.what()]; @@ -617,6 +624,19 @@ - (IBAction)trackConfigMenu:(id)sender } catch(...) { + [okButton setEnabled:NO]; + [exportButton setEnabled:NO]; + [actionRadios setEnabled:NO]; + [invertCheck setEnabled:NO]; + [label1 setEnabled:NO]; + [label2 setEnabled:NO]; + [label3 setEnabled:NO]; + [menu1 setEnabled:NO]; + [menu2 setEnabled:NO]; + [menu3 setEnabled:NO]; + [inputSpaceButton setEnabled:NO]; + [outputSpaceButton setEnabled:NO]; + NSBeep(); NSString *ocioString = @"Some unknown error"; @@ -633,6 +653,25 @@ - (IBAction)trackConfigMenu:(id)sender } } } + else + { + [okButton setEnabled:NO]; + [exportButton setEnabled:NO]; + [actionRadios setEnabled:NO]; + [invertCheck setEnabled:NO]; + [label1 setEnabled:NO]; + [label2 setEnabled:NO]; + [label3 setEnabled:NO]; + [menu1 setEnabled:NO]; + [menu2 setEnabled:NO]; + [menu3 setEnabled:NO]; + [inputSpaceButton setEnabled:NO]; + [outputSpaceButton setEnabled:NO]; + + [menu1 removeAllItems]; + [menu2 removeAllItems]; + [menu3 removeAllItems]; + } [configurationMenu setToolTip:configPath]; } diff --git a/vendor/photoshop/win/OpenColorIO_PS_Dialog.rc b/vendor/photoshop/win/OpenColorIO_PS_Dialog.rc index ecb7d875b0..adb92a3edd 100644 --- a/vendor/photoshop/win/OpenColorIO_PS_Dialog.rc +++ b/vendor/photoshop/win/OpenColorIO_PS_Dialog.rc @@ -70,7 +70,7 @@ BEGIN COMBOBOX 12,125,87,99,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP RTEXT "Transform:",14,83,112,36,8 COMBOBOX 15,125,111,99,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Invert",16,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,250,65,36,10 + CONTROL "Invert",16,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,233,41,36,10 PUSHBUTTON ">",10,230,62,15,14 PUSHBUTTON ">",13,230,86,15,14 END diff --git a/vendor/photoshop/win/OpenColorIO_PS_Dialogs_Win.cpp b/vendor/photoshop/win/OpenColorIO_PS_Dialogs_Win.cpp index 1bd5563d4e..3234488426 100644 --- a/vendor/photoshop/win/OpenColorIO_PS_Dialogs_Win.cpp +++ b/vendor/photoshop/win/OpenColorIO_PS_Dialogs_Win.cpp @@ -521,6 +521,20 @@ static void TrackConfigMenu(HWND hwndDlg, bool readFromControl) if( !configPath.empty() ) { + ENABLE_ITEM(DLOG_OK, TRUE); + ENABLE_ITEM(DLOG_Export, TRUE); + ENABLE_ITEM(DLOG_Convert_Radio, TRUE); + ENABLE_ITEM(DLOG_Display_Radio, TRUE); + ENABLE_ITEM(DLOG_Menu1_Label, TRUE); + ENABLE_ITEM(DLOG_Menu1_Menu, TRUE); + ENABLE_ITEM(DLOG_Menu1_Button, TRUE); + ENABLE_ITEM(DLOG_Menu2_Label, TRUE); + ENABLE_ITEM(DLOG_Menu2_Menu, TRUE); + ENABLE_ITEM(DLOG_Menu2_Button, TRUE); + ENABLE_ITEM(DLOG_Menu3_Label, TRUE); + ENABLE_ITEM(DLOG_Menu3_Menu, TRUE); + ENABLE_ITEM(DLOG_Invert_Check, TRUE); + try { delete g_context; @@ -532,24 +546,10 @@ static void TrackConfigMenu(HWND hwndDlg, bool readFromControl) { g_action = ACTION_LUT; - SHOW_ITEM(DLOG_Invert_Check, TRUE); - - if( g_context->canInvertLUT() ) - { - ENABLE_ITEM(DLOG_Invert_Check, TRUE); - } - else - { - ENABLE_ITEM(DLOG_Invert_Check, FALSE); - - g_invert = false; - } - - SET_CHECK(DLOG_Invert_Check, g_invert); - SHOW_ITEM(DLOG_Convert_Radio, FALSE); SHOW_ITEM(DLOG_Display_Radio, FALSE); + SET_CHECK(DLOG_Invert_Check, g_invert); const int interpLabel = DLOG_Menu1_Label; const int interpMenu = DLOG_Menu1_Menu; @@ -577,8 +577,6 @@ static void TrackConfigMenu(HWND hwndDlg, bool readFromControl) } else { - SHOW_ITEM(DLOG_Invert_Check, FALSE); - if(g_action == ACTION_LUT) { g_action = ACTION_CONVERT; @@ -587,6 +585,7 @@ static void TrackConfigMenu(HWND hwndDlg, bool readFromControl) SHOW_ITEM(DLOG_Convert_Radio, TRUE); SHOW_ITEM(DLOG_Display_Radio, TRUE); + SET_CHECK(DLOG_Invert_Check, g_invert); const SpaceVec &colorSpaces = g_context->getColorSpaces(); @@ -622,6 +621,20 @@ static void TrackConfigMenu(HWND hwndDlg, bool readFromControl) } catch(const std::exception &e) { + ENABLE_ITEM(DLOG_OK, FALSE); + ENABLE_ITEM(DLOG_Export, FALSE); + ENABLE_ITEM(DLOG_Convert_Radio, FALSE); + ENABLE_ITEM(DLOG_Display_Radio, FALSE); + ENABLE_ITEM(DLOG_Menu1_Label, FALSE); + ENABLE_ITEM(DLOG_Menu1_Menu, FALSE); + ENABLE_ITEM(DLOG_Menu1_Button, FALSE); + ENABLE_ITEM(DLOG_Menu2_Label, FALSE); + ENABLE_ITEM(DLOG_Menu2_Menu, FALSE); + ENABLE_ITEM(DLOG_Menu2_Button, FALSE); + ENABLE_ITEM(DLOG_Menu3_Label, FALSE); + ENABLE_ITEM(DLOG_Menu3_Menu, FALSE); + ENABLE_ITEM(DLOG_Invert_Check, FALSE); + MessageBox(hwndDlg, e.what(), "OpenColorIO error", MB_OK); if(g_source != SOURCE_ENVIRONMENT) @@ -633,6 +646,20 @@ static void TrackConfigMenu(HWND hwndDlg, bool readFromControl) } catch(...) { + ENABLE_ITEM(DLOG_OK, FALSE); + ENABLE_ITEM(DLOG_Export, FALSE); + ENABLE_ITEM(DLOG_Convert_Radio, FALSE); + ENABLE_ITEM(DLOG_Display_Radio, FALSE); + ENABLE_ITEM(DLOG_Menu1_Label, FALSE); + ENABLE_ITEM(DLOG_Menu1_Menu, FALSE); + ENABLE_ITEM(DLOG_Menu1_Button, FALSE); + ENABLE_ITEM(DLOG_Menu2_Label, FALSE); + ENABLE_ITEM(DLOG_Menu2_Menu, FALSE); + ENABLE_ITEM(DLOG_Menu2_Button, FALSE); + ENABLE_ITEM(DLOG_Menu3_Label, FALSE); + ENABLE_ITEM(DLOG_Menu3_Menu, FALSE); + ENABLE_ITEM(DLOG_Invert_Check, FALSE); + MessageBox(hwndDlg, "Some unknown error", "OpenColorIO error", MB_OK); if(g_source != SOURCE_ENVIRONMENT) @@ -649,6 +676,20 @@ static void TrackConfigMenu(HWND hwndDlg, bool readFromControl) g_context = NULL; + ENABLE_ITEM(DLOG_OK, FALSE); + ENABLE_ITEM(DLOG_Export, FALSE); + ENABLE_ITEM(DLOG_Convert_Radio, FALSE); + ENABLE_ITEM(DLOG_Display_Radio, FALSE); + ENABLE_ITEM(DLOG_Menu1_Label, FALSE); + ENABLE_ITEM(DLOG_Menu1_Menu, FALSE); + ENABLE_ITEM(DLOG_Menu1_Button, FALSE); + ENABLE_ITEM(DLOG_Menu2_Label, FALSE); + ENABLE_ITEM(DLOG_Menu2_Menu, FALSE); + ENABLE_ITEM(DLOG_Menu2_Button, FALSE); + ENABLE_ITEM(DLOG_Menu3_Label, FALSE); + ENABLE_ITEM(DLOG_Menu3_Menu, FALSE); + ENABLE_ITEM(DLOG_Invert_Check, FALSE); + REMOVE_ALL_MENU_ITEMS(DLOG_Menu1_Menu); REMOVE_ALL_MENU_ITEMS(DLOG_Menu2_Menu); REMOVE_ALL_MENU_ITEMS(DLOG_Menu3_Menu); @@ -731,11 +772,11 @@ static void DoExport(HWND hwndDlg) if(g_action == ACTION_CONVERT) { - processor = g_context->getConvertProcessor(g_inputSpace, g_outputSpace); + processor = g_context->getConvertProcessor(g_inputSpace, g_outputSpace, g_invert); } else if(g_action == ACTION_DISPLAY) { - processor = g_context->getDisplayProcessor(g_inputSpace, g_display, g_view); + processor = g_context->getDisplayProcessor(g_inputSpace, g_display, g_view, g_invert); } else { @@ -747,9 +788,7 @@ static void DoExport(HWND hwndDlg) g_interpolation == INTERPO_CUBIC ? OCIO::INTERP_CUBIC : OCIO::INTERP_BEST); - const OCIO::TransformDirection direction = (g_invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); - - processor = g_context->getLUTProcessor(interp, direction); + processor = g_context->getLUTProcessor(interp, g_invert); } @@ -789,11 +828,11 @@ static void DoExport(HWND hwndDlg) if(g_action == ACTION_CONVERT) { - baker = g_context->getConvertBaker(g_inputSpace, g_outputSpace); + baker = g_context->getConvertBaker(g_inputSpace, g_outputSpace, g_invert); } else if(g_action == ACTION_DISPLAY) { - baker = g_context->getDisplayBaker(g_inputSpace, g_display, g_view); + baker = g_context->getDisplayBaker(g_inputSpace, g_display, g_view, g_invert); } else { @@ -805,9 +844,7 @@ static void DoExport(HWND hwndDlg) g_interpolation == INTERPO_CUBIC ? OCIO::INTERP_CUBIC : OCIO::INTERP_BEST); - const OCIO::TransformDirection direction = (g_invert ? OCIO::TRANSFORM_DIR_INVERSE : OCIO::TRANSFORM_DIR_FORWARD); - - baker = g_context->getLUTBaker(interp, direction); + baker = g_context->getLUTBaker(interp, g_invert); } baker->setFormat( format.c_str() ); diff --git a/vendor/photoshop/xcode/xcode12/OpenColorIO_PS.xcodeproj/project.pbxproj b/vendor/photoshop/xcode/xcode12/OpenColorIO_PS.xcodeproj/project.pbxproj index 90359718e7..222d12bf92 100755 --- a/vendor/photoshop/xcode/xcode12/OpenColorIO_PS.xcodeproj/project.pbxproj +++ b/vendor/photoshop/xcode/xcode12/OpenColorIO_PS.xcodeproj/project.pbxproj @@ -775,7 +775,7 @@ "../../../../ext/yaml-cpp/include", "../../../../ext/Little-CMS/include", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES; REZ_PREFIX_FILE = "$(SRCROOT)/../../../../ext/adobe_photoshop_sdk_2021_mac/photoshopsdk/pluginsdk/samplecode/common/includes/MachOMacrezXcode.h"; SDKROOT = macosx; @@ -799,7 +799,7 @@ INFOPLIST_FILE = ../../mac/OpenColorIO_PS_Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; PLUGIN_TYPE = 8BFM; - PRODUCT_NAME = OpenColorIO_PS; + PRODUCT_NAME = "OpenColorIO PS"; REZ_PREFIX_FILE = "$(SRCROOT)/../../../../ext/adobe_photoshop_sdk_2021_mac/photoshopsdk/pluginsdk/samplecode/common/includes/MachOMacrezXcode.h"; VALID_ARCHS = x86_64; WRAPPER_EXTENSION = plugin; @@ -828,7 +828,7 @@ "../../../../ext/yaml-cpp/include", "../../../../ext/Little-CMS/include", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; SDKROOT = macosx; }; name = Release; @@ -847,7 +847,7 @@ INFOPLIST_FILE = ../../mac/OpenColorIO_PS_Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; PLUGIN_TYPE = 8BFM; - PRODUCT_NAME = OpenColorIO_PS; + PRODUCT_NAME = "OpenColorIO PS"; REZ_PREFIX_FILE = "$(SRCROOT)/../../../../ext/adobe_photoshop_sdk_2021_mac/photoshopsdk/pluginsdk/samplecode/common/includes/MachOMacrezXcode.h"; VALID_ARCHS = x86_64; WRAPPER_EXTENSION = plugin; diff --git a/vendor/photoshop/xcode/xcode9/OpenColorIO_PS.xcodeproj/project.pbxproj b/vendor/photoshop/xcode/xcode9/OpenColorIO_PS.xcodeproj/project.pbxproj index bdbce93ec4..b356d4ac9a 100755 --- a/vendor/photoshop/xcode/xcode9/OpenColorIO_PS.xcodeproj/project.pbxproj +++ b/vendor/photoshop/xcode/xcode9/OpenColorIO_PS.xcodeproj/project.pbxproj @@ -246,7 +246,7 @@ 64CF8E9E0AA3A6F300120C5A /* ASPragma.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ASPragma.h; sourceTree = ""; }; 64CF8E9F0AA3A6F300120C5A /* ASConfig.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ASConfig.h; sourceTree = ""; }; 64FC86591118F81900F6232D /* JSScriptingSuite.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSScriptingSuite.h; sourceTree = ""; }; - 8D01CCD20486CAD60068D4B7 /* OpenColorIO_PS.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OpenColorIO_PS.plugin; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D01CCD20486CAD60068D4B7 /* OpenColorIO PS.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OpenColorIO PS.plugin"; sourceTree = BUILT_PRODUCTS_DIR; }; E29FC5AE0B0ADACC00614548 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -312,7 +312,7 @@ 19C28FB4FE9D528D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 8D01CCD20486CAD60068D4B7 /* OpenColorIO_PS.plugin */, + 8D01CCD20486CAD60068D4B7 /* OpenColorIO PS.plugin */, ); name = Products; sourceTree = ""; @@ -544,7 +544,7 @@ name = OpenColorIO_PS; productInstallPath = "$(HOME)/Library/Bundles"; productName = Dissolve; - productReference = 8D01CCD20486CAD60068D4B7 /* OpenColorIO_PS.plugin */; + productReference = 8D01CCD20486CAD60068D4B7 /* OpenColorIO PS.plugin */; productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ @@ -765,7 +765,7 @@ "../../../../ext/yaml-cpp/include", "../../../../ext/Little-CMS/include", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES; REZ_PREFIX_FILE = "$(SRCROOT)/../../../../ext/adobe_photoshop_sdk_cc_2017_mac/photoshopsdk/pluginsdk/samplecode/common/includes/MachOMacrezXcode.h"; SDKROOT = macosx; @@ -790,7 +790,7 @@ INFOPLIST_FILE = ../../mac/OpenColorIO_PS_Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; PLUGIN_TYPE = 8BFM; - PRODUCT_NAME = OpenColorIO_PS; + PRODUCT_NAME = "OpenColorIO PS"; REZ_PREFIX_FILE = "$(SRCROOT)/../../../../ext/adobe_photoshop_sdk_cc_2017_mac/photoshopsdk/pluginsdk/samplecode/common/includes/MachOMacrezXcode.h"; VALID_ARCHS = x86_64; WRAPPER_EXTENSION = plugin; @@ -818,7 +818,7 @@ "../../../../ext/yaml-cpp/include", "../../../../ext/Little-CMS/include", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; SDKROOT = macosx; }; name = Release; @@ -838,7 +838,7 @@ INFOPLIST_FILE = ../../mac/OpenColorIO_PS_Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; PLUGIN_TYPE = 8BFM; - PRODUCT_NAME = OpenColorIO_PS; + PRODUCT_NAME = "OpenColorIO PS"; REZ_PREFIX_FILE = "$(SRCROOT)/../../../../ext/adobe_photoshop_sdk_cc_2017_mac/photoshopsdk/pluginsdk/samplecode/common/includes/MachOMacrezXcode.h"; VALID_ARCHS = x86_64; WRAPPER_EXTENSION = plugin; From 80d2d4eaff583c9dc9c75ddfdf7117ad89673b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Achard?= Date: Tue, 15 Jun 2021 05:19:53 +0100 Subject: [PATCH 05/12] Add OpenColorIOConfig.cmake generation (#1397) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial OpenColorIO Config CMake implementation Signed-off-by: Rémi Achard * Remove macro, improve documentation Signed-off-by: Rémi Achard Co-authored-by: Patrick Hodoul Signed-off-by: Patrick Hodoul --- CMakeLists.txt | 39 ++++++++++++++++++++++++++++++ include/OpenColorIO/CMakeLists.txt | 21 +++++++++++++--- src/OpenColorIO/CMakeLists.txt | 8 +++--- src/bindings/python/CMakeLists.txt | 2 +- src/cmake/Config.cmake.in | 5 ++++ tests/cpu/CMakeLists.txt | 2 +- 6 files changed, 66 insertions(+), 11 deletions(-) create mode 100644 src/cmake/Config.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index c33067646d..b8e18214b4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,3 +265,42 @@ configure_file(${CMAKE_SOURCE_DIR}/share/ocio/${OCIO_SETUP_NAME}.in ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} DESTINATION share/ocio/) + + +############################################################################### +# Generate OpenColorIO-config.cmake +# Targets exported to ${PROJECT_NAME}_EXPORTED_TARGETS will be available for +# import using find_package(OpenColorIO). + +include(CMakePackageConfigHelpers) + +set(OCIO_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets.cmake") +set(OCIO_VERSION_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake") +set(OCIO_PROJECT_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake") +set(OCIO_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") + +# Version fetched from the top level project() +write_basic_package_version_file( + ${OCIO_VERSION_CONFIG} + # Version range supported only if generated by CMake 3.19.2 or newer. + COMPATIBILITY SameMajorVersion +) + +configure_package_config_file( + ${CMAKE_CURRENT_LIST_DIR}/src/cmake/Config.cmake.in ${OCIO_PROJECT_CONFIG} + INSTALL_DESTINATION ${OCIO_CONFIG_INSTALL_DIR} + NO_SET_AND_CHECK_MACRO + NO_CHECK_REQUIRED_COMPONENTS_MACRO +) + +install( + EXPORT ${PROJECT_NAME}_EXPORTED_TARGETS + DESTINATION ${OCIO_CONFIG_INSTALL_DIR} + NAMESPACE ${PROJECT_NAME}:: + FILE ${OCIO_TARGETS_EXPORT_NAME} +) + +install( + FILES "${OCIO_PROJECT_CONFIG}" "${OCIO_VERSION_CONFIG}" + DESTINATION "${OCIO_CONFIG_INSTALL_DIR}" +) diff --git a/include/OpenColorIO/CMakeLists.txt b/include/OpenColorIO/CMakeLists.txt index e4c8a79ffb..64980f661d 100644 --- a/include/OpenColorIO/CMakeLists.txt +++ b/include/OpenColorIO/CMakeLists.txt @@ -2,13 +2,22 @@ # Copyright Contributors to the OpenColorIO Project. configure_file("OpenColorABI.h.in" "${CMAKE_CURRENT_BINARY_DIR}/OpenColorABI.h" @ONLY) -add_library(public_api INTERFACE) +add_library(OpenColorIOHeaders INTERFACE) -set_property(TARGET public_api - PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/..;${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO +set(BUILD_INCLUDES + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO ) -add_dependencies(public_api "${CMAKE_CURRENT_BINARY_DIR}/OpenColorABI.h") +target_include_directories(OpenColorIOHeaders + INTERFACE + "$" + "$" +) + +add_dependencies(OpenColorIOHeaders "${CMAKE_CURRENT_BINARY_DIR}/OpenColorABI.h") # public interface @@ -17,3 +26,7 @@ list(APPEND core_export_headers ${CMAKE_CURRENT_BINARY_DIR}/OpenColorABI.h) install(FILES ${core_export_headers} DESTINATION include/OpenColorIO) + +install(TARGETS OpenColorIOHeaders + EXPORT ${PROJECT_NAME}_EXPORTED_TARGETS +) diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index 2ce801e680..48061251b4 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -182,9 +182,6 @@ if(NOT WIN32) configure_file(res/OpenColorIO.pc.in ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() - -# TODO: Install the OpenColorIO-config.cmake. - add_library(OpenColorIO ${SOURCES}) if(BUILD_SHARED_LIBS AND WIN32) @@ -199,12 +196,12 @@ if(BUILD_SHARED_LIBS AND WIN32) endif() target_include_directories(OpenColorIO - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) target_link_libraries(OpenColorIO PUBLIC - public_api + OpenColorIOHeaders PRIVATE expat::expat IlmBase::Half @@ -279,6 +276,7 @@ if(MSVC AND BUILD_SHARED_LIBS) endif() install(TARGETS OpenColorIO + EXPORT ${PROJECT_NAME}_EXPORTED_TARGETS LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 19c36451b0..3225cdf468 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -199,7 +199,7 @@ target_include_directories(PyOpenColorIO # macOS, to prevent segfaults when potentially working with multiple Python # installations. See note in: # https://pybind11.readthedocs.io/en/stable/compiling.html#building-manually -set(PYOCIO_LINK_PUBLIC public_api) +set(PYOCIO_LINK_PUBLIC OpenColorIOHeaders) if(WIN32) list(INSERT PYOCIO_LINK_PUBLIC 0 ${Python_LIBRARIES}) endif() diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in new file mode 100644 index 0000000000..eebb2c1900 --- /dev/null +++ b/src/cmake/Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) + +include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake) diff --git a/tests/cpu/CMakeLists.txt b/tests/cpu/CMakeLists.txt index 6738996281..cb03e1da95 100755 --- a/tests/cpu/CMakeLists.txt +++ b/tests/cpu/CMakeLists.txt @@ -15,7 +15,7 @@ function(add_ocio_test NAME SOURCES PRIVATE_INCLUDES) ) target_link_libraries(${TEST_BINARY} PUBLIC - public_api + OpenColorIOHeaders PRIVATE expat::expat IlmBase::Half From 09f4d22f6eb86aaaab61eb1106ac426f94893722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Achard?= Date: Tue, 15 Jun 2021 13:23:59 +0100 Subject: [PATCH 06/12] Use CMake visibility flags (#1411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update install doc minimal version numbers Signed-off-by: Rémi Achard * Use CMake visibility presets variables Signed-off-by: Rémi Achard * Fix python package case Signed-off-by: Rémi Achard * Allow advanced user to override symbol visibility Signed-off-by: Rémi Achard Co-authored-by: Patrick Hodoul Signed-off-by: Patrick Hodoul --- CMakeLists.txt | 1 - docs/quick_start/installation.rst | 6 +++--- share/cmake/macros/VariableUtils.cmake | 13 +++++++++++++ share/cmake/modules/FindHalf.cmake | 10 +++------- share/cmake/modules/Findexpat.cmake | 13 +++++-------- share/cmake/modules/Findpystring.cmake | 10 +++------- share/cmake/modules/Findyaml-cpp.cmake | 10 ++++------ share/cmake/utils/CompilerFlags.cmake | 14 ++++++++++---- 8 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 share/cmake/macros/VariableUtils.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b8e18214b4..8342ca7cdb 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,6 @@ option(OCIO_WARNING_AS_ERROR "Set build error level for CI testing" OFF) # Optimization / internal linking preferences option(OCIO_USE_SSE "Specify whether to enable SSE CPU performance optimizations" ON) -option(OCIO_INLINES_HIDDEN "Specify whether to build with -fvisibility-inlines-hidden" ${UNIX}) ############################################################################### diff --git a/docs/quick_start/installation.rst b/docs/quick_start/installation.rst index 38513488f3..439ab6bd3e 100644 --- a/docs/quick_start/installation.rst +++ b/docs/quick_start/installation.rst @@ -63,15 +63,15 @@ default, cmake will try to install all of the items labelled with * and so it is not necessary to install those items manually: - cmake >= 3.12 -- \*Expat >= 2.2.5 (XML parser for CDL/CLF/CTF) +- \*Expat >= 2.2.8 (XML parser for CDL/CLF/CTF) - \*yaml-cpp >= 0.6.3 (YAML parser for Configs) -- \*IlmBase (Half only) >= 2.3.0 (for half domain LUTs) +- \*IlmBase (Half only) >= 2.4.0 (for half domain LUTs) - \*pystring >= 1.1.3 Some optional components also depend on: - \*Little CMS >= 2.2 (for ociobakelut ICC profile baking) -- \*pybind11 >= 2.4.3 (for the Python bindings) +- \*pybind11 >= 2.6.1 (for the Python bindings) - Python >= 2.7 (for the Python bindings) - Python 3.7 or 3.8 (for the docs, with the following PyPi packages) - Sphinx diff --git a/share/cmake/macros/VariableUtils.cmake b/share/cmake/macros/VariableUtils.cmake new file mode 100644 index 0000000000..7f82086ac4 --- /dev/null +++ b/share/cmake/macros/VariableUtils.cmake @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright Contributors to the OpenColorIO Project. +# +# General CMake utility macros. +# + +macro(set_unless_defined var_name var_default) + if(NOT DEFINED ${var_name}) + set(${var_name} ${var_default}) + else() + message(STATUS "Variable explicitly defined: ${var_name} = ${${var_name}}") + endif() +endmacro() diff --git a/share/cmake/modules/FindHalf.cmake b/share/cmake/modules/FindHalf.cmake index 5f0e083f3a..da308c023a 100644 --- a/share/cmake/modules/FindHalf.cmake +++ b/share/cmake/modules/FindHalf.cmake @@ -158,13 +158,6 @@ if(NOT Half_FOUND) "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}Half-${_Half_LIB_VER}${_Half_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") if(_Half_TARGET_CREATE) - if(UNIX) - set(Half_CXX_FLAGS "${Half_CXX_FLAGS} -fvisibility=hidden -fPIC") - if(OCIO_INLINES_HIDDEN) - set(Half_CXX_FLAGS "${Half_CXX_FLAGS} -fvisibility-inlines-hidden") - endif() - endif() - if(MSVC) set(Half_CXX_FLAGS "${Half_CXX_FLAGS} /EHsc") endif() @@ -173,6 +166,9 @@ if(NOT Half_FOUND) set(Half_CMAKE_ARGS ${Half_CMAKE_ARGS} + -DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET} + -DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN} + -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${Half_CXX_FLAGS} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} diff --git a/share/cmake/modules/Findexpat.cmake b/share/cmake/modules/Findexpat.cmake index d51f71577a..e29f89ec66 100644 --- a/share/cmake/modules/Findexpat.cmake +++ b/share/cmake/modules/Findexpat.cmake @@ -154,14 +154,6 @@ if(NOT expat_FOUND) "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}expat${_expat_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") if(_expat_TARGET_CREATE) - if(UNIX) - set(EXPAT_C_FLAGS "${EXPAT_C_FLAGS} -fvisibility=hidden -fPIC") - set(EXPAT_CXX_FLAGS "${EXPAT_CXX_FLAGS} -fvisibility=hidden -fPIC") - if(OCIO_INLINES_HIDDEN) - set(EXPAT_CXX_FLAGS "${EXPAT_CXX_FLAGS} -fvisibility-inlines-hidden") - endif() - endif() - if(MSVC) set(EXPAT_C_FLAGS "${EXPAT_C_FLAGS} /EHsc") set(EXPAT_CXX_FLAGS "${EXPAT_CXX_FLAGS} /EHsc") @@ -172,6 +164,11 @@ if(NOT expat_FOUND) set(EXPAT_CMAKE_ARGS ${EXPAT_CMAKE_ARGS} + -DCMAKE_POLICY_DEFAULT_CMP0063=NEW + -DCMAKE_C_VISIBILITY_PRESET=${CMAKE_C_VISIBILITY_PRESET} + -DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET} + -DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN} + -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_C_FLAGS=${EXPAT_C_FLAGS} -DCMAKE_CXX_FLAGS=${EXPAT_CXX_FLAGS} diff --git a/share/cmake/modules/Findpystring.cmake b/share/cmake/modules/Findpystring.cmake index adc4d6b11a..a3e396de70 100644 --- a/share/cmake/modules/Findpystring.cmake +++ b/share/cmake/modules/Findpystring.cmake @@ -88,13 +88,6 @@ if(NOT pystring_FOUND) "${_EXT_DIST_ROOT}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pystring${CMAKE_STATIC_LIBRARY_SUFFIX}") if(_pystring_TARGET_CREATE) - if(UNIX) - set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} -fvisibility=hidden -fPIC") - if(OCIO_INLINES_HIDDEN) - set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} -fvisibility-inlines-hidden") - endif() - endif() - if(MSVC) set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} /EHsc") endif() @@ -103,6 +96,9 @@ if(NOT pystring_FOUND) set(pystring_CMAKE_ARGS ${pystring_CMAKE_ARGS} + -DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET} + -DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN} + -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${pystring_CXX_FLAGS} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} diff --git a/share/cmake/modules/Findyaml-cpp.cmake b/share/cmake/modules/Findyaml-cpp.cmake index e43803514b..e65939d256 100644 --- a/share/cmake/modules/Findyaml-cpp.cmake +++ b/share/cmake/modules/Findyaml-cpp.cmake @@ -159,12 +159,6 @@ if(NOT yaml-cpp_FOUND) endif() if(UNIX) - set(yaml-cpp_CXX_FLAGS "${yaml-cpp_CXX_FLAGS} -fvisibility=hidden -fPIC") - - if(OCIO_INLINES_HIDDEN) - set(yaml-cpp_CXX_FLAGS "${yaml-cpp_CXX_FLAGS} -fvisibility-inlines-hidden") - endif() - if(USE_CLANG) # Remove some global 'shadow' warnings. set(yaml-cpp_CXX_FLAGS "${yaml-cpp_CXX_FLAGS} -Wno-shadow") @@ -175,6 +169,10 @@ if(NOT yaml-cpp_FOUND) set(yaml-cpp_CMAKE_ARGS ${yaml-cpp_CMAKE_ARGS} + -DCMAKE_POLICY_DEFAULT_CMP0063=NEW + -DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET} + -DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN} + -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${yaml-cpp_CXX_FLAGS} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} diff --git a/share/cmake/utils/CompilerFlags.cmake b/share/cmake/utils/CompilerFlags.cmake index b182722429..3d5d8da280 100644 --- a/share/cmake/utils/CompilerFlags.cmake +++ b/share/cmake/utils/CompilerFlags.cmake @@ -56,10 +56,6 @@ if(USE_GCC OR USE_CLANG) set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Werror") endif() - if(OCIO_INLINES_HIDDEN) - set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -fvisibility-inlines-hidden") - endif() - if(APPLE) # TODO: There are still some deprecated methods. set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Wno-deprecated-declarations") @@ -72,6 +68,16 @@ endif() mark_as_advanced(PLATFORM_COMPILE_FLAGS) +############################################################################### +# Define hidden symbol visibility by default for all targets. + +include(VariableUtils) + +set_unless_defined(CMAKE_C_VISIBILITY_PRESET hidden) +set_unless_defined(CMAKE_CXX_VISIBILITY_PRESET hidden) +set_unless_defined(CMAKE_VISIBILITY_INLINES_HIDDEN YES) + + ############################################################################### # Define if SSE2 can be used. From 33b9afd93448846804398182799d60ddd0c67602 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Mon, 21 Jun 2021 09:42:51 -0400 Subject: [PATCH 07/12] Fix Windows build Signed-off-by: Patrick Hodoul --- src/bindings/python/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 3225cdf468..23603a68b2 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -139,7 +139,9 @@ set(CUSTOM_COMPILE_FLAGS ${PLATFORM_COMPILE_FLAGS}) # The Python binding contains deprecated methods for backward compatibility reason, # so disable the warning. if(USE_GCC OR USE_CLANG) - set(CUSTOM_COMPILE_FLAGS "${CUSTOM_COMPILE_FLAGS} -Wno-deprecated-declarations") + set(CUSTOM_COMPILE_FLAGS "${CUSTOM_COMPILE_FLAGS} -Wno-deprecated-declarations") +elseif(USE_MSVC) + set(CUSTOM_COMPILE_FLAGS "${CUSTOM_COMPILE_FLAGS} /wd4996") endif() set_target_properties(PyOpenColorIO From 6ccb876494332f964c1499cc079b70d04357d2ab Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Mon, 28 Jun 2021 07:59:57 -0400 Subject: [PATCH 08/12] Update include/OpenColorIO/OpenColorIO.h Co-authored-by: Michael Dolan Signed-off-by: Patrick Hodoul --- include/OpenColorIO/OpenColorIO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/OpenColorIO/OpenColorIO.h b/include/OpenColorIO/OpenColorIO.h index e49243aa3f..2d7aaeb09a 100644 --- a/include/OpenColorIO/OpenColorIO.h +++ b/include/OpenColorIO/OpenColorIO.h @@ -1010,7 +1010,7 @@ class OCIOEXPORT Config * * If strict parsing is disabled, return ROLE_DEFAULT (if defined). * * If the default role is not defined, return an empty string. */ - OCIO_DEPRECATED("This is now deprecated starting at v2.0, please use Config::getColorSpaceFromFilepath().") + OCIO_DEPRECATED("This was marked as deprecated starting in v2.0, please use Config::getColorSpaceFromFilepath().") const char * parseColorSpaceFromString(const char * str) const; bool isStrictParsingEnabled() const; From cab69afa7ff34ef63eb543da835567c2d7cf23f8 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Mon, 28 Jun 2021 08:00:06 -0400 Subject: [PATCH 09/12] Update src/OpenColorIO/FileRules.cpp Co-authored-by: Michael Dolan Signed-off-by: Patrick Hodoul --- src/OpenColorIO/FileRules.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/OpenColorIO/FileRules.cpp b/src/OpenColorIO/FileRules.cpp index 8a35472ff6..794dfdbee9 100644 --- a/src/OpenColorIO/FileRules.cpp +++ b/src/OpenColorIO/FileRules.cpp @@ -1027,7 +1027,7 @@ void UpdateFileRulesFromV1ToV2(const Config & config, FileRulesRcPtr & fileRules else { static constexpr char msg[] - = "The default rule creation fallbacks to the first color space because "\ + = "The default rule creation falls back to the first color space because "\ "no suitable color space exists."; LogWarning(msg); @@ -1047,4 +1047,3 @@ void UpdateFileRulesFromV1ToV2(const Config & config, FileRulesRcPtr & fileRules } // namespace OCIO_NAMESPACE - From bcdff432115af1e4dd97ccc437249a34c5545372 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Sun, 27 Jun 2021 18:15:05 -0400 Subject: [PATCH 10/12] Hide dependency symbol visibility (#1409) (#1416) When creating libOpenColorIO.so, we lacked the linker commands that hide symbol visibility from the dependent libraries, which is necessary to prevent OCIO from exporting the symbols from Expat and the other dependencies that OCIO needs to use internally but is not trying intentionally to expose via its API. Failing to do this can result in symbol clashes and all sorts of subtle errors if OCIO is used in an app that also uses and is linked against a potentially different version of Expat (or any of the other deps). Signed-off-by: Larry Gritz Co-authored-by: Larry Gritz Signed-off-by: Patrick Hodoul --- src/OpenColorIO/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index 48061251b4..cce741db6d 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -270,6 +270,14 @@ set_target_properties(OpenColorIO PROPERTIES SOVERSION ${SOVERSION} ) +if (UNIX AND NOT APPLE) + # Also hide all the symbols of dependent libraries to prevent clashes if + # an app using this project is linked against other versions of our + # dependencies. + set_property (TARGET OpenColorIO + APPEND PROPERTY LINK_FLAGS "-Wl,--exclude-libs,ALL") +endif () + if(MSVC AND BUILD_SHARED_LIBS) # Install the pdb file if any. install(FILES $ DESTINATION bin OPTIONAL) From ab935d7c8b4010ebaad56709e1b6b4e42cdefc93 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Mon, 28 Jun 2021 10:04:06 -0400 Subject: [PATCH 11/12] Adsk Contrib - Improve DX11 & Cg fragment shader language support (#1406) * Adsk Contrib - Improve DX11 support Signed-off-by: Patrick Hodoul * Improve Cg support Signed-off-by: Patrick Hodoul * Improve GPU comments Signed-off-by: Patrick Hodoul --- src/OpenColorIO/GpuShaderUtils.cpp | 112 ++++++++++++------ src/OpenColorIO/ops/gamma/GammaOpGPU.cpp | 4 +- .../gradingrgbcurve/GradingRGBCurveOpGPU.cpp | 11 +- src/OpenColorIO/ops/log/LogOpGPU.cpp | 10 +- src/OpenColorIO/ops/lut1d/Lut1DOpGPU.cpp | 2 +- src/OpenColorIO/ops/lut3d/Lut3DOpGPU.cpp | 2 +- src/OpenColorIO/ops/matrix/MatrixOpGPU.cpp | 2 +- src/OpenColorIO/ops/range/RangeOpGPU.cpp | 2 +- 8 files changed, 96 insertions(+), 49 deletions(-) diff --git a/src/OpenColorIO/GpuShaderUtils.cpp b/src/OpenColorIO/GpuShaderUtils.cpp index e99987572c..f9786b3d65 100644 --- a/src/OpenColorIO/GpuShaderUtils.cpp +++ b/src/OpenColorIO/GpuShaderUtils.cpp @@ -313,32 +313,54 @@ void GpuShaderText::declareFloatArrayConst(const std::string & name, int size, c } auto nl = newLine(); - if (m_lang != GPU_LANGUAGE_HLSL_DX11) + + switch (m_lang) { - nl << "const " << floatKeyword() << " " << name << "[" << size << "]" << " = "; - nl << floatKeyword() << "[" << size << "]("; - for (int i = 0; i < size; ++i) + case GPU_LANGUAGE_GLSL_1_2: + case GPU_LANGUAGE_GLSL_1_3: + case GPU_LANGUAGE_GLSL_4_0: { - nl << getFloatString(v[i], m_lang); - if (i + 1 != size) + nl << "const " << floatKeyword() << " " << name << "[" << size << "] = "; + nl << floatKeyword() << "[" << size << "]("; + for (int i = 0; i < size; ++i) { - nl << ", "; + nl << getFloatString(v[i], m_lang); + if (i + 1 != size) + { + nl << ", "; + } } + nl << ");"; + break; } - nl << ");"; - } - else - { - nl << "vector " << name << " = {"; - for (int i = 0; i < size; ++i) + case GPU_LANGUAGE_HLSL_DX11: + { + nl << "const " << floatKeyword() << " " << name << "[" << size << "] = {"; + for (int i = 0; i < size; ++i) + { + nl << getFloatString(v[i], m_lang); + if (i + 1 != size) + { + nl << ", "; + } + } + nl << "};"; + break; + } + case GPU_LANGUAGE_CG: { - nl << getFloatString(v[i], m_lang); - if (i + 1 != size) + nl << floatKeyword() << " " << name << "[" << size << "] = {"; + for (int i = 0; i < size; ++i) { - nl << ", "; + nl << getFloatString(v[i], m_lang); + if (i + 1 != size) + { + nl << ", "; + } } + nl << "};"; + break; } - nl << "};"; } } @@ -354,32 +376,54 @@ void GpuShaderText::declareIntArrayConst(const std::string & name, int size, con } auto nl = newLine(); - if (m_lang != GPU_LANGUAGE_HLSL_DX11) + + switch (m_lang) { - nl << "const " << intKeyword() << " " << name << "[" << size << "]" - << " = " << intKeyword() << "[" << size << "]("; - for (int i = 0; i < size; ++i) + case GPU_LANGUAGE_GLSL_1_2: + case GPU_LANGUAGE_GLSL_1_3: + case GPU_LANGUAGE_GLSL_4_0: { - nl << v[i]; - if (i + 1 != size) + nl << "const " << intKeyword() << " " << name << "[" << size << "] = " + << intKeyword() << "[" << size << "]("; + for (int i = 0; i < size; ++i) { - nl << ", "; + nl << v[i]; + if (i + 1 != size) + { + nl << ", "; + } } + nl << ");"; + break; } - nl << ");"; - } - else - { - nl << "vector<" << intKeyword() << ", " << size << "> " << name << " = {"; - for (int i = 0; i < size; ++i) + case GPU_LANGUAGE_HLSL_DX11: + { + nl << "const " << intKeyword() << " " << name << "[" << size << "] = {"; + for (int i = 0; i < size; ++i) + { + nl << v[i]; + if (i + 1 != size) + { + nl << ", "; + } + } + nl << "};"; + break; + } + case GPU_LANGUAGE_CG: { - nl << v[i]; - if (i + 1 != size) + nl << intKeyword() << " " << name << "[" << size << "] = {"; + for (int i = 0; i < size; ++i) { - nl << ", "; + nl << v[i]; + if (i + 1 != size) + { + nl << ", "; + } } + nl << "};"; + break; } - nl << "};"; } } diff --git a/src/OpenColorIO/ops/gamma/GammaOpGPU.cpp b/src/OpenColorIO/ops/gamma/GammaOpGPU.cpp index 7e7277927c..1ef4190076 100644 --- a/src/OpenColorIO/ops/gamma/GammaOpGPU.cpp +++ b/src/OpenColorIO/ops/gamma/GammaOpGPU.cpp @@ -252,9 +252,9 @@ void GetGammaGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, ss.indent(); ss.newLine() << ""; - ss.newLine() << "// Add Gamma " + ss.newLine() << "// Add Gamma '" << GammaOpData::ConvertStyleToString(gammaData->getStyle()) - << " processing"; + << "' processing"; ss.newLine() << ""; ss.newLine() << "{"; diff --git a/src/OpenColorIO/ops/gradingrgbcurve/GradingRGBCurveOpGPU.cpp b/src/OpenColorIO/ops/gradingrgbcurve/GradingRGBCurveOpGPU.cpp index 3dfb518999..89a8ddebd6 100644 --- a/src/OpenColorIO/ops/gradingrgbcurve/GradingRGBCurveOpGPU.cpp +++ b/src/OpenColorIO/ops/gradingrgbcurve/GradingRGBCurveOpGPU.cpp @@ -218,18 +218,19 @@ void AddCurveEvalMethodTextToShaderProgram(GpuShaderCreatorRcPtr & shaderCreator auto propGC = gcData->getDynamicPropertyInternal(); // 2 ints for each curve. + st.newLine() << ""; st.declareIntArrayConst(props.m_knotsOffsets, 4 * 2, propGC->getKnotsOffsetsArray()); st.declareFloatArrayConst(props.m_knots, propGC->getNumKnots(), propGC->getKnotsArray()); st.declareIntArrayConst(props.m_coefsOffsets, 4 * 2, propGC->getCoefsOffsetsArray()); st.declareFloatArrayConst(props.m_coefs, propGC->getNumCoefs(), propGC->getCoefsArray()); - st.newLine() << ""; } + st.newLine() << ""; st.newLine() << "float " << props.m_eval << "(in int curveIdx, in float x)"; st.newLine() << "{"; st.indent(); - bool isInv = gcData->getDirection() == TRANSFORM_DIR_INVERSE; + const bool isInv = gcData->getDirection() == TRANSFORM_DIR_INVERSE; GradingBSplineCurveImpl::AddShaderEval(st, props.m_knotsOffsets, props.m_coefsOffsets, props.m_knots, props.m_coefs, isInv); @@ -361,14 +362,16 @@ void GetGradingRGBCurveGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, { // Add the dynamic property to the shader creator. auto prop = gcData->getDynamicPropertyInternal(); + // Property is decoupled. auto shaderProp = prop->createEditableCopy(); DynamicPropertyRcPtr newProp = shaderProp; shaderCreator->addDynamicProperty(newProp); - // Add uniforms. + // Add uniforms only if needed. AddGCPropertiesUniforms(shaderCreator, shaderProp, properties); - // Add helper function. + + // Add helper function plus global variables if they are not dynamic. AddCurveEvalMethodTextToShaderProgram(shaderCreator, gcData, properties); } else diff --git a/src/OpenColorIO/ops/log/LogOpGPU.cpp b/src/OpenColorIO/ops/log/LogOpGPU.cpp index 3298e39c28..71d4bb241f 100644 --- a/src/OpenColorIO/ops/log/LogOpGPU.cpp +++ b/src/OpenColorIO/ops/log/LogOpGPU.cpp @@ -49,7 +49,7 @@ void AddAntiLogShader(GpuShaderCreatorRcPtr & shaderCreator, ConstLogOpDataRcPtr st.indent(); st.newLine() << ""; - st.newLine() << "// Add Anti-Log processing"; + st.newLine() << "// Add Log 'Anti-Log' processing"; st.newLine() << ""; const char * pix = shaderCreator->getPixelName(); @@ -69,7 +69,7 @@ void AddLogToLinShader(GpuShaderCreatorRcPtr & shaderCreator, ConstLogOpDataRcPt st.indent(); st.newLine() << ""; - st.newLine() << "// Add Log to Lin processing"; + st.newLine() << "// Add Log 'Log to Lin' processing"; st.newLine() << "{"; st.indent(); @@ -117,7 +117,7 @@ void AddLinToLogShader(GpuShaderCreatorRcPtr & shaderCreator, ConstLogOpDataRcPt st.indent(); st.newLine() << ""; - st.newLine() << "// Add Lin to Log processing"; + st.newLine() << "// Add Log 'Lin to Log' processing"; st.newLine() << "{"; st.indent(); @@ -181,7 +181,7 @@ void AddCameraLogToLinShader(GpuShaderCreatorRcPtr & shaderCreator, st.indent(); st.newLine() << ""; - st.newLine() << "// Add Camera Log to Lin processing"; + st.newLine() << "// Add Log 'Camera Log to Lin' processing"; st.newLine() << "{"; st.indent(); @@ -255,7 +255,7 @@ void AddCameraLinToLogShader(GpuShaderCreatorRcPtr & shaderCreator, st.indent(); st.newLine() << ""; - st.newLine() << "// Add Camera Lin to Log processing"; + st.newLine() << "// Add Log 'Camera Lin to Log' processing"; st.newLine() << "{"; st.indent(); diff --git a/src/OpenColorIO/ops/lut1d/Lut1DOpGPU.cpp b/src/OpenColorIO/ops/lut1d/Lut1DOpGPU.cpp index b9b71d8b77..38bb9c5ff9 100644 --- a/src/OpenColorIO/ops/lut1d/Lut1DOpGPU.cpp +++ b/src/OpenColorIO/ops/lut1d/Lut1DOpGPU.cpp @@ -296,7 +296,7 @@ void GetLut1DGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, ss.indent(); ss.newLine() << ""; - ss.newLine() << "// Add a LUT 1D processing for " << name; + ss.newLine() << "// Add LUT 1D processing for " << name; ss.newLine() << ""; ss.newLine() << "{"; diff --git a/src/OpenColorIO/ops/lut3d/Lut3DOpGPU.cpp b/src/OpenColorIO/ops/lut3d/Lut3DOpGPU.cpp index 32030fc9bf..df6ae3c31a 100644 --- a/src/OpenColorIO/ops/lut3d/Lut3DOpGPU.cpp +++ b/src/OpenColorIO/ops/lut3d/Lut3DOpGPU.cpp @@ -51,7 +51,7 @@ void GetLut3DGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, ConstLut3DO ss.indent(); ss.newLine() << ""; - ss.newLine() << "// Add a LUT 3D processing for " << name; + ss.newLine() << "// Add LUT 3D processing for " << name; ss.newLine() << ""; diff --git a/src/OpenColorIO/ops/matrix/MatrixOpGPU.cpp b/src/OpenColorIO/ops/matrix/MatrixOpGPU.cpp index d81a13979a..5c36f4f8a6 100644 --- a/src/OpenColorIO/ops/matrix/MatrixOpGPU.cpp +++ b/src/OpenColorIO/ops/matrix/MatrixOpGPU.cpp @@ -16,7 +16,7 @@ void GetMatrixGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, ConstMatri ss.indent(); ss.newLine() << ""; - ss.newLine() << "// Add a Matrix processing"; + ss.newLine() << "// Add Matrix processing"; ss.newLine() << ""; ArrayDouble::Values values = matrix->getArray().getValues(); diff --git a/src/OpenColorIO/ops/range/RangeOpGPU.cpp b/src/OpenColorIO/ops/range/RangeOpGPU.cpp index 7651adc3ef..0427fccf4d 100644 --- a/src/OpenColorIO/ops/range/RangeOpGPU.cpp +++ b/src/OpenColorIO/ops/range/RangeOpGPU.cpp @@ -18,7 +18,7 @@ void GetRangeGPUShaderProgram(GpuShaderCreatorRcPtr & shaderCreator, ConstRangeO ss.indent(); ss.newLine() << ""; - ss.newLine() << "// Add a Range processing"; + ss.newLine() << "// Add Range processing"; ss.newLine() << ""; if(range->scales()) From 0b941b394cbe0be7d6713f622db48ab41166971c Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Mon, 28 Jun 2021 11:04:15 -0400 Subject: [PATCH 12/12] Fix unit test failures Signed-off-by: Patrick Hodoul --- tests/cpu/FileRules_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cpu/FileRules_tests.cpp b/tests/cpu/FileRules_tests.cpp index f5b77ee923..c47aea71e0 100644 --- a/tests/cpu/FileRules_tests.cpp +++ b/tests/cpu/FileRules_tests.cpp @@ -1549,7 +1549,7 @@ strictparsing: true cfg->upgradeToLatestVersion(); OCIO_CHECK_EQUAL( - std::string("[OpenColorIO Warning]: The default rule creation fallbacks to the"\ + std::string("[OpenColorIO Warning]: The default rule creation falls back to the"\ " first color space because no suitable color space exists.\n"), l.output()); } @@ -1690,7 +1690,7 @@ OCIO_ADD_TEST(FileRules, config_v1_to_v2_from_memory) config->upgradeToLatestVersion(); OCIO_CHECK_EQUAL( - std::string("[OpenColorIO Warning]: The default rule creation fallbacks to the"\ + std::string("[OpenColorIO Warning]: The default rule creation falls back to the"\ " first color space because no suitable color space exists.\n"), l.output()); }