Skip to content

Commit 2fde4fd

Browse files
kenmcgaughKen McGaugh
authored andcommitted
Modifications to allow the "working_space" be set via the source colour management metadata. We use this to set the working_space to "raw" for media we want to remain unmanaged but still allow for the global view to be set without causing error messages.
Signed-off-by: Ken McGaugh <[email protected]>
1 parent e6d277d commit 2fde4fd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/plugin/colour_pipeline/ocio/src/ocio_engine.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,13 @@ OCIOEngine::get_ocio_config(const utility::JsonStore &src_colour_mgmt_metadata)
394394
return config;
395395
}
396396

397-
const char *
397+
std::string
398398
OCIOEngine::working_space(const utility::JsonStore &src_colour_mgmt_metadata) const {
399399
auto config = get_ocio_config(src_colour_mgmt_metadata);
400400
if (not config) {
401401
return "";
402+
} else if (src_colour_mgmt_metadata.contains("working_space")) {
403+
return src_colour_mgmt_metadata["working_space"].get<std::string>();
402404
} else if (config->hasRole(OCIO::ROLE_SCENE_LINEAR)) {
403405
return OCIO::ROLE_SCENE_LINEAR;
404406
} else {
@@ -555,7 +557,7 @@ OCIO::TransformRcPtr OCIOEngine::display_transform(
555557
}
556558

557559
OCIO::DisplayViewTransformRcPtr dt = OCIO::DisplayViewTransform::Create();
558-
dt->setSrc(working_space(src_colour_mgmt_metadata));
560+
dt->setSrc(working_space(src_colour_mgmt_metadata).c_str());
559561
dt->setDisplay(_display.c_str());
560562
dt->setView(_view.c_str());
561563
dt->setDirection(OCIO::TRANSFORM_DIR_FORWARD);

src/plugin/colour_pipeline/ocio/src/ocio_engine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class OCIOEngine {
115115

116116
private:
117117
// OCIO logic
118-
const char *working_space(const utility::JsonStore &src_colour_mgmt_metadata) const;
118+
std::string working_space(const utility::JsonStore &src_colour_mgmt_metadata) const;
119119

120120
// OCIO Transform helpers
121121
OCIO::TransformRcPtr source_transform(

0 commit comments

Comments
 (0)