nodes: merged gizmotraverser and nodetabletraverser into nodetraverser

No real reason for these other derivatives that did virtually
the same thing.
This commit is contained in:
itsmattkc
2021-04-22 12:52:10 +10:00
parent 65a1922ed4
commit 97b9bcc79f
15 changed files with 65 additions and 336 deletions
+1 -13
View File
@@ -56,6 +56,7 @@ void RenderProcessor::Run()
{
ViewerOutput* viewer = Node::ValueToPtr<ViewerOutput>(ticket_->property("viewer"));
const VideoParams& video_params = ticket_->property("vparam").value<VideoParams>();
SetCacheVideoParams(video_params);
rational time = ticket_->property("time").value<rational>();
NodeValueTable table;
@@ -593,17 +594,4 @@ void RenderProcessor::SaveCachedTexture(const QByteArray &hash, const QVariant &
}*/
}
VideoParams RenderProcessor::GetCacheVideoParams()
{
return ticket_->property("vparam").value<VideoParams>();
}
QVector2D RenderProcessor::GenerateResolution() const
{
// Set resolution to the destination to the "logical" resolution of the destination
const VideoParams& video_params = ticket_->property("vparam").value<VideoParams>();
return QVector2D(video_params.width() * video_params.pixel_aspect_ratio().toDouble(),
video_params.height());
}
}
-4
View File
@@ -59,10 +59,6 @@ protected:
virtual void SaveCachedTexture(const QByteArray& hash, const QVariant& texture) override;
virtual VideoParams GetCacheVideoParams() override;
virtual QVector2D GenerateResolution() const override;
private:
RenderProcessor(RenderTicketPtr ticket, Renderer* render_ctx, StillImageCache* still_image_cache, DecoderCache* decoder_cache, ShaderCache* shader_cache, QVariant default_shader);
+11
View File
@@ -234,6 +234,7 @@ void VideoParams::calculate_effective_size()
effective_width_ = GetScaledDimension(width(), divider_);
effective_height_ = GetScaledDimension(height(), divider_);
effective_depth_ = GetScaledDimension(depth(), divider_);
calculate_square_pixel_width();
}
void VideoParams::validate_pixel_aspect_ratio()
@@ -241,6 +242,7 @@ void VideoParams::validate_pixel_aspect_ratio()
if (pixel_aspect_ratio_.isNull()) {
pixel_aspect_ratio_ = 1;
}
calculate_square_pixel_width();
}
void VideoParams::set_defaults_for_footage()
@@ -253,6 +255,15 @@ void VideoParams::set_defaults_for_footage()
premultiplied_alpha_ = false;
}
void VideoParams::calculate_square_pixel_width()
{
if (pixel_aspect_ratio_.denominator() != 0) {
par_width_ = width_ * pixel_aspect_ratio_.numerator() / pixel_aspect_ratio_.denominator();
} else {
par_width_ = width_;
}
}
bool VideoParams::is_valid() const
{
return (width() > 0
+11
View File
@@ -90,6 +90,14 @@ public:
calculate_effective_size();
}
/**
* @brief Returns width multiplied by pixel aspect ratio where applicable
*/
int square_pixel_width() const
{
return par_width_;
}
int height() const
{
return height_;
@@ -348,6 +356,8 @@ private:
void set_defaults_for_footage();
void calculate_square_pixel_width();
int width_;
int height_;
int depth_;
@@ -367,6 +377,7 @@ private:
int effective_width_;
int effective_height_;
int effective_depth_;
int par_width_;
bool enabled_;
int stream_index_;