Skip to content

Commit

Permalink
Image nodes : Remove unnecessary use of OCIO configs
Browse files Browse the repository at this point in the history
OCIO will look up ROLE_SCENE_LINEAR for us dynamically, so there's no need to do the lookup manually ourselves.
  • Loading branch information
johnhaddon committed Jun 2, 2023
1 parent 53e14c8 commit 12555f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/GafferImage/ImageReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ ImageReader::ImageReader( const std::string &name )
addChild( colorSpace );
colorSpace->inPlug()->setInput( oiioReader->outPlug() );
colorSpace->inputSpacePlug()->setInput( intermediateColorSpacePlug() );
OCIO_NAMESPACE::ConstConfigRcPtr config = OCIO_NAMESPACE::GetCurrentConfig();
colorSpace->outputSpacePlug()->setValue( config->getColorSpace( OCIO_NAMESPACE::ROLE_SCENE_LINEAR )->getName() );
colorSpace->outputSpacePlug()->setValue( OCIO_NAMESPACE::ROLE_SCENE_LINEAR );
colorSpace->processUnpremultipliedPlug()->setValue( true );
intermediateImagePlug()->setInput( colorSpace->outPlug() );
}
Expand Down
5 changes: 1 addition & 4 deletions src/GafferImage/ImageWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1525,10 +1525,7 @@ ImageWriter::ImageWriter( const std::string &name )
ColorSpacePtr colorSpaceChild = new ColorSpace( "__colorSpace" );
addChild( colorSpaceChild );

OCIO_NAMESPACE::ConstConfigRcPtr config = OCIO_NAMESPACE::GetCurrentConfig();

colorSpaceChild->inputSpacePlug()->setValue( config->getColorSpace( OCIO_NAMESPACE::ROLE_SCENE_LINEAR )->getName() );

colorSpaceChild->inputSpacePlug()->setValue( OCIO_NAMESPACE::ROLE_SCENE_LINEAR );
colorSpaceChild->outputSpacePlug()->setValue( "${__imageWriter:colorSpace}" );

ValuePlugPtr layoutPlug = new ValuePlug( "layout" );
Expand Down

0 comments on commit 12555f3

Please sign in to comment.