Skip to content

Commit

Permalink
Adsk contrib - Update builtin config and add studio builtin config (#…
Browse files Browse the repository at this point in the history
…1713)

* - Modifying the CG builtin config and updating the code accordingly. I named the config without the RC2 in order to minimize the changes once the stable release in available.

Signed-off-by: Cedrik Fuoco <[email protected]>

* - Adding Studio config

Signed-off-by: Cedrik Fuoco <[email protected]>

* - Updated config to stable version
- Added some variables for string const

Signed-off-by: Cedrik Fuoco <[email protected]>

* Fixing a unit test since it was using the previous CG config and the config changed.

Signed-off-by: Cédrik Fuoco <[email protected]>

Signed-off-by: Cedrik Fuoco <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>
Co-authored-by: Doug Walker <[email protected]>
  • Loading branch information
cedrik-fuoco-adsk and doug-walker authored Oct 31, 2022
1 parent 4f4e522 commit cac1ba5
Show file tree
Hide file tree
Showing 17 changed files with 1,683 additions and 181 deletions.
10 changes: 8 additions & 2 deletions include/OpenColorIO/OpenColorIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,14 @@ class OCIOEXPORT Config
* \param configName Built-in config name.
*
* The available configNames are:
* "cg-config-v0.1.0_aces-v1.3_ocio-v2.1.1" -- ACES CG config, basic color spaces for computer
* graphics apps. More information about these configs is available at:
*
* ACES Studio config, contains a more complete collection of color spaces and displays:
* "studio-config-v1.0.0_aces-v1.3_ocio-v2.1"
*
* ACES CG config, basic color spaces for computer graphics apps:
* "cg-config-v1.0.0_aces-v1.3_ocio-v2.1"
*
* More information is available at:
* %https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES
*
* Information about the available configs is available from the \ref BuiltinConfigRegistry.
Expand Down
1 change: 1 addition & 0 deletions src/OpenColorIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(SOURCES
BitDepthUtils.cpp
builtinconfigs/BuiltinConfigRegistry.cpp
builtinconfigs/CGConfig.cpp
builtinconfigs/StudioConfig.cpp
Caching.cpp
ColorSpace.cpp
ColorSpaceSet.cpp
Expand Down
5 changes: 4 additions & 1 deletion src/OpenColorIO/builtinconfigs/BuiltinConfigRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "builtinconfigs/BuiltinConfigRegistry.h"
#include "builtinconfigs/CGConfig.h"
#include "builtinconfigs/StudioConfig.h"

#define OUT_OF_RANGE_EXCEPTION_TEXT "Config index is out of range."

Expand Down Expand Up @@ -42,9 +43,11 @@ void BuiltinConfigRegistryImpl::init() noexcept
if (m_builtinConfigs.empty())
{
m_builtinConfigs.clear();

CGCONFIG::Register(*this);
STUDIOCONFIG::Register(*this);

this->setDefaultBuiltinConfig("cg-config-v0.1.0_aces-v1.3_ocio-v2.1.1");
this->setDefaultBuiltinConfig("cg-config-v1.0.0_aces-v1.3_ocio-v2.1");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/OpenColorIO/builtinconfigs/CG.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
// - CGConfig.cpp for the Built-in config feature.
// - BuiltinConfigRegistry_tests.cpp for the unit tests

constexpr char CG_CONFIG_V010_ACES_V130_OCIO_V211[] = { @cg-config-v0.1.0_aces-v1.3_ocio-v2.1.1@ };
constexpr char CG_CONFIG_V100_ACES_V13_OCIO_V21[] = { @cg-config-v1.0.0_aces-v1.3_ocio-v2.1@ };
7 changes: 3 additions & 4 deletions src/OpenColorIO/builtinconfigs/CGConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ namespace OCIO_NAMESPACE

namespace CGCONFIG
{
// Register CG configs.
void Register(BuiltinConfigRegistryImpl & registry) noexcept
{
registry.addBuiltin(
"cg-config-v0.1.0_aces-v1.3_ocio-v2.1.1",
"Academy Color Encoding System - CG Config [COLORSPACES v0.1.0] [ACES v1.3] [OCIO v2.1.1]",
CG_CONFIG_V010_ACES_V130_OCIO_V211,
"cg-config-v1.0.0_aces-v1.3_ocio-v2.1",
"Academy Color Encoding System - CG Config [COLORSPACES v1.0.0] [ACES v1.3] [OCIO v2.1]",
CG_CONFIG_V100_ACES_V13_OCIO_V21,
true
);
}
Expand Down
9 changes: 9 additions & 0 deletions src/OpenColorIO/builtinconfigs/Studio.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.

// The file extension cpp (instead of an header .h) was used here to highlight the fact that
// this file should not be included more then ONCE in OCIO.

constexpr char STUDIO_CONFIG_V100_ACES_V13_OCIO_V21[] = {
@studio-config-v1.0.0_aces-v1.3_ocio-v2.1@
};
29 changes: 29 additions & 0 deletions src/OpenColorIO/builtinconfigs/StudioConfig.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.

#include <OpenColorIO/OpenColorIO.h>
#include "builtinconfigs/BuiltinConfigRegistry.h"
#include "builtinconfigs/StudioConfig.h"

#include "Studio.cpp"

namespace OCIO_NAMESPACE
{
// Create the built-in configs for all versions of the OCIO Studio config for ACES.
// For backwards compatibility, previous versions are kept in the registry but the
// isRecommended flag should be set to false.

namespace STUDIOCONFIG
{
void Register(BuiltinConfigRegistryImpl & registry) noexcept
{
registry.addBuiltin(
"studio-config-v1.0.0_aces-v1.3_ocio-v2.1",
"Academy Color Encoding System - Studio Config [COLORSPACES v1.0.0] [ACES v1.3] [OCIO v2.1]",
STUDIO_CONFIG_V100_ACES_V13_OCIO_V21,
true
);
}

} // namespace STUDIOCONFIG
} // namespace OCIO_NAMESPACE
24 changes: 24 additions & 0 deletions src/OpenColorIO/builtinconfigs/StudioConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.


#ifndef INCLUDED_OCIO_STUDIOCONFIG_H
#define INCLUDED_OCIO_STUDIOCONFIG_H


#include <OpenColorIO/OpenColorIO.h>
#include "builtinconfigs/BuiltinConfigRegistry.h"

namespace OCIO_NAMESPACE
{

class BuiltinConfigRegistryImpl;

namespace STUDIOCONFIG
{
void Register(BuiltinConfigRegistryImpl & registry) noexcept;
} // namespace STUDIOCONFIG

} // namespace OCIO_NAMESPACE

#endif // INCLUDED_OCIO_STUDIOCONFIG_H
Loading

0 comments on commit cac1ba5

Please sign in to comment.