completed prototype of background service that traverse the graph
This commit is contained in:
@@ -1,10 +1,27 @@
|
||||
#include "alphaover.h"
|
||||
|
||||
#include "render/rendertypes.h"
|
||||
|
||||
AlphaOverBlend::AlphaOverBlend()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString AlphaOverBlend::Name()
|
||||
{
|
||||
return tr("Alpha Over");
|
||||
}
|
||||
|
||||
QString AlphaOverBlend::id()
|
||||
{
|
||||
return "org.olivevideoeditor.Olive.alphaoverblend";
|
||||
}
|
||||
|
||||
QString AlphaOverBlend::Description()
|
||||
{
|
||||
return tr("A blending node that composites one texture over another using its alpha channel.");
|
||||
}
|
||||
|
||||
void AlphaOverBlend::Process(const rational &time)
|
||||
{
|
||||
Q_UNUSED(time)
|
||||
@@ -13,5 +30,10 @@ void AlphaOverBlend::Process(const rational &time)
|
||||
|
||||
// Note that alpha will always be premultiplied by this point
|
||||
|
||||
|
||||
|
||||
//GLuint base_tex = base_input_->get_value(time).value<GLuint>();
|
||||
|
||||
// FIXME: Does nothing
|
||||
texture_output()->set_value(blend_input()->get_value(time).value<RenderTexture>());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ class AlphaOverBlend : public BlendNode
|
||||
public:
|
||||
AlphaOverBlend();
|
||||
|
||||
virtual QString Name() override;
|
||||
virtual QString id() override;
|
||||
virtual QString Description() override;
|
||||
|
||||
protected:
|
||||
virtual void Process(const rational &time) override;
|
||||
};
|
||||
|
||||
@@ -9,6 +9,15 @@ BlendNode::BlendNode()
|
||||
blend_input_ = new NodeInput("blend_in");
|
||||
blend_input_->add_data_input(NodeParam::kTexture);
|
||||
AddParameter(blend_input_);
|
||||
|
||||
texture_output_ = new NodeOutput("tex_out");
|
||||
texture_output_->set_data_type(NodeParam::kTexture);
|
||||
AddParameter(texture_output_);
|
||||
}
|
||||
|
||||
QString BlendNode::Category()
|
||||
{
|
||||
return tr("Blend");
|
||||
}
|
||||
|
||||
NodeInput *BlendNode::base_input()
|
||||
@@ -20,3 +29,8 @@ NodeInput *BlendNode::blend_input()
|
||||
{
|
||||
return blend_input_;
|
||||
}
|
||||
|
||||
NodeOutput *BlendNode::texture_output()
|
||||
{
|
||||
return texture_output_;
|
||||
}
|
||||
|
||||
@@ -8,14 +8,20 @@ class BlendNode : public Node
|
||||
public:
|
||||
BlendNode();
|
||||
|
||||
virtual QString Category() override;
|
||||
|
||||
NodeInput* base_input();
|
||||
|
||||
NodeInput* blend_input();
|
||||
|
||||
NodeOutput* texture_output();
|
||||
|
||||
private:
|
||||
NodeInput* base_input_;
|
||||
|
||||
NodeInput* blend_input_;
|
||||
|
||||
NodeOutput* texture_output_;
|
||||
};
|
||||
|
||||
#endif // BLEND_H
|
||||
|
||||
Reference in New Issue
Block a user