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:
@@ -68,7 +68,7 @@ NodeValueTable TransformDistortNode::Value(const QString &output, NodeValueDatab
|
||||
if (texture) {
|
||||
// Adjust our matrix by the resolutions involved
|
||||
QVector2D sequence_res = value[QStringLiteral("global")].Get(NodeValue::kVec2, QStringLiteral("resolution")).value<QVector2D>();
|
||||
QVector2D texture_res(texture->params().width() * texture->pixel_aspect_ratio().toDouble(), texture->params().height());
|
||||
QVector2D texture_res(texture->params().square_pixel_width(), texture->params().height());
|
||||
AutoScaleType autoscale = static_cast<AutoScaleType>(value[kAutoscaleInput].Get(NodeValue::kCombo).toInt());
|
||||
|
||||
QMatrix4x4 real_matrix = AdjustMatrixByResolutions(generated_matrix,
|
||||
@@ -141,7 +141,8 @@ bool TransformDistortNode::GizmoPress(NodeValueDatabase &db, const QPointF &p)
|
||||
}
|
||||
|
||||
// Store texture size
|
||||
QVector2D texture_sz = db[kTextureInput].Get(NodeValue::kTexture).value<QVector2D>();
|
||||
VideoParams texture_params = db[kTextureInput].Get(NodeValue::kTexture).value<VideoParams>();
|
||||
QVector2D texture_sz(texture_params.square_pixel_width(), texture_params.height());
|
||||
gizmo_scale_anchor_ = db[kAnchorInput].Get(NodeValue::kVec2).value<QVector2D>() + texture_sz/2;
|
||||
|
||||
if (gizmo_scale_active[kGizmoScaleTopRight]
|
||||
@@ -372,7 +373,8 @@ void TransformDistortNode::DrawGizmos(NodeValueDatabase &db, QPainter *p)
|
||||
QPointF sequence_half_res_pt = sequence_half_res.toPointF();
|
||||
|
||||
// GizmoTraverser just returns the sizes of the textures and no other data
|
||||
QVector2D tex_sz = db[kTextureInput].Get(NodeValue::kTexture).value<QVector2D>();
|
||||
VideoParams tex_params = db[kTextureInput].Get(NodeValue::kTexture).value<VideoParams>();
|
||||
QVector2D tex_sz(tex_params.square_pixel_width(), tex_params.height());
|
||||
|
||||
// Retrieve autoscale value
|
||||
AutoScaleType autoscale = static_cast<AutoScaleType>(db[kAutoscaleInput].Get(NodeValue::kCombo).toInt());
|
||||
|
||||
@@ -132,10 +132,9 @@ NodeValueTable NodeTraverser::GenerateBlockTable(const Track *track, const TimeR
|
||||
|
||||
QVariant NodeTraverser::ProcessVideoFootage(const FootageJob &stream, const rational &input_time)
|
||||
{
|
||||
Q_UNUSED(stream)
|
||||
Q_UNUSED(input_time)
|
||||
|
||||
return QVariant();
|
||||
return QVariant::fromValue(stream.video_params());
|
||||
}
|
||||
|
||||
QVariant NodeTraverser::ProcessAudioFootage(const FootageJob& stream, const TimeRange &input_time)
|
||||
@@ -152,7 +151,7 @@ QVariant NodeTraverser::ProcessShader(const Node *node, const TimeRange &range,
|
||||
Q_UNUSED(range)
|
||||
Q_UNUSED(job)
|
||||
|
||||
return QVariant();
|
||||
return QVariant::fromValue(video_params_);
|
||||
}
|
||||
|
||||
QVariant NodeTraverser::ProcessSamples(const Node *node, const TimeRange &range, const SampleJob &job)
|
||||
@@ -169,7 +168,7 @@ QVariant NodeTraverser::ProcessFrameGeneration(const Node *node, const GenerateJ
|
||||
Q_UNUSED(node)
|
||||
Q_UNUSED(job)
|
||||
|
||||
return QVariant();
|
||||
return QVariant::fromValue(video_params_);
|
||||
}
|
||||
|
||||
void NodeTraverser::SaveCachedTexture(const QByteArray &hash, const QVariant &texture)
|
||||
@@ -196,6 +195,11 @@ void NodeTraverser::AddGlobalsToDatabase(NodeValueDatabase &db, const TimeRange&
|
||||
db.Insert(QStringLiteral("global"), global);
|
||||
}
|
||||
|
||||
QVector2D NodeTraverser::GenerateResolution() const
|
||||
{
|
||||
return QVector2D(video_params_.square_pixel_width(), video_params_.height());
|
||||
}
|
||||
|
||||
void NodeTraverser::PostProcessTable(const Node *node, const QString& output, const TimeRange &range, NodeValueTable &output_params)
|
||||
{
|
||||
bool got_cached_frame = false;
|
||||
|
||||
+13
-9
@@ -44,6 +44,16 @@ public:
|
||||
|
||||
NodeValueDatabase GenerateDatabase(const Node *node, const QString &output, const TimeRange &range);
|
||||
|
||||
const VideoParams& GetCacheVideoParams() const
|
||||
{
|
||||
return video_params_;
|
||||
}
|
||||
|
||||
void SetCacheVideoParams(const VideoParams& params)
|
||||
{
|
||||
video_params_ = params;
|
||||
}
|
||||
|
||||
protected:
|
||||
NodeValueTable ProcessInput(const Node *node, const QString &input, const TimeRange &range);
|
||||
|
||||
@@ -68,21 +78,15 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual VideoParams GetCacheVideoParams()
|
||||
{
|
||||
return VideoParams();
|
||||
}
|
||||
|
||||
void AddGlobalsToDatabase(NodeValueDatabase& db, const TimeRange &range) const;
|
||||
|
||||
virtual QVector2D GenerateResolution() const
|
||||
{
|
||||
return QVector2D(0, 0);
|
||||
}
|
||||
QVector2D GenerateResolution() const;
|
||||
|
||||
private:
|
||||
void PostProcessTable(const Node *node, const QString &output, const TimeRange &range, NodeValueTable &output_params);
|
||||
|
||||
VideoParams video_params_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user