colorpicker: implemented color management
Also moves some items to ColorManager from Project for better accessibility and re-uses some widgets in ExportDialog for improved code.
This commit is contained in:
@@ -177,9 +177,10 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, QWidget *parent) :
|
||||
connect(video_tab_->scaling_method_combobox(), SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateViewerDimensions()));
|
||||
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_, SIGNAL(DisplayChanged(const QString&)), preview_viewer_, SLOT(SetOCIODisplay(const QString&)));
|
||||
connect(video_tab_, SIGNAL(ViewChanged(const QString&)), preview_viewer_, SLOT(SetOCIOView(const QString&)));
|
||||
connect(video_tab_, SIGNAL(LookChanged(const QString&)), preview_viewer_, SLOT(SetOCIOLook(const QString&)));
|
||||
connect(video_tab_,
|
||||
&ExportVideoTab::DisplayColorSpaceChanged,
|
||||
preview_viewer_,
|
||||
static_cast<void (ViewerWidget::*)(const QString&, const QString&, const QString&)>(&ViewerWidget::SetOCIOParameters));
|
||||
|
||||
// Set viewer to view the node
|
||||
preview_viewer_->ConnectViewerNode(viewer_node_);
|
||||
|
||||
@@ -60,17 +60,17 @@ void ExportVideoTab::set_frame_rate(const rational &frame_rate)
|
||||
|
||||
QString ExportVideoTab::CurrentOCIODisplay()
|
||||
{
|
||||
return display_combobox_->currentData().toString();
|
||||
return color_space_chooser_->display();
|
||||
}
|
||||
|
||||
QString ExportVideoTab::CurrentOCIOView()
|
||||
{
|
||||
return views_combobox_->currentData().toString();
|
||||
return color_space_chooser_->view();
|
||||
}
|
||||
|
||||
QString ExportVideoTab::CurrentOCIOLook()
|
||||
{
|
||||
return looks_combobox_->currentData().toString();
|
||||
return color_space_chooser_->look();
|
||||
}
|
||||
|
||||
CodecSection *ExportVideoTab::GetCodecSection() const
|
||||
@@ -153,47 +153,9 @@ QWidget* ExportVideoTab::SetupResolutionSection()
|
||||
|
||||
QWidget* ExportVideoTab::SetupColorSection()
|
||||
{
|
||||
int row = 0;
|
||||
|
||||
QGroupBox* color_group = new QGroupBox();
|
||||
color_group->setTitle(tr("Color Management"));
|
||||
|
||||
QGridLayout* color_layout = new QGridLayout(color_group);
|
||||
|
||||
color_layout->addWidget(new QLabel(tr("Display:")), row, 0);
|
||||
|
||||
QStringList displays = color_manager_->ListAvailableDisplays();
|
||||
display_combobox_ = new QComboBox();
|
||||
foreach (const QString& display, displays) {
|
||||
display_combobox_->addItem(display, display);
|
||||
}
|
||||
connect(display_combobox_, SIGNAL(currentIndexChanged(int)), this, SLOT(ColorDisplayChanged()));
|
||||
color_layout->addWidget(display_combobox_, row, 1);
|
||||
|
||||
row++;
|
||||
|
||||
views_combobox_ = new QComboBox();
|
||||
color_layout->addWidget(new QLabel(tr("View:")), row, 0);
|
||||
color_layout->addWidget(views_combobox_, row, 1);
|
||||
connect(views_combobox_, SIGNAL(currentIndexChanged(int)), this, SLOT(ColorViewChanged()));
|
||||
|
||||
row++;
|
||||
|
||||
QStringList looks = color_manager_->ListAvailableLooks();
|
||||
looks_combobox_ = new QComboBox();
|
||||
looks_combobox_->addItem(tr("(None)"), QString());
|
||||
foreach (const QString& look, looks) {
|
||||
looks_combobox_->addItem(look, look);
|
||||
}
|
||||
connect(looks_combobox_, SIGNAL(currentIndexChanged(int)), this, SLOT(ColorLookChanged()));
|
||||
color_layout->addWidget(new QLabel(tr("Look:")), row, 0);
|
||||
color_layout->addWidget(looks_combobox_, row, 1);
|
||||
|
||||
row++;
|
||||
|
||||
ColorDisplayChanged();
|
||||
|
||||
return color_group;
|
||||
color_space_chooser_ = new ColorSpaceChooser(color_manager_, false);
|
||||
connect(color_space_chooser_, &ColorSpaceChooser::DisplayColorSpaceChanged, this, &ExportVideoTab::DisplayColorSpaceChanged);
|
||||
return color_space_chooser_;
|
||||
}
|
||||
|
||||
QWidget *ExportVideoTab::SetupCodecSection()
|
||||
@@ -224,28 +186,6 @@ QWidget *ExportVideoTab::SetupCodecSection()
|
||||
return codec_group;
|
||||
}
|
||||
|
||||
void ExportVideoTab::ColorDisplayChanged()
|
||||
{
|
||||
views_combobox_->clear();
|
||||
|
||||
QStringList views = color_manager_->ListAvailableViews(display_combobox_->currentData().toString());
|
||||
foreach (const QString& view, views) {
|
||||
views_combobox_->addItem(view, view);
|
||||
}
|
||||
|
||||
emit DisplayChanged(display_combobox_->currentData().toString());
|
||||
}
|
||||
|
||||
void ExportVideoTab::ColorViewChanged()
|
||||
{
|
||||
emit ViewChanged(views_combobox_->currentData().toString());
|
||||
}
|
||||
|
||||
void ExportVideoTab::ColorLookChanged()
|
||||
{
|
||||
emit LookChanged(looks_combobox_->currentData().toString());
|
||||
}
|
||||
|
||||
void ExportVideoTab::MaintainAspectRatioChanged(bool val)
|
||||
{
|
||||
scaling_method_combobox_->setEnabled(!val);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include "common/rational.h"
|
||||
#include "dialog/color/colorspacechooser.h"
|
||||
#include "dialog/export/codec/h264section.h"
|
||||
#include "dialog/export/codec/imagesection.h"
|
||||
#include "render/colormanager.h"
|
||||
@@ -43,9 +44,7 @@ public:
|
||||
H264Section* h264_section() const;
|
||||
|
||||
signals:
|
||||
void DisplayChanged(const QString& display);
|
||||
void ViewChanged(const QString& view);
|
||||
void LookChanged(const QString& look);
|
||||
void DisplayColorSpaceChanged(const QString& display, const QString& view, const QString& look);
|
||||
|
||||
private:
|
||||
QWidget* SetupResolutionSection();
|
||||
@@ -61,22 +60,16 @@ private:
|
||||
ImageSection* image_section_;
|
||||
H264Section* h264_section_;
|
||||
|
||||
ColorSpaceChooser* color_space_chooser_;
|
||||
|
||||
IntegerSlider* width_slider_;
|
||||
IntegerSlider* height_slider_;
|
||||
|
||||
QComboBox* display_combobox_;
|
||||
QComboBox* views_combobox_;
|
||||
QComboBox* looks_combobox_;
|
||||
|
||||
QList<rational> frame_rates_;
|
||||
|
||||
ColorManager* color_manager_;
|
||||
|
||||
private slots:
|
||||
void ColorDisplayChanged();
|
||||
void ColorViewChanged();
|
||||
void ColorLookChanged();
|
||||
|
||||
void MaintainAspectRatioChanged(bool val);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user