make nodes more const friendly and prepare their functions for stateless work

Since the nodes won't be holding any rendering data themselves in this system,
we may as well enforce some level of non-write access by setting all the
functions to const. They were already const-friendly, they just weren't
labelled as such.
This commit is contained in:
itsmattkc
2019-12-04 20:10:42 +11:00
parent cbf4d5b8c7
commit bc0f01d9a3
30 changed files with 505 additions and 346 deletions
+5 -5
View File
@@ -25,27 +25,27 @@ AlphaOverBlend::AlphaOverBlend()
}
Node *AlphaOverBlend::copy()
Node *AlphaOverBlend::copy() const
{
return new AlphaOverBlend();
}
QString AlphaOverBlend::Name()
QString AlphaOverBlend::Name() const
{
return tr("Alpha Over");
}
QString AlphaOverBlend::id()
QString AlphaOverBlend::id() const
{
return "org.olivevideoeditor.Olive.alphaoverblend";
}
QString AlphaOverBlend::Description()
QString AlphaOverBlend::Description() const
{
return tr("A blending node that composites one texture over another using its alpha channel.");
}
QString AlphaOverBlend::Code(NodeOutput *output)
QString AlphaOverBlend::Code(NodeOutput *output) const
{
if (output == texture_output()) {
return "#version 110"
+5 -5
View File
@@ -28,13 +28,13 @@ class AlphaOverBlend : public BlendNode
public:
AlphaOverBlend();
virtual Node* copy() override;
virtual Node* copy() const override;
virtual QString Name() override;
virtual QString id() override;
virtual QString Description() override;
virtual QString Name() const override;
virtual QString id() const override;
virtual QString Description() const override;
virtual QString Code(NodeOutput* output) override;
virtual QString Code(NodeOutput* output) const override;
protected:
+4 -4
View File
@@ -34,22 +34,22 @@ BlendNode::BlendNode()
AddParameter(texture_output_);
}
QString BlendNode::Category()
QString BlendNode::Category() const
{
return tr("Blend");
}
NodeInput *BlendNode::base_input()
NodeInput *BlendNode::base_input() const
{
return base_input_;
}
NodeInput *BlendNode::blend_input()
NodeInput *BlendNode::blend_input() const
{
return blend_input_;
}
NodeOutput *BlendNode::texture_output()
NodeOutput *BlendNode::texture_output() const
{
return texture_output_;
}
+4 -4
View File
@@ -28,13 +28,13 @@ class BlendNode : public Node
public:
BlendNode();
virtual QString Category() override;
virtual QString Category() const override;
NodeInput* base_input();
NodeInput* base_input() const;
NodeInput* blend_input();
NodeInput* blend_input() const;
NodeOutput* texture_output();
NodeOutput* texture_output() const;
private:
NodeInput* base_input_;