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
@@ -79,10 +79,10 @@ Color ColorDialog::GetSelectedColor() const
void ColorDialog::ColorSpaceChanged(const QString &input, const QString &display, const QString &view, const QString &look)
{
ColorProcessorPtr to_linear_processor_ = ColorProcessor::Create(color_manager_->GetConfig(), input, OCIO::ROLE_SCENE_LINEAR);
ColorProcessorPtr to_linear_processor_ = ColorProcessor::Create(color_manager_->GetConfig(), input, color_manager_->GetReferenceColorSpace());
ColorProcessorPtr to_display = ColorProcessor::Create(color_manager_->GetConfig(),
OCIO::ROLE_SCENE_LINEAR,
color_manager_->GetReferenceColorSpace(),
display,
view,
look);
+1 -1
View File
@@ -270,7 +270,7 @@ void ExportDialog::accept()
SampleFormat::GetConfiguredFormatForMode(render_mode));
ColorProcessorPtr color_processor = ColorProcessor::Create(color_manager_->GetConfig(),
OCIO::ROLE_SCENE_LINEAR,
color_manager_->GetReferenceColorSpace(),
video_tab_->CurrentOCIODisplay(),
video_tab_->CurrentOCIOView(),
video_tab_->CurrentOCIOLook());
+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
+1 -1
View File
@@ -371,7 +371,7 @@ void ViewerGLWidget::SetupColorProcessor()
try {
color_service_ = OpenGLColorProcessor::Create(color_manager_->GetConfig(),
OCIO::ROLE_SCENE_LINEAR,
color_manager_->GetReferenceColorSpace(),
ocio_display_,
ocio_view_,
ocio_look_);