various: removed hardcoded OCIO::ROLE_SCENE_LINEAR to allow for a configurable reference space

This commit is contained in:
itsmattkc
2020-04-03 01:30:47 +11:00
parent 552163320c
commit e1ca5f2f82
6 changed files with 25 additions and 6 deletions
+2 -2
View File
@@ -76,8 +76,8 @@ void OpenGLProxy::FrameToValue(DecoderPtr decoder, StreamPtr stream, const TimeR
if (!color_processor) {
color_processor = OpenGLColorProcessor::Create(video_stream->footage()->project()->color_manager()->GetConfig(),
video_stream->colorspace(),
OCIO::ROLE_SCENE_LINEAR);
video_stream->colorspace(),
video_stream->footage()->project()->color_manager()->GetReferenceColorSpace());
color_cache_.Add(colorspace_match, color_processor);
}
+13
View File
@@ -10,6 +10,9 @@ ColorManager::ColorManager()
{
// Ensures config is set to something
config_ = OCIO::GetCurrentConfig();
// Default reference space is scene linear
reference_space_ = OCIO::ROLE_SCENE_LINEAR;
}
OCIO::ConstConfigRcPtr ColorManager::GetConfig() const
@@ -108,6 +111,16 @@ void ColorManager::SetDefaultInputColorSpace(const QString &s)
default_input_color_space_ = s;
}
const QString &ColorManager::GetReferenceColorSpace() const
{
return reference_space_;
}
void ColorManager::SetReferenceColorSpace(const QString &s)
{
reference_space_ = s;
}
QStringList ColorManager::ListAvailableInputColorspaces(OCIO::ConstConfigRcPtr config)
{
QStringList spaces;
+6
View File
@@ -40,6 +40,10 @@ public:
void SetDefaultInputColorSpace(const QString& s);
const QString& GetReferenceColorSpace() const;
void SetReferenceColorSpace(const QString& s);
static QStringList ListAvailableInputColorspaces(OCIO::ConstConfigRcPtr config);
enum OCIOMethod {
@@ -70,6 +74,8 @@ private:
QString default_input_color_space_;
QString reference_space_;
};
#endif // COLORSERVICE_H