From b88e15b8cf2e1fd7320c6bdfba2ef197065e56bb Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 9 May 2022 15:16:46 -0700 Subject: [PATCH] accleratedjob: simplified function calls --- .../diptocolor/diptocolortransition.cpp | 2 +- app/node/block/transition/transition.cpp | 12 +++++------ .../ociogradingtransformlinear.cpp | 12 +++++------ .../cornerpin/cornerpindistortnode.cpp | 16 +++++++-------- app/node/distort/crop/cropdistortnode.cpp | 16 +++++++-------- app/node/distort/flip/flipdistortnode.cpp | 8 ++++---- app/node/distort/mask/mask.cpp | 20 +++++++++---------- .../transform/transformdistortnode.cpp | 4 ++-- app/node/effect/opacity/opacityeffect.cpp | 8 ++++---- app/node/filter/blur/blur.cpp | 18 ++++++++--------- app/node/filter/mosaic/mosaicfilternode.cpp | 12 +++++------ app/node/filter/stroke/stroke.cpp | 12 +++++------ app/node/generator/noise/noise.cpp | 4 ++-- app/node/generator/polygon/polygon.cpp | 6 +++--- .../generator/shape/generatorwithmerge.cpp | 4 ++-- app/node/generator/shape/shapenode.cpp | 4 ++-- app/node/generator/solid/solid.cpp | 2 +- app/node/generator/text/textv1.cpp | 16 +++++++-------- app/node/generator/text/textv2.cpp | 20 +++++++++---------- app/node/generator/text/textv3.cpp | 10 +++++----- app/node/keying/chromakey/chromakey.cpp | 2 +- .../colordifferencekey/colordifferencekey.cpp | 4 ++-- app/node/keying/despill/despill.cpp | 6 +++--- app/node/math/math/mathbase.cpp | 8 ++++---- app/node/math/merge/merge.cpp | 10 +++++----- app/render/job/acceleratedjob.h | 8 ++++---- app/render/opengl/openglrenderer.cpp | 2 +- app/render/renderer.cpp | 20 +++++++++---------- app/render/renderprocessor.cpp | 4 ++-- app/widget/scope/histogram/histogram.cpp | 10 +++++----- app/widget/scope/scopebase/scopebase.cpp | 2 +- app/widget/scope/waveform/waveform.cpp | 8 ++++---- app/widget/viewer/viewerdisplay.cpp | 8 ++++---- 33 files changed, 149 insertions(+), 149 deletions(-) diff --git a/app/node/block/transition/diptocolor/diptocolortransition.cpp b/app/node/block/transition/diptocolor/diptocolortransition.cpp index dd49ea8b3..8700c3628 100644 --- a/app/node/block/transition/diptocolor/diptocolortransition.cpp +++ b/app/node/block/transition/diptocolor/diptocolortransition.cpp @@ -58,7 +58,7 @@ ShaderCode DipToColorTransition::GetShaderCode(const ShaderRequest &request) con void DipToColorTransition::ShaderJobEvent(const NodeValueRow &value, ShaderJob &job) const { - job.InsertValue(kColorInput, value); + job.Insert(kColorInput, value); } } diff --git a/app/node/block/transition/transition.cpp b/app/node/block/transition/transition.cpp index 5a3ade0d8..38b956ad4 100644 --- a/app/node/block/transition/transition.cpp +++ b/app/node/block/transition/transition.cpp @@ -162,15 +162,15 @@ double TransitionBlock::GetInternalTransitionTime(const double &time) const void TransitionBlock::InsertTransitionTimes(AcceleratedJob *job, const double &time) const { // Provides total transition progress from 0.0 (start) - 1.0 (end) - job->InsertValue(QStringLiteral("ove_tprog_all"), + job->Insert(QStringLiteral("ove_tprog_all"), NodeValue(NodeValue::kFloat, GetTotalProgress(time), this)); // Provides progress of out section from 1.0 (start) - 0.0 (end) - job->InsertValue(QStringLiteral("ove_tprog_out"), + job->Insert(QStringLiteral("ove_tprog_out"), NodeValue(NodeValue::kFloat, GetOutProgress(time), this)); // Provides progress of in section from 0.0 (start) - 1.0 (end) - job->InsertValue(QStringLiteral("ove_tprog_in"), + job->Insert(QStringLiteral("ove_tprog_in"), NodeValue(NodeValue::kFloat, GetInProgress(time), this)); } @@ -188,14 +188,14 @@ void TransitionBlock::Value(const NodeValueRow &value, const NodeGlobals &global ShaderJob job; if (out_buffer.type() != NodeValue::kNone) { - job.InsertValue(kOutBlockInput, out_buffer); + job.Insert(kOutBlockInput, out_buffer); } if (in_buffer.type() != NodeValue::kNone) { - job.InsertValue(kInBlockInput, in_buffer); + job.Insert(kInBlockInput, in_buffer); } - job.InsertValue(kCurveInput, value); + job.Insert(kCurveInput, value); double time = globals.time().in().toDouble(); InsertTransitionTimes(&job, time); diff --git a/app/node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp b/app/node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp index ba2ab8e1c..5aa6ee8dc 100644 --- a/app/node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp +++ b/app/node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp @@ -161,7 +161,7 @@ void OCIOGradingTransformLinearNode::Value(const NodeValueRow &value, const Node job.SetColorProcessor(processor()); job.SetInputTexture(value[kTextureInput].toTexture()); - job.InsertValue(value); + job.Insert(value); const int MASTER_CHANNEL = 0; const int RED_CHANNEL = 1; @@ -176,26 +176,26 @@ void OCIOGradingTransformLinearNode::Value(const NodeValueRow &value, const Node offset[RED_CHANNEL] += offset[MASTER_CHANNEL]; offset[GREEN_CHANNEL] += offset[MASTER_CHANNEL]; offset[BLUE_CHANNEL] += offset[MASTER_CHANNEL]; - job.InsertValue(kOffsetInput, NodeValue(NodeValue::kVec3, QVector3D(offset[RED_CHANNEL], offset[GREEN_CHANNEL], offset[BLUE_CHANNEL]))); + job.Insert(kOffsetInput, NodeValue(NodeValue::kVec3, QVector3D(offset[RED_CHANNEL], offset[GREEN_CHANNEL], offset[BLUE_CHANNEL]))); QVector4D exposure = value[kExposureInput].toVec4(); exposure[RED_CHANNEL] = std::pow(2.0f, exposure[MASTER_CHANNEL] + exposure[RED_CHANNEL]); exposure[GREEN_CHANNEL] = std::pow(2.0f, exposure[MASTER_CHANNEL] + exposure[GREEN_CHANNEL]); exposure[BLUE_CHANNEL] = std::pow(2.0f, exposure[MASTER_CHANNEL] + exposure[BLUE_CHANNEL]); - job.InsertValue(kExposureInput, NodeValue(NodeValue::kVec3, QVector3D(exposure[RED_CHANNEL], exposure[GREEN_CHANNEL], exposure[BLUE_CHANNEL]))); + job.Insert(kExposureInput, NodeValue(NodeValue::kVec3, QVector3D(exposure[RED_CHANNEL], exposure[GREEN_CHANNEL], exposure[BLUE_CHANNEL]))); QVector4D contrast = value[kContrastInput].toVec4(); contrast[RED_CHANNEL] *= contrast[MASTER_CHANNEL]; contrast[GREEN_CHANNEL] *= contrast[MASTER_CHANNEL]; contrast[BLUE_CHANNEL] *= contrast[MASTER_CHANNEL]; - job.InsertValue(kContrastInput, NodeValue(NodeValue::kVec3, QVector3D(contrast[RED_CHANNEL], contrast[GREEN_CHANNEL], contrast[BLUE_CHANNEL]))); + job.Insert(kContrastInput, NodeValue(NodeValue::kVec3, QVector3D(contrast[RED_CHANNEL], contrast[GREEN_CHANNEL], contrast[BLUE_CHANNEL]))); if (!value[kClampBlackEnableInput].toBool()) { - job.InsertValue(kClampBlackInput, NodeValue(NodeValue::kFloat, OCIO::GradingPrimary::NoClampBlack())); + job.Insert(kClampBlackInput, NodeValue(NodeValue::kFloat, OCIO::GradingPrimary::NoClampBlack())); } if (!value[kClampWhiteEnableInput].toBool()) { - job.InsertValue(kClampWhiteInput, NodeValue(NodeValue::kFloat, OCIO::GradingPrimary::NoClampWhite())); + job.Insert(kClampWhiteInput, NodeValue(NodeValue::kFloat, OCIO::GradingPrimary::NoClampWhite())); } table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); diff --git a/app/node/distort/cornerpin/cornerpindistortnode.cpp b/app/node/distort/cornerpin/cornerpindistortnode.cpp index f7500505b..62015df1a 100644 --- a/app/node/distort/cornerpin/cornerpindistortnode.cpp +++ b/app/node/distort/cornerpin/cornerpindistortnode.cpp @@ -70,9 +70,9 @@ void CornerPinDistortNode::Retranslate() void CornerPinDistortNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { ShaderJob job; - job.InsertValue(value); + job.Insert(value); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); - job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); + job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); // Convert slider values to their pixel values and then convert to clip space (-1.0 ... 1.0) for overriding the // vertex coordinates. @@ -94,16 +94,16 @@ void CornerPinDistortNode::Value(const NodeValueRow &value, const NodeGlobals &g job.SetVertexCoordinates(adjusted_vertices); // If no texture do nothing - if (job.GetValue(kTextureInput).toTexture()) { + if (job.Get(kTextureInput).toTexture()) { // In the special case that all sliders are in their default position just // push the texture. - if (!(job.GetValue(kTopLeftInput).toVec2().isNull() - && job.GetValue(kTopRightInput).toVec2().isNull() && - job.GetValue(kBottomRightInput).toVec2().isNull() && - job.GetValue(kBottomLeftInput).toVec2().isNull())) { + if (!(job.Get(kTopLeftInput).toVec2().isNull() + && job.Get(kTopRightInput).toVec2().isNull() && + job.Get(kBottomRightInput).toVec2().isNull() && + job.Get(kBottomLeftInput).toVec2().isNull())) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } else { - table->Push(job.GetValue(kTextureInput)); + table->Push(job.Get(kTextureInput)); } } } diff --git a/app/node/distort/crop/cropdistortnode.cpp b/app/node/distort/crop/cropdistortnode.cpp index 05b487abd..62532f839 100644 --- a/app/node/distort/crop/cropdistortnode.cpp +++ b/app/node/distort/crop/cropdistortnode.cpp @@ -78,18 +78,18 @@ void CropDistortNode::Retranslate() void CropDistortNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { ShaderJob job; - job.InsertValue(value); - job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); + job.Insert(value); + job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); - if (job.GetValue(kTextureInput).toTexture()) { - if (!qIsNull(job.GetValue(kLeftInput).toDouble()) - || !qIsNull(job.GetValue(kRightInput).toDouble()) - || !qIsNull(job.GetValue(kTopInput).toDouble()) - || !qIsNull(job.GetValue(kBottomInput).toDouble())) { + if (job.Get(kTextureInput).toTexture()) { + if (!qIsNull(job.Get(kLeftInput).toDouble()) + || !qIsNull(job.Get(kRightInput).toDouble()) + || !qIsNull(job.Get(kTopInput).toDouble()) + || !qIsNull(job.Get(kBottomInput).toDouble())) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } else { - table->Push(job.GetValue(kTextureInput)); + table->Push(job.Get(kTextureInput)); } } } diff --git a/app/node/distort/flip/flipdistortnode.cpp b/app/node/distort/flip/flipdistortnode.cpp index efd9ad75f..050bbcc84 100644 --- a/app/node/distort/flip/flipdistortnode.cpp +++ b/app/node/distort/flip/flipdistortnode.cpp @@ -79,16 +79,16 @@ void FlipDistortNode::Value(const NodeValueRow &value, const NodeGlobals &global { ShaderJob job; - job.InsertValue(value); + job.Insert(value); // If there's no texture, no need to run an operation - if (job.GetValue(kTextureInput).toTexture()) { + if (job.Get(kTextureInput).toTexture()) { // Only run shader if at least one of flip or flop are selected - if (job.GetValue(kHorizontalInput).toBool() || job.GetValue(kVerticalInput).toBool()) { + if (job.Get(kHorizontalInput).toBool() || job.Get(kVerticalInput).toBool()) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } else { // If we're not flipping or flopping just push the texture - table->Push(job.GetValue(kTextureInput)); + table->Push(job.Get(kTextureInput)); } } diff --git a/app/node/distort/mask/mask.cpp b/app/node/distort/mask/mask.cpp index ab510068d..b891a262d 100644 --- a/app/node/distort/mask/mask.cpp +++ b/app/node/distort/mask/mask.cpp @@ -65,26 +65,26 @@ void MaskDistortNode::Value(const NodeValueRow &value, const NodeGlobals &global ShaderJob merge; merge.SetShaderID(QStringLiteral("mrg")); - merge.InsertValue(QStringLiteral("tex_a"), value[kBaseInput]); + merge.Insert(QStringLiteral("tex_a"), value[kBaseInput]); if (value[kFeatherInput].toDouble() > 0.0) { // Nest a blur shader in there too ShaderJob feather; feather.SetShaderID(QStringLiteral("feather")); - feather.InsertValue(BlurFilterNode::kTextureInput, NodeValue(NodeValue::kTexture, job, this)); - feather.InsertValue(BlurFilterNode::kMethodInput, NodeValue(NodeValue::kInt, int(BlurFilterNode::kGaussian), this)); - feather.InsertValue(BlurFilterNode::kHorizInput, NodeValue(NodeValue::kBoolean, true, this)); - feather.InsertValue(BlurFilterNode::kVertInput, NodeValue(NodeValue::kBoolean, true, this)); - feather.InsertValue(BlurFilterNode::kRepeatEdgePixelsInput, NodeValue(NodeValue::kBoolean, true, this)); - feather.InsertValue(BlurFilterNode::kRadiusInput, NodeValue(NodeValue::kFloat, value[kFeatherInput].toDouble(), this)); + feather.Insert(BlurFilterNode::kTextureInput, NodeValue(NodeValue::kTexture, job, this)); + feather.Insert(BlurFilterNode::kMethodInput, NodeValue(NodeValue::kInt, int(BlurFilterNode::kGaussian), this)); + feather.Insert(BlurFilterNode::kHorizInput, NodeValue(NodeValue::kBoolean, true, this)); + feather.Insert(BlurFilterNode::kVertInput, NodeValue(NodeValue::kBoolean, true, this)); + feather.Insert(BlurFilterNode::kRepeatEdgePixelsInput, NodeValue(NodeValue::kBoolean, true, this)); + feather.Insert(BlurFilterNode::kRadiusInput, NodeValue(NodeValue::kFloat, value[kFeatherInput].toDouble(), this)); feather.SetIterations(2, BlurFilterNode::kTextureInput); - feather.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); + feather.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); feather.SetAlphaChannelRequired(ShaderJob::kAlphaForceOn); - merge.InsertValue(QStringLiteral("tex_b"), NodeValue(NodeValue::kTexture, feather, this)); + merge.Insert(QStringLiteral("tex_b"), NodeValue(NodeValue::kTexture, feather, this)); } else { - merge.InsertValue(QStringLiteral("tex_b"), NodeValue(NodeValue::kTexture, job, this)); + merge.Insert(QStringLiteral("tex_b"), NodeValue(NodeValue::kTexture, job, this)); } table->Push(NodeValue::kTexture, QVariant::fromValue(merge), this); diff --git a/app/node/distort/transform/transformdistortnode.cpp b/app/node/distort/transform/transformdistortnode.cpp index cc98174e7..093808738 100644 --- a/app/node/distort/transform/transformdistortnode.cpp +++ b/app/node/distort/transform/transformdistortnode.cpp @@ -99,8 +99,8 @@ void TransformDistortNode::Value(const NodeValueRow &value, const NodeGlobals &g if (!real_matrix.isIdentity()) { // The matrix will transform things ShaderJob job; - job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture), this)); - job.InsertValue(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, real_matrix, this)); + job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture), this)); + job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, real_matrix, this)); job.SetInterpolation(QStringLiteral("ove_maintex"), static_cast(value[kInterpolationInput].toInt())); // FIXME: This should be optimized, we can use matrix math to determine if this operation will diff --git a/app/node/effect/opacity/opacityeffect.cpp b/app/node/effect/opacity/opacityeffect.cpp index 334641174..9ebabbc20 100644 --- a/app/node/effect/opacity/opacityeffect.cpp +++ b/app/node/effect/opacity/opacityeffect.cpp @@ -47,16 +47,16 @@ void OpacityEffect::Value(const NodeValueRow &value, const NodeGlobals &globals, { ShaderJob job; - job.InsertValue(value); + job.Insert(value); // If there's no texture, no need to run an operation - if (job.GetValue(kTextureInput).toTexture()) { - if (!qFuzzyCompare(job.GetValue(kValueInput).toDouble(), 1.0)) { + if (job.Get(kTextureInput).toTexture()) { + if (!qFuzzyCompare(job.Get(kValueInput).toDouble(), 1.0)) { job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } else { // 1.0 float is a no-op, so just push the texture - table->Push(job.GetValue(kTextureInput)); + table->Push(job.Get(kTextureInput)); } } } diff --git a/app/node/filter/blur/blur.cpp b/app/node/filter/blur/blur.cpp index 86f950893..6b822cf43 100644 --- a/app/node/filter/blur/blur.cpp +++ b/app/node/filter/blur/blur.cpp @@ -121,25 +121,25 @@ void BlurFilterNode::Value(const NodeValueRow &value, const NodeGlobals &globals { ShaderJob job; - job.InsertValue(value); - job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); + job.Insert(value); + job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); - Method method = static_cast(job.GetValue(kMethodInput).toInt()); + Method method = static_cast(job.Get(kMethodInput).toInt()); // If there's no texture, no need to run an operation - if (job.GetValue(kTextureInput).toTexture()) { + if (job.Get(kTextureInput).toTexture()) { bool can_push_job = true; // Check if radius is > 0 - if (job.GetValue(kRadiusInput).toDouble() > 0.0) { + if (job.Get(kRadiusInput).toDouble() > 0.0) { // Method-specific considerations switch (method) { case kBox: case kGaussian: { - bool horiz = job.GetValue(kHorizInput).toBool(); - bool vert = job.GetValue(kVertInput).toBool(); + bool horiz = job.Get(kHorizInput).toBool(); + bool vert = job.Get(kVertInput).toBool(); if (!horiz && !vert) { // Disable job if horiz and vert are unchecked @@ -160,14 +160,14 @@ void BlurFilterNode::Value(const NodeValueRow &value, const NodeGlobals &globals if (can_push_job) { // If we're not repeating pixels, expect an alpha channel to appear - if (!job.GetValue(kRepeatEdgePixelsInput).toBool()) { + if (!job.Get(kRepeatEdgePixelsInput).toBool()) { job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); } table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } else { // If we're not performing the blur job, just push the texture - table->Push(job.GetValue(kTextureInput)); + table->Push(job.Get(kTextureInput)); } } diff --git a/app/node/filter/mosaic/mosaicfilternode.cpp b/app/node/filter/mosaic/mosaicfilternode.cpp index 31a14f28f..cf80a2139 100644 --- a/app/node/filter/mosaic/mosaicfilternode.cpp +++ b/app/node/filter/mosaic/mosaicfilternode.cpp @@ -55,20 +55,20 @@ void MosaicFilterNode::Value(const NodeValueRow &value, const NodeGlobals &globa { ShaderJob job; - job.InsertValue(value); + job.Insert(value); // Mipmapping makes this look weird, so we just use bilinear for finding the color of each block job.SetInterpolation(kTextureInput, Texture::kLinear); - if (job.GetValue(kTextureInput).toTexture()) { - TexturePtr texture = job.GetValue(kTextureInput).toTexture(); + if (job.Get(kTextureInput).toTexture()) { + TexturePtr texture = job.Get(kTextureInput).toTexture(); if (texture - && job.GetValue(kHorizInput).toInt() != texture->width() - && job.GetValue(kVertInput).toInt() != texture->height()) { + && job.Get(kHorizInput).toInt() != texture->width() + && job.Get(kVertInput).toInt() != texture->height()) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } else { - table->Push(job.GetValue(kTextureInput)); + table->Push(job.Get(kTextureInput)); } } } diff --git a/app/node/filter/stroke/stroke.cpp b/app/node/filter/stroke/stroke.cpp index 32996ea9b..f3edea14e 100644 --- a/app/node/filter/stroke/stroke.cpp +++ b/app/node/filter/stroke/stroke.cpp @@ -88,15 +88,15 @@ void StrokeFilterNode::Value(const NodeValueRow &value, const NodeGlobals &globa { ShaderJob job; - job.InsertValue(value); - job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); + job.Insert(value); + job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); - if (job.GetValue(kTextureInput).toTexture()) { - if (job.GetValue(kRadiusInput).toDouble() > 0.0 - && job.GetValue(kOpacityInput).toDouble() > 0.0) { + if (job.Get(kTextureInput).toTexture()) { + if (job.Get(kRadiusInput).toDouble() > 0.0 + && job.Get(kOpacityInput).toDouble() > 0.0) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } else { - table->Push(job.GetValue(kTextureInput)); + table->Push(job.Get(kTextureInput)); } } } diff --git a/app/node/generator/noise/noise.cpp b/app/node/generator/noise/noise.cpp index 09dfaabd3..dff259996 100644 --- a/app/node/generator/noise/noise.cpp +++ b/app/node/generator/noise/noise.cpp @@ -82,8 +82,8 @@ void NoiseGeneratorNode::Value(const NodeValueRow &value, const NodeGlobals &glo { ShaderJob job; - job.InsertValue(value); - job.InsertValue(QStringLiteral("time_in"), NodeValue(NodeValue::kFloat, globals.time().in().toDouble(), this)); + job.Insert(value); + job.Insert(QStringLiteral("time_in"), NodeValue(NodeValue::kFloat, globals.time().in().toDouble(), this)); table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } diff --git a/app/node/generator/polygon/polygon.cpp b/app/node/generator/polygon/polygon.cpp index 412299df1..9677799af 100644 --- a/app/node/generator/polygon/polygon.cpp +++ b/app/node/generator/polygon/polygon.cpp @@ -93,7 +93,7 @@ GenerateJob PolygonGenerator::GetGenerateJob(const NodeValueRow &value) const { GenerateJob job; - job.InsertValue(value); + job.Insert(value); job.SetRequestedFormat(VideoParams::kFormatFloat32); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); @@ -116,7 +116,7 @@ void PolygonGenerator::GenerateFrame(FramePtr frame, const GenerateJob &job) con QImage img(frame->width(), frame->height(), QImage::Format_Grayscale8); img.fill(Qt::transparent); - QVector points = job.GetValue(kPointsInput).value< QVector >(); + QVector points = job.Get(kPointsInput).value< QVector >(); QPainterPath path = GeneratePath(points); @@ -130,7 +130,7 @@ void PolygonGenerator::GenerateFrame(FramePtr frame, const GenerateJob &job) con p.drawPath(path); // Transplant alpha channel to frame - Color rgba = job.GetValue(kColorInput).toColor(); + Color rgba = job.Get(kColorInput).toColor(); #if defined(Q_PROCESSOR_X86) || defined(Q_PROCESSOR_ARM) __m128 sse_color = _mm_loadu_ps(rgba.data()); #endif diff --git a/app/node/generator/shape/generatorwithmerge.cpp b/app/node/generator/shape/generatorwithmerge.cpp index 47ae76e88..3e36c9229 100644 --- a/app/node/generator/shape/generatorwithmerge.cpp +++ b/app/node/generator/shape/generatorwithmerge.cpp @@ -58,8 +58,8 @@ void GeneratorWithMerge::PushMergableJob(const NodeValueRow &value, const QVaria ShaderJob merge; merge.SetShaderID(QStringLiteral("mrg")); - merge.InsertValue(MergeNode::kBaseIn, value[kBaseInput]); - merge.InsertValue(MergeNode::kBlendIn, NodeValue(NodeValue::kTexture, job, this)); + merge.Insert(MergeNode::kBaseIn, value[kBaseInput]); + merge.Insert(MergeNode::kBlendIn, NodeValue(NodeValue::kTexture, job, this)); table->Push(NodeValue::kTexture, QVariant::fromValue(merge), this); } else { diff --git a/app/node/generator/shape/shapenode.cpp b/app/node/generator/shape/shapenode.cpp index 9f77939ad..b8af51bf9 100644 --- a/app/node/generator/shape/shapenode.cpp +++ b/app/node/generator/shape/shapenode.cpp @@ -74,8 +74,8 @@ void ShapeNode::Value(const NodeValueRow &value, const NodeGlobals &globals, Nod { ShaderJob job; - job.InsertValue(value); - job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); + job.Insert(value); + job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, globals.resolution(), this)); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); job.SetShaderID(QStringLiteral("shape")); diff --git a/app/node/generator/solid/solid.cpp b/app/node/generator/solid/solid.cpp index d06076666..237c98fde 100644 --- a/app/node/generator/solid/solid.cpp +++ b/app/node/generator/solid/solid.cpp @@ -64,7 +64,7 @@ void SolidGenerator::Retranslate() void SolidGenerator::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { ShaderJob job; - job.InsertValue(value); + job.Insert(value); table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } diff --git a/app/node/generator/text/textv1.cpp b/app/node/generator/text/textv1.cpp index 395783dfa..b70aaa05b 100644 --- a/app/node/generator/text/textv1.cpp +++ b/app/node/generator/text/textv1.cpp @@ -93,10 +93,10 @@ void TextGeneratorV1::Retranslate() void TextGeneratorV1::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { GenerateJob job; - job.InsertValue(value); + job.Insert(value); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); - if (!job.GetValue(kTextInput).toString().isEmpty()) { + if (!job.Get(kTextInput).toString().isEmpty()) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } } @@ -114,15 +114,15 @@ void TextGeneratorV1::GenerateFrame(FramePtr frame, const GenerateJob& job) cons // Set default font QFont default_font; - default_font.setFamily(job.GetValue(kFontInput).toString()); - default_font.setPointSizeF(job.GetValue(kFontSizeInput).toDouble()); + default_font.setFamily(job.Get(kFontInput).toString()); + default_font.setPointSizeF(job.Get(kFontSizeInput).toDouble()); text_doc.setDefaultFont(default_font); // Center by default text_doc.setDefaultTextOption(QTextOption(Qt::AlignCenter)); - QString html = job.GetValue(kTextInput).toString(); - if (job.GetValue(kHtmlInput).toBool()) { + QString html = job.Get(kTextInput).toString(); + if (job.Get(kHtmlInput).toBool()) { html.replace('\n', QStringLiteral("
")); text_doc.setHtml(html); } else { @@ -140,7 +140,7 @@ void TextGeneratorV1::GenerateFrame(FramePtr frame, const GenerateJob& job) cons // Push 10% inwards to compensate for title safe area p.translate(tenth_of_width, 0); - TextVerticalAlign valign = static_cast(job.GetValue(kVAlignInput).toInt()); + TextVerticalAlign valign = static_cast(job.Get(kVAlignInput).toInt()); int doc_height = text_doc.size().height(); switch (valign) { @@ -163,7 +163,7 @@ void TextGeneratorV1::GenerateFrame(FramePtr frame, const GenerateJob& job) cons text_doc.documentLayout()->draw(&p, ctx); // Transplant alpha channel to frame - Color rgb = job.GetValue(kColorInput).toColor(); + Color rgb = job.Get(kColorInput).toColor(); for (int x=0; xwidth(); x++) { for (int y=0; yheight(); y++) { uchar src_alpha = img.bits()[img.bytesPerLine() * y + x]; diff --git a/app/node/generator/text/textv2.cpp b/app/node/generator/text/textv2.cpp index 0d607715d..2d091c4c9 100644 --- a/app/node/generator/text/textv2.cpp +++ b/app/node/generator/text/textv2.cpp @@ -96,11 +96,11 @@ void TextGeneratorV2::Retranslate() void TextGeneratorV2::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { GenerateJob job; - job.InsertValue(value); + job.Insert(value); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); job.SetRequestedFormat(VideoParams::kFormatFloat32); - if (!job.GetValue(kTextInput).toString().isEmpty()) { + if (!job.Get(kTextInput).toString().isEmpty()) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } } @@ -124,19 +124,19 @@ void TextGeneratorV2::GenerateFrame(FramePtr frame, const GenerateJob& job) cons // Set default font QFont default_font; - default_font.setFamily(job.GetValue(kFontInput).toString()); - default_font.setPointSizeF(job.GetValue(kFontSizeInput).toDouble()); + default_font.setFamily(job.Get(kFontInput).toString()); + default_font.setPointSizeF(job.Get(kFontSizeInput).toDouble()); text_doc.setDefaultFont(default_font); - QString html = job.GetValue(kTextInput).toString(); - if (job.GetValue(kHtmlInput).toBool()) { + QString html = job.Get(kTextInput).toString(); + if (job.Get(kHtmlInput).toBool()) { html.replace('\n', QStringLiteral("
")); text_doc.setHtml(html); } else { text_doc.setPlainText(html); } - QVector2D size = job.GetValue(kSizeInput).toVec2(); + QVector2D size = job.Get(kSizeInput).toVec2(); text_doc.setTextWidth(size.x()); // Draw rich text onto image @@ -144,12 +144,12 @@ void TextGeneratorV2::GenerateFrame(FramePtr frame, const GenerateJob& job) cons p.scale(1.0 / frame->video_params().divider(), 1.0 / frame->video_params().divider()); - QVector2D pos = job.GetValue(kPositionInput).toVec2(); + QVector2D pos = job.Get(kPositionInput).toVec2(); p.translate(pos.x() - size.x()/2, pos.y() - size.y()/2); p.translate(frame->video_params().width()/2, frame->video_params().height()/2); p.setClipRect(0, 0, size.x(), size.y()); - TextVerticalAlign valign = static_cast(job.GetValue(kVAlignInput).toInt()); + TextVerticalAlign valign = static_cast(job.Get(kVAlignInput).toInt()); int doc_height = text_doc.size().height(); switch (valign) { @@ -171,7 +171,7 @@ void TextGeneratorV2::GenerateFrame(FramePtr frame, const GenerateJob& job) cons text_doc.documentLayout()->draw(&p, ctx); // Transplant alpha channel to frame - Color rgba = job.GetValue(kColorInput).toColor(); + Color rgba = job.Get(kColorInput).toColor(); #if defined(Q_PROCESSOR_X86) || defined(Q_PROCESSOR_ARM) __m128 sse_color = _mm_loadu_ps(rgba.data()); #endif diff --git a/app/node/generator/text/textv3.cpp b/app/node/generator/text/textv3.cpp index d01c1b93d..40628ec46 100644 --- a/app/node/generator/text/textv3.cpp +++ b/app/node/generator/text/textv3.cpp @@ -81,14 +81,14 @@ void TextGeneratorV3::Retranslate() void TextGeneratorV3::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { GenerateJob job; - job.InsertValue(value); + job.Insert(value); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); job.SetRequestedFormat(VideoParams::kFormatUnsigned8); // FIXME: Provide user override for this job.SetColorspace(project()->color_manager()->GetDefaultInputColorSpace()); - if (!job.GetValue(kTextInput).toString().isEmpty()) { + if (!job.Get(kTextInput).toString().isEmpty()) { PushMergableJob(value, QVariant::fromValue(job), table); } else if (value[kBaseInput].toTexture()) { table->Push(value[kBaseInput]); @@ -108,17 +108,17 @@ void TextGeneratorV3::GenerateFrame(FramePtr frame, const GenerateJob& job) cons QTextDocument text_doc; text_doc.documentLayout()->setPaintDevice(&img); - QString html = job.GetValue(kTextInput).toString(); + QString html = job.Get(kTextInput).toString(); Html::HtmlToDoc(&text_doc, html); - QVector2D size = job.GetValue(kSizeInput).toVec2(); + QVector2D size = job.Get(kSizeInput).toVec2(); text_doc.setTextWidth(size.x()); // Draw rich text onto image QPainter p(&img); p.scale(1.0 / frame->video_params().divider(), 1.0 / frame->video_params().divider()); - QVector2D pos = job.GetValue(kPositionInput).toVec2(); + QVector2D pos = job.Get(kPositionInput).toVec2(); p.translate(pos.x() - size.x()/2, pos.y() - size.y()/2); p.translate(frame->video_params().width()/2, frame->video_params().height()/2); p.setClipRect(0, 0, size.x(), size.y()); diff --git a/app/node/keying/chromakey/chromakey.cpp b/app/node/keying/chromakey/chromakey.cpp index 3dbc1f56e..4d7701476 100644 --- a/app/node/keying/chromakey/chromakey.cpp +++ b/app/node/keying/chromakey/chromakey.cpp @@ -131,7 +131,7 @@ void ChromaKeyNode::Value(const NodeValueRow &value, const NodeGlobals &globals, if (value[kTextureInput].toTexture() && processor()) { ColorTransformJob job; - job.InsertValue(value); + job.Insert(value); job.SetAlphaChannelRequired(ColorTransformJob::kAlphaForceOn); job.SetColorProcessor(processor()); job.SetInputTexture(value[kTextureInput].toTexture()); diff --git a/app/node/keying/colordifferencekey/colordifferencekey.cpp b/app/node/keying/colordifferencekey/colordifferencekey.cpp index bd1113518..e4629816b 100644 --- a/app/node/keying/colordifferencekey/colordifferencekey.cpp +++ b/app/node/keying/colordifferencekey/colordifferencekey.cpp @@ -94,11 +94,11 @@ ShaderCode ColorDifferenceKeyNode::GetShaderCode(const ShaderRequest &request) c void ColorDifferenceKeyNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { ShaderJob job; - job.InsertValue(value); + job.Insert(value); job.SetAlphaChannelRequired(GenerateJob::kAlphaForceOn); // If there's no texture, no need to run an operation - if (job.GetValue(kTextureInput).toTexture()) { + if (job.Get(kTextureInput).toTexture()) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } } diff --git a/app/node/keying/despill/despill.cpp b/app/node/keying/despill/despill.cpp index 577cfbab5..3f8e22723 100644 --- a/app/node/keying/despill/despill.cpp +++ b/app/node/keying/despill/despill.cpp @@ -82,16 +82,16 @@ ShaderCode DespillNode::GetShaderCode(const ShaderRequest &request) const { void DespillNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { ShaderJob job; - job.InsertValue(value); + job.Insert(value); // Set luma coefficients double luma_coeffs[3] = {0.0f, 0.0f, 0.0f}; project()->color_manager()->GetDefaultLumaCoefs(luma_coeffs); - job.InsertValue(QStringLiteral("luma_coeffs"), + job.Insert(QStringLiteral("luma_coeffs"), NodeValue(NodeValue::kVec3, QVector3D(luma_coeffs[0], luma_coeffs[1], luma_coeffs[2]))); // If there's no texture, no need to run an operation - if (job.GetValue(kTextureInput).toTexture()) { + if (job.Get(kTextureInput).toTexture()) { table->Push(NodeValue::kTexture, QVariant::fromValue(job), this); } } diff --git a/app/node/math/math/mathbase.cpp b/app/node/math/math/mathbase.cpp index c1132fc7d..d07658d94 100644 --- a/app/node/math/math/mathbase.cpp +++ b/app/node/math/math/mathbase.cpp @@ -341,8 +341,8 @@ void MathNodeBase::ValueInternal(Operation operation, Pairing pairing, const QSt QString::number(val_a.type()), QString::number(val_b.type()))); - job.InsertValue(param_a_in, val_a); - job.InsertValue(param_b_in, val_b); + job.Insert(param_a_in, val_a); + job.Insert(param_b_in, val_b); bool operation_is_noop = false; @@ -370,7 +370,7 @@ void MathNodeBase::ValueInternal(Operation operation, Pairing pairing, const QSt operation_is_noop = true; } else { // Replace with adjusted matrix - job.InsertValue(val_a.type() == NodeValue::kTexture ? param_b_in : param_a_in, + job.Insert(val_a.type() == NodeValue::kTexture ? param_b_in : param_a_in, NodeValue(NodeValue::kMatrix, adjusted_matrix, this)); // It's likely an alpha channel will result from this operation @@ -414,7 +414,7 @@ void MathNodeBase::ValueInternal(Operation operation, Pairing pairing, const QSt output->Push(NodeValue::kSamples, QVariant::fromValue(buffer), this); } else { SampleJob job(val_a.type() == NodeValue::kSamples ? val_a : val_b); - job.InsertValue(number_param, NodeValue(NodeValue::kFloat, number, this)); + job.Insert(number_param, NodeValue(NodeValue::kFloat, number, this)); output->Push(NodeValue::kSamples, QVariant::fromValue(job), this); } } diff --git a/app/node/math/merge/merge.cpp b/app/node/math/merge/merge.cpp index 02506c9f3..4d758f175 100644 --- a/app/node/math/merge/merge.cpp +++ b/app/node/math/merge/merge.cpp @@ -77,18 +77,18 @@ ShaderCode MergeNode::GetShaderCode(const ShaderRequest &request) const void MergeNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const { ShaderJob job; - job.InsertValue(value); + job.Insert(value); - TexturePtr base_tex = job.GetValue(kBaseIn).toTexture(); - TexturePtr blend_tex = job.GetValue(kBlendIn).toTexture(); + TexturePtr base_tex = job.Get(kBaseIn).toTexture(); + TexturePtr blend_tex = job.Get(kBlendIn).toTexture(); if (base_tex || blend_tex) { if (!base_tex || (blend_tex && blend_tex->channel_count() < VideoParams::kRGBAChannelCount)) { // We only have a blend texture or the blend texture is RGB only, no need to alpha over - table->Push(job.GetValue(kBlendIn)); + table->Push(job.Get(kBlendIn)); } else if (!blend_tex) { // We only have a base texture, no need to alpha over - table->Push(job.GetValue(kBaseIn)); + table->Push(job.Get(kBaseIn)); } else { // We have both textures, push the job if (base_tex->channel_count() < VideoParams::kRGBAChannelCount) { diff --git a/app/render/job/acceleratedjob.h b/app/render/job/acceleratedjob.h index 534f4a528..c09138585 100644 --- a/app/render/job/acceleratedjob.h +++ b/app/render/job/acceleratedjob.h @@ -30,22 +30,22 @@ class AcceleratedJob { public: AcceleratedJob() = default; - NodeValue GetValue(const QString& input) const + NodeValue Get(const QString& input) const { return value_map_.value(input); } - void InsertValue(const QString &input, const NodeValueRow &row) + void Insert(const QString &input, const NodeValueRow &row) { value_map_.insert(input, row.value(input)); } - void InsertValue(const QString& input, const NodeValue& value) + void Insert(const QString& input, const NodeValue& value) { value_map_.insert(input, value); } - void InsertValue(const NodeValueRow &row) + void Insert(const NodeValueRow &row) { #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) value_map_.insert(row); diff --git a/app/render/opengl/openglrenderer.cpp b/app/render/opengl/openglrenderer.cpp index d5553704d..7f7119143 100644 --- a/app/render/opengl/openglrenderer.cpp +++ b/app/render/opengl/openglrenderer.cpp @@ -552,7 +552,7 @@ void OpenGLRenderer::Blit(QVariant s, ShaderJob job, Texture *destination, Video // Ensure matrix is set, at least to identity GLint mvpmat_location = functions_->glGetUniformLocation(shader, "ove_mvpmat"); if (mvpmat_location > -1) { - functions_->glUniformMatrix4fv(mvpmat_location, 1, false, job.GetValue(QStringLiteral("ove_mvpmat")).toMatrix().constData()); + functions_->glUniformMatrix4fv(mvpmat_location, 1, false, job.Get(QStringLiteral("ove_mvpmat")).toMatrix().constData()); } // Set the viewport to the "physical" resolution of the destination diff --git a/app/render/renderer.cpp b/app/render/renderer.cpp index bd18c725f..a75d6c02f 100644 --- a/app/render/renderer.cpp +++ b/app/render/renderer.cpp @@ -61,9 +61,9 @@ TexturePtr Renderer::InterlaceTexture(TexturePtr top, TexturePtr bottom, const V color_cache_mutex_.unlock(); ShaderJob job; - job.InsertValue(QStringLiteral("top_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(top))); - job.InsertValue(QStringLiteral("bottom_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(bottom))); - job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, QVector2D(params.effective_width(), params.effective_height()))); + job.Insert(QStringLiteral("top_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(top))); + job.Insert(QStringLiteral("bottom_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(bottom))); + job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, QVector2D(params.effective_width(), params.effective_height()))); TexturePtr output = CreateTexture(params); @@ -213,19 +213,19 @@ void Renderer::BlitColorManaged(const ColorTransformJob &color_job, Texture *des } ShaderJob job; - job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(color_job.GetInputTexture()))); - job.InsertValue(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, color_job.GetTransformMatrix())); - job.InsertValue(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted())); - job.InsertValue(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, int(color_job.GetInputAlphaAssociation()))); - job.InsertValue(color_job.GetValues()); + job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(color_job.GetInputTexture()))); + job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, color_job.GetTransformMatrix())); + job.Insert(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted())); + job.Insert(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, int(color_job.GetInputAlphaAssociation()))); + job.Insert(color_job.GetValues()); job.SetAlphaChannelRequired(color_job.GetAlphaChannelRequired()); foreach (const ColorContext::LUT& l, color_ctx.lut3d_textures) { - job.InsertValue(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture))); + job.Insert(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture))); job.SetInterpolation(l.name, l.interpolation); } foreach (const ColorContext::LUT& l, color_ctx.lut1d_textures) { - job.InsertValue(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture))); + job.Insert(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture))); job.SetInterpolation(l.name, l.interpolation); } diff --git a/app/render/renderprocessor.cpp b/app/render/renderprocessor.cpp index de733dec5..eb0ebff20 100644 --- a/app/render/renderprocessor.cpp +++ b/app/render/renderprocessor.cpp @@ -114,8 +114,8 @@ FramePtr RenderProcessor::GenerateFrame(TexturePtr texture, const rational& time } else { // No color transform, just blit ShaderJob job; - job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture))); - job.InsertValue(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, matrix)); + job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture))); + job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, matrix)); render_ctx_->BlitToTexture(default_shader_, job, blit_tex.get()); } diff --git a/app/widget/scope/histogram/histogram.cpp b/app/widget/scope/histogram/histogram.cpp index c03138a36..1027333a4 100644 --- a/app/widget/scope/histogram/histogram.cpp +++ b/app/widget/scope/histogram/histogram.cpp @@ -70,9 +70,9 @@ void HistogramScope::DrawScope(TexturePtr managed_tex, QVariant pipeline) ShaderJob shader_job; - shader_job.InsertValue(QStringLiteral("viewport"), NodeValue(NodeValue::kVec2, QVector2D(width(), height()))); - shader_job.InsertValue(QStringLiteral("histogram_scale"), NodeValue(NodeValue::kFloat, histogram_scale)); - shader_job.InsertValue(QStringLiteral("histogram_power"), NodeValue(NodeValue::kFloat, histogram_power)); + shader_job.Insert(QStringLiteral("viewport"), NodeValue(NodeValue::kVec2, QVector2D(width(), height()))); + shader_job.Insert(QStringLiteral("histogram_scale"), NodeValue(NodeValue::kFloat, histogram_scale)); + shader_job.Insert(QStringLiteral("histogram_power"), NodeValue(NodeValue::kFloat, histogram_power)); if (!texture_row_sums_ || texture_row_sums_->width() != this->width() @@ -83,11 +83,11 @@ void HistogramScope::DrawScope(TexturePtr managed_tex, QVariant pipeline) } // Draw managed texture to a sums texture - shader_job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(managed_tex))); + shader_job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(managed_tex))); renderer()->BlitToTexture(pipeline, shader_job, texture_row_sums_.get()); // Draw sums into a histogram - shader_job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture_row_sums_))); + shader_job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture_row_sums_))); renderer()->Blit(pipeline_secondary_, shader_job, texture_row_sums_->params()); // Draw line overlays diff --git a/app/widget/scope/scopebase/scopebase.cpp b/app/widget/scope/scopebase/scopebase.cpp index fc7c11774..e01b4978c 100644 --- a/app/widget/scope/scopebase/scopebase.cpp +++ b/app/widget/scope/scopebase/scopebase.cpp @@ -50,7 +50,7 @@ void ScopeBase::DrawScope(TexturePtr managed_tex, QVariant pipeline) { ShaderJob job; - job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(managed_tex))); + job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(managed_tex))); renderer()->Blit(pipeline, job, VideoParams(width(), height(), static_cast(OLIVE_CONFIG("OfflinePixelFormat").toInt()), diff --git a/app/widget/scope/waveform/waveform.cpp b/app/widget/scope/waveform/waveform.cpp index 7bd440751..9e664cb49 100644 --- a/app/widget/scope/waveform/waveform.cpp +++ b/app/widget/scope/waveform/waveform.cpp @@ -54,22 +54,22 @@ void WaveformScope::DrawScope(TexturePtr managed_tex, QVariant pipeline) ShaderJob job; // Set viewport size - job.InsertValue(QStringLiteral("viewport"), + job.Insert(QStringLiteral("viewport"), NodeValue(NodeValue::kVec2, QVector2D(width(), height()))); // Set luma coefficients double luma_coeffs[3] = {0.0f, 0.0f, 0.0f}; color_manager()->GetDefaultLumaCoefs(luma_coeffs); - job.InsertValue(QStringLiteral("luma_coeffs"), + job.Insert(QStringLiteral("luma_coeffs"), NodeValue(NodeValue::kVec3, QVector3D(luma_coeffs[0], luma_coeffs[1], luma_coeffs[2]))); // Scale of the waveform relative to the viewport surface. - job.InsertValue(QStringLiteral("waveform_scale"), + job.Insert(QStringLiteral("waveform_scale"), NodeValue(NodeValue::kFloat, waveform_scale)); // Insert source texture - job.InsertValue(QStringLiteral("ove_maintex"), + job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(managed_tex))); renderer()->Blit(pipeline, job, VideoParams(width(), height(), diff --git a/app/widget/viewer/viewerdisplay.cpp b/app/widget/viewer/viewerdisplay.cpp index 231bc40cd..2ceb202e3 100644 --- a/app/widget/viewer/viewerdisplay.cpp +++ b/app/widget/viewer/viewerdisplay.cpp @@ -456,8 +456,8 @@ void ViewerDisplayWidget::OnPaint() } ShaderJob job; - job.InsertValue(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, combined_matrix_flipped_)); - job.InsertValue(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, crop_matrix_)); + job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, combined_matrix_flipped_)); + job.Insert(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, crop_matrix_)); renderer()->Blit(blank_shader_, job, device_params, false); } else if (color_service()) { @@ -496,8 +496,8 @@ void ViewerDisplayWidget::OnPaint() } ShaderJob job; - job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, QVector2D(texture_to_draw->width(), texture_to_draw->height()))); - job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture_to_draw))); + job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, QVector2D(texture_to_draw->width(), texture_to_draw->height()))); + job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture_to_draw))); renderer()->BlitToTexture(deinterlace_shader_, job, deinterlace_texture_.get());