Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adsk contrib - Update builtin config and add studio builtin config #1713

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