change: change code style to Linux style except indent.
This commit is contained in:
@@ -22,71 +22,81 @@
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
const QString NoiseGeneratorNode::kBaseIn = QStringLiteral("base_in");
|
||||
const QString NoiseGeneratorNode::kColorInput = QStringLiteral("color_in");
|
||||
const QString NoiseGeneratorNode::kStrengthInput = QStringLiteral("strength_in");
|
||||
const QString NoiseGeneratorNode::kStrengthInput =
|
||||
QStringLiteral("strength_in");
|
||||
|
||||
#define super Node
|
||||
|
||||
NoiseGeneratorNode::NoiseGeneratorNode()
|
||||
{
|
||||
AddInput(kBaseIn, NodeValue::kTexture, InputFlags(kInputFlagNotKeyframable));
|
||||
AddInput(kBaseIn, NodeValue::kTexture,
|
||||
InputFlags(kInputFlagNotKeyframable));
|
||||
|
||||
AddInput(kStrengthInput, NodeValue::kFloat, 0.2);
|
||||
SetInputProperty(kStrengthInput, QStringLiteral("view"), FloatSlider::kPercentage);
|
||||
SetInputProperty(kStrengthInput, QStringLiteral("min"), 0);
|
||||
AddInput(kStrengthInput, NodeValue::kFloat, 0.2);
|
||||
SetInputProperty(kStrengthInput, QStringLiteral("view"),
|
||||
FloatSlider::kPercentage);
|
||||
SetInputProperty(kStrengthInput, QStringLiteral("min"), 0);
|
||||
|
||||
AddInput(kColorInput, NodeValue::kBoolean, false);
|
||||
AddInput(kColorInput, NodeValue::kBoolean, false);
|
||||
|
||||
SetEffectInput(kBaseIn);
|
||||
SetFlag(kVideoEffect);
|
||||
SetEffectInput(kBaseIn);
|
||||
SetFlag(kVideoEffect);
|
||||
}
|
||||
|
||||
QString NoiseGeneratorNode::Name() const
|
||||
{
|
||||
return tr("Noise");
|
||||
return tr("Noise");
|
||||
}
|
||||
|
||||
QString NoiseGeneratorNode::id() const
|
||||
{
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.noise");
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.noise");
|
||||
}
|
||||
|
||||
QVector<Node::CategoryID> NoiseGeneratorNode::Category() const
|
||||
{
|
||||
return {kCategoryGenerator};
|
||||
return { kCategoryGenerator };
|
||||
}
|
||||
|
||||
QString NoiseGeneratorNode::Description() const
|
||||
{
|
||||
return tr("Generates noise patterns");
|
||||
return tr("Generates noise patterns");
|
||||
}
|
||||
|
||||
void NoiseGeneratorNode::Retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
super::Retranslate();
|
||||
|
||||
SetInputName(kBaseIn, tr("Base"));
|
||||
SetInputName(kStrengthInput, tr("Strength"));
|
||||
SetInputName(kColorInput, tr("Color"));
|
||||
SetInputName(kBaseIn, tr("Base"));
|
||||
SetInputName(kStrengthInput, tr("Strength"));
|
||||
SetInputName(kColorInput, tr("Color"));
|
||||
}
|
||||
|
||||
ShaderCode NoiseGeneratorNode::GetShaderCode(const ShaderRequest &request) const
|
||||
{
|
||||
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/noise.frag"));
|
||||
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/noise.frag"));
|
||||
}
|
||||
|
||||
void NoiseGeneratorNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
|
||||
void NoiseGeneratorNode::Value(const NodeValueRow &value,
|
||||
const NodeGlobals &globals,
|
||||
NodeValueTable *table) const
|
||||
{
|
||||
ShaderJob job(value);
|
||||
ShaderJob job(value);
|
||||
|
||||
job.Insert(value);
|
||||
job.Insert(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));
|
||||
|
||||
TexturePtr base = value[kBaseIn].toTexture();
|
||||
TexturePtr base = value[kBaseIn].toTexture();
|
||||
|
||||
table->Push(NodeValue::kTexture, Texture::Job(base ? base->params() : globals.vparams(), job), this);
|
||||
table->Push(NodeValue::kTexture,
|
||||
Texture::Job(base ? base->params() : globals.vparams(), job),
|
||||
this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,31 +23,33 @@
|
||||
|
||||
#include "node/node.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
class NoiseGeneratorNode : public Node {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NoiseGeneratorNode();
|
||||
Q_OBJECT
|
||||
public:
|
||||
NoiseGeneratorNode();
|
||||
|
||||
NODE_DEFAULT_FUNCTIONS(NoiseGeneratorNode)
|
||||
NODE_DEFAULT_FUNCTIONS(NoiseGeneratorNode)
|
||||
|
||||
virtual QString Name() const override;
|
||||
virtual QString id() const override;
|
||||
virtual QVector<CategoryID> Category() const override;
|
||||
virtual QString Description() const override;
|
||||
virtual QString Name() const override;
|
||||
virtual QString id() const override;
|
||||
virtual QVector<CategoryID> Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual ShaderCode GetShaderCode(const ShaderRequest &request) const override;
|
||||
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const override;
|
||||
|
||||
static const QString kBaseIn;
|
||||
static const QString kColorInput;
|
||||
static const QString kStrengthInput;
|
||||
virtual ShaderCode
|
||||
GetShaderCode(const ShaderRequest &request) const override;
|
||||
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
|
||||
NodeValueTable *table) const override;
|
||||
|
||||
static const QString kBaseIn;
|
||||
static const QString kColorInput;
|
||||
static const QString kStrengthInput;
|
||||
};
|
||||
|
||||
} // namespace olive
|
||||
} // namespace olive
|
||||
|
||||
#endif // NOISEGENERATORNODE_H
|
||||
#endif // NOISEGENERATORNODE_H
|
||||
|
||||
Reference in New Issue
Block a user