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
+38 -33
View File
@@ -20,7 +20,8 @@
#include "wavedistortnode.h"
namespace olive {
namespace olive
{
const QString WaveDistortNode::kTextureInput = QStringLiteral("tex_in");
const QString WaveDistortNode::kFrequencyInput = QStringLiteral("frequency_in");
@@ -32,69 +33,73 @@ const QString WaveDistortNode::kVerticalInput = QStringLiteral("vertical_in");
WaveDistortNode::WaveDistortNode()
{
AddInput(kTextureInput, NodeValue::kTexture, InputFlags(kInputFlagNotKeyframable));
AddInput(kTextureInput, NodeValue::kTexture,
InputFlags(kInputFlagNotKeyframable));
AddInput(kFrequencyInput, NodeValue::kFloat, 10);
AddInput(kIntensityInput, NodeValue::kFloat, 10);
AddInput(kEvolutionInput, NodeValue::kFloat, 0);
AddInput(kFrequencyInput, NodeValue::kFloat, 10);
AddInput(kIntensityInput, NodeValue::kFloat, 10);
AddInput(kEvolutionInput, NodeValue::kFloat, 0);
AddInput(kVerticalInput, NodeValue::kCombo, false);
AddInput(kVerticalInput, NodeValue::kCombo, false);
SetFlag(kVideoEffect);
SetEffectInput(kTextureInput);
SetFlag(kVideoEffect);
SetEffectInput(kTextureInput);
}
QString WaveDistortNode::Name() const
{
return tr("Wave");
return tr("Wave");
}
QString WaveDistortNode::id() const
{
return QStringLiteral("org.oliveeditor.Olive.wave");
return QStringLiteral("org.oliveeditor.Olive.wave");
}
QVector<Node::CategoryID> WaveDistortNode::Category() const
{
return {kCategoryDistort};
return { kCategoryDistort };
}
QString WaveDistortNode::Description() const
{
return tr("Distorts an image along a sine wave.");
return tr("Distorts an image along a sine wave.");
}
void WaveDistortNode::Retranslate()
{
super::Retranslate();
super::Retranslate();
SetInputName(kTextureInput, tr("Input"));
SetInputName(kFrequencyInput, tr("Frequency"));
SetInputName(kIntensityInput, tr("Intensity"));
SetInputName(kEvolutionInput, tr("Evolution"));
SetInputName(kVerticalInput, tr("Direction"));
SetComboBoxStrings(kVerticalInput, {tr("Horizontal"), tr("Vertical")});
SetInputName(kTextureInput, tr("Input"));
SetInputName(kFrequencyInput, tr("Frequency"));
SetInputName(kIntensityInput, tr("Intensity"));
SetInputName(kEvolutionInput, tr("Evolution"));
SetInputName(kVerticalInput, tr("Direction"));
SetComboBoxStrings(kVerticalInput, { tr("Horizontal"), tr("Vertical") });
}
ShaderCode WaveDistortNode::GetShaderCode(const ShaderRequest &request) const
{
Q_UNUSED(request)
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/wave.frag"));
Q_UNUSED(request)
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/wave.frag"));
}
void WaveDistortNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
void WaveDistortNode::Value(const NodeValueRow &value,
const NodeGlobals &globals,
NodeValueTable *table) const
{
// If there's no texture, no need to run an operation
if (TexturePtr texture = value[kTextureInput].toTexture()) {
// Only run shader if at least one of flip or flop are selected
if (!qIsNull(value[kIntensityInput].toDouble())) {
table->Push(NodeValue::kTexture, Texture::Job(texture->params(), ShaderJob(value)), this);
} else {
// If we're not flipping or flopping just push the texture
table->Push(value[kTextureInput]);
}
}
// If there's no texture, no need to run an operation
if (TexturePtr texture = value[kTextureInput].toTexture()) {
// Only run shader if at least one of flip or flop are selected
if (!qIsNull(value[kIntensityInput].toDouble())) {
table->Push(NodeValue::kTexture,
Texture::Job(texture->params(), ShaderJob(value)),
this);
} else {
// If we're not flipping or flopping just push the texture
table->Push(value[kTextureInput]);
}
}
}
}
+20 -19
View File
@@ -23,32 +23,33 @@
#include "node/node.h"
namespace olive {
class WaveDistortNode : public Node
namespace olive
{
Q_OBJECT
class WaveDistortNode : public Node {
Q_OBJECT
public:
WaveDistortNode();
WaveDistortNode();
NODE_DEFAULT_FUNCTIONS(WaveDistortNode)
NODE_DEFAULT_FUNCTIONS(WaveDistortNode)
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 kTextureInput;
static const QString kFrequencyInput;
static const QString kIntensityInput;
static const QString kEvolutionInput;
static const QString kVerticalInput;
virtual ShaderCode
GetShaderCode(const ShaderRequest &request) const override;
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
NodeValueTable *table) const override;
static const QString kTextureInput;
static const QString kFrequencyInput;
static const QString kIntensityInput;
static const QString kEvolutionInput;
static const QString kVerticalInput;
};
}