completed color management implementation
This commit adds the background functionality of the render cache invalidating whenever a footage's color space is changed. This includes when the project's configuration is changed as well.
This commit is contained in:
@@ -20,10 +20,13 @@
|
||||
|
||||
#include "media.h"
|
||||
|
||||
MediaInput::MediaInput()
|
||||
MediaInput::MediaInput() :
|
||||
connected_footage_(nullptr)
|
||||
{
|
||||
footage_input_ = new NodeInput("footage_in");
|
||||
footage_input_->set_data_type(NodeInput::kFootage);
|
||||
footage_input_->SetConnectable(false);
|
||||
connect(footage_input_, SIGNAL(ValueChanged(const rational&, const rational&)), this, SLOT(FootageChanged()));
|
||||
AddInput(footage_input_);
|
||||
}
|
||||
|
||||
@@ -41,3 +44,27 @@ void MediaInput::Retranslate()
|
||||
{
|
||||
footage_input_->set_name(tr("Footage"));
|
||||
}
|
||||
|
||||
void MediaInput::FootageChanged()
|
||||
{
|
||||
StreamPtr new_footage = footage_input_->get_value_at_time(0).value<StreamPtr>();
|
||||
|
||||
if (new_footage == connected_footage_) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (connected_footage_ != nullptr) {
|
||||
disconnect(connected_footage_.get(), SIGNAL(ColorSpaceChanged()), this, SLOT(FootageColorSpaceChanged()));
|
||||
}
|
||||
|
||||
connected_footage_ = new_footage;
|
||||
|
||||
if (connected_footage_ != nullptr) {
|
||||
connect(connected_footage_.get(), SIGNAL(ColorSpaceChanged()), this, SLOT(FootageColorSpaceChanged()));
|
||||
}
|
||||
}
|
||||
|
||||
void MediaInput::FootageColorSpaceChanged()
|
||||
{
|
||||
InvalidateCache(0, RATIONAL_MAX, footage_input_);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,13 @@ public:
|
||||
protected:
|
||||
NodeInput* footage_input_;
|
||||
|
||||
StreamPtr connected_footage_;
|
||||
|
||||
private slots:
|
||||
void FootageChanged();
|
||||
|
||||
void FootageColorSpaceChanged();
|
||||
|
||||
};
|
||||
|
||||
#endif // MEDIAINPUT_H
|
||||
|
||||
Reference in New Issue
Block a user