export: show main color spaces rather than DVL chain
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ColorSpaceChooser::ColorSpaceChooser(ColorManager* color_manager, bool enable_input_field, QWidget *parent):
|
||||
ColorSpaceChooser::ColorSpaceChooser(ColorManager* color_manager, bool enable_input_field, bool enable_display_fields, QWidget *parent):
|
||||
QGroupBox(parent),
|
||||
color_manager_(color_manager)
|
||||
{
|
||||
@@ -36,7 +36,18 @@ ColorSpaceChooser::ColorSpaceChooser(ColorManager* color_manager, bool enable_in
|
||||
int row = 0;
|
||||
|
||||
if (enable_input_field) {
|
||||
layout->addWidget(new QLabel(tr("Input:")), row, 0);
|
||||
|
||||
QString field_text;
|
||||
|
||||
if (enable_display_fields) {
|
||||
// If the display fields are visible, identify this as the input
|
||||
field_text = tr("Input:");
|
||||
} else {
|
||||
// Otherwise, this widget will essentially just serve as a list of standard color spaces
|
||||
field_text = tr("Color Space:");
|
||||
}
|
||||
|
||||
layout->addWidget(new QLabel(field_text), row, 0);
|
||||
|
||||
input_combobox_ = new QComboBox();
|
||||
layout->addWidget(input_combobox_, row, 1);
|
||||
@@ -58,6 +69,7 @@ ColorSpaceChooser::ColorSpaceChooser(ColorManager* color_manager, bool enable_in
|
||||
input_combobox_ = nullptr;
|
||||
}
|
||||
|
||||
if (enable_display_fields) {
|
||||
{
|
||||
layout->addWidget(new QLabel(tr("Display:")), row, 0);
|
||||
|
||||
@@ -108,6 +120,7 @@ ColorSpaceChooser::ColorSpaceChooser(ColorManager* color_manager, bool enable_in
|
||||
connect(look_combobox_, &QComboBox::currentTextChanged, this, &ColorSpaceChooser::ComboBoxChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString ColorSpaceChooser::input() const
|
||||
{
|
||||
@@ -120,17 +133,29 @@ QString ColorSpaceChooser::input() const
|
||||
|
||||
QString ColorSpaceChooser::display() const
|
||||
{
|
||||
if (display_combobox_) {
|
||||
return display_combobox_->currentText();
|
||||
} else {
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
QString ColorSpaceChooser::view() const
|
||||
{
|
||||
if (view_combobox_) {
|
||||
return view_combobox_->currentText();
|
||||
} else {
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
QString ColorSpaceChooser::look() const
|
||||
{
|
||||
if (look_combobox_) {
|
||||
return look_combobox_->currentData().toString();
|
||||
} else {
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
void ColorSpaceChooser::set_input(const QString &s)
|
||||
@@ -195,10 +220,16 @@ void ColorSpaceChooser::UpdateViews(const QString& display)
|
||||
void ColorSpaceChooser::ComboBoxChanged()
|
||||
{
|
||||
if (input_combobox_) {
|
||||
emit ColorSpaceChanged(input(), display(), view(), look());
|
||||
emit InputColorSpaceChanged(input());
|
||||
}
|
||||
|
||||
if (display_combobox_) {
|
||||
emit DisplayColorSpaceChanged(display(), view(), look());
|
||||
}
|
||||
|
||||
if (input_combobox_ && display_combobox_) {
|
||||
emit ColorSpaceChanged(input(), display(), view(), look());
|
||||
}
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -32,7 +32,7 @@ class ColorSpaceChooser : public QGroupBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ColorSpaceChooser(ColorManager* color_manager, bool enable_input_field = true, QWidget* parent = nullptr);
|
||||
ColorSpaceChooser(ColorManager* color_manager, bool enable_input_field = true, bool enable_display_fields = true, QWidget* parent = nullptr);
|
||||
|
||||
QString input() const;
|
||||
QString display() const;
|
||||
@@ -45,6 +45,8 @@ public:
|
||||
void set_look(const QString& s);
|
||||
|
||||
signals:
|
||||
void InputColorSpaceChanged(const QString& input);
|
||||
|
||||
void ColorSpaceChanged(const QString& input, const QString& display, const QString& view, const QString& look);
|
||||
|
||||
void DisplayColorSpaceChanged(const QString& display, const QString& view, const QString& look);
|
||||
|
||||
@@ -216,14 +216,14 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
|
||||
connect(video_tab_->maintain_aspect_checkbox(), SIGNAL(toggled(bool)), this, SLOT(ResolutionChanged()));
|
||||
connect(video_tab_->codec_combobox(), SIGNAL(currentIndexChanged(int)), this, SLOT(VideoCodecChanged()));
|
||||
connect(video_tab_,
|
||||
&ExportVideoTab::DisplayColorSpaceChanged,
|
||||
&ExportVideoTab::ColorSpaceChanged,
|
||||
preview_viewer_,
|
||||
static_cast<void (ViewerWidget::*)(const QString&, const QString&, const QString&)>(&ViewerWidget::SetOCIOParameters));
|
||||
static_cast<void(ViewerWidget::*)(const QString&)>(&ViewerWidget::SetOCIODisplay));
|
||||
|
||||
// Set viewer to view the node
|
||||
preview_viewer_->ConnectViewerNode(viewer_node_);
|
||||
preview_viewer_->SetColorMenuEnabled(false);
|
||||
preview_viewer_->SetOCIOParameters(video_tab_->CurrentOCIODisplay(), video_tab_->CurrentOCIOView(), video_tab_->CurrentOCIOLook());
|
||||
preview_viewer_->SetOCIODisplay(video_tab_->CurrentOCIOColorSpace());
|
||||
|
||||
// Update renderer
|
||||
// FIXME: This is going to be VERY slow since it will need to hash every single frame. It would be better to have a
|
||||
@@ -312,9 +312,7 @@ void ExportDialog::accept()
|
||||
|
||||
ColorProcessorPtr color_processor = ColorProcessor::Create(color_manager_,
|
||||
color_manager_->GetReferenceColorSpace(),
|
||||
video_tab_->CurrentOCIODisplay(),
|
||||
video_tab_->CurrentOCIOView(),
|
||||
video_tab_->CurrentOCIOLook());
|
||||
video_tab_->CurrentOCIOColorSpace());
|
||||
|
||||
// Set up encoder
|
||||
EncodingParams encoding_params;
|
||||
|
||||
@@ -80,19 +80,9 @@ void ExportVideoTab::set_frame_rate(const rational &frame_rate)
|
||||
frame_rate_combobox_->setCurrentIndex(frame_rates_.indexOf(frame_rate));
|
||||
}
|
||||
|
||||
QString ExportVideoTab::CurrentOCIODisplay()
|
||||
QString ExportVideoTab::CurrentOCIOColorSpace()
|
||||
{
|
||||
return color_space_chooser_->display();
|
||||
}
|
||||
|
||||
QString ExportVideoTab::CurrentOCIOView()
|
||||
{
|
||||
return color_space_chooser_->view();
|
||||
}
|
||||
|
||||
QString ExportVideoTab::CurrentOCIOLook()
|
||||
{
|
||||
return color_space_chooser_->look();
|
||||
return color_space_chooser_->input();
|
||||
}
|
||||
|
||||
CodecSection *ExportVideoTab::GetCodecSection() const
|
||||
@@ -175,8 +165,8 @@ QWidget* ExportVideoTab::SetupResolutionSection()
|
||||
|
||||
QWidget* ExportVideoTab::SetupColorSection()
|
||||
{
|
||||
color_space_chooser_ = new ColorSpaceChooser(color_manager_, false);
|
||||
connect(color_space_chooser_, &ColorSpaceChooser::DisplayColorSpaceChanged, this, &ExportVideoTab::DisplayColorSpaceChanged);
|
||||
color_space_chooser_ = new ColorSpaceChooser(color_manager_, true, false);
|
||||
connect(color_space_chooser_, &ColorSpaceChooser::InputColorSpaceChanged, this, &ExportVideoTab::ColorSpaceChanged);
|
||||
return color_space_chooser_;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,9 +56,7 @@ public:
|
||||
const rational& frame_rate() const;
|
||||
void set_frame_rate(const rational& frame_rate);
|
||||
|
||||
QString CurrentOCIODisplay();
|
||||
QString CurrentOCIOView();
|
||||
QString CurrentOCIOLook();
|
||||
QString CurrentOCIOColorSpace();
|
||||
|
||||
CodecSection* GetCodecSection() const;
|
||||
void SetCodecSection(CodecSection* section);
|
||||
@@ -66,7 +64,7 @@ public:
|
||||
H264Section* h264_section() const;
|
||||
|
||||
signals:
|
||||
void DisplayColorSpaceChanged(const QString& display, const QString& view, const QString& look);
|
||||
void ColorSpaceChanged(const QString& colorspace);
|
||||
|
||||
private:
|
||||
QWidget* SetupResolutionSection();
|
||||
|
||||
@@ -467,11 +467,17 @@ void ViewerGLWidget::SetupColorProcessor()
|
||||
|
||||
try {
|
||||
|
||||
if (ocio_view_.isEmpty()) {
|
||||
color_service_ = OpenGLColorProcessor::Create(color_manager_,
|
||||
color_manager_->GetReferenceColorSpace(),
|
||||
ocio_display_);
|
||||
} else {
|
||||
color_service_ = OpenGLColorProcessor::Create(color_manager_,
|
||||
color_manager_->GetReferenceColorSpace(),
|
||||
ocio_display_,
|
||||
ocio_view_,
|
||||
ocio_look_);
|
||||
}
|
||||
|
||||
makeCurrent();
|
||||
color_service_->Enable(context(), true);
|
||||
|
||||
Reference in New Issue
Block a user