change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 03:09:40 +08:00
parent 65ab76edc8
commit 74f73ab3be
789 changed files with 77113 additions and 68888 deletions
+34 -24
View File
@@ -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);
}
}