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
+75 -67
View File
@@ -23,108 +23,116 @@
#include "node/node.h"
namespace olive {
class MathNodeBase : public Node
namespace olive
{
class MathNodeBase : public Node {
public:
MathNodeBase() = default;
MathNodeBase() = default;
enum Operation {
kOpAdd,
kOpSubtract,
kOpMultiply,
kOpDivide,
kOpPower
};
enum Operation { kOpAdd, kOpSubtract, kOpMultiply, kOpDivide, kOpPower };
static QString GetOperationName(Operation o);
static QString GetOperationName(Operation o);
protected:
enum Pairing {
kPairNone = -1,
enum Pairing {
kPairNone = -1,
kPairNumberNumber,
kPairVecVec,
kPairMatrixMatrix,
kPairColorColor,
kPairTextureTexture,
kPairNumberNumber,
kPairVecVec,
kPairMatrixMatrix,
kPairColorColor,
kPairTextureTexture,
kPairVecNumber,
kPairMatrixVec,
kPairNumberColor,
kPairTextureNumber,
kPairTextureColor,
kPairTextureMatrix,
kPairSampleSample,
kPairSampleNumber,
kPairVecNumber,
kPairMatrixVec,
kPairNumberColor,
kPairTextureNumber,
kPairTextureColor,
kPairTextureMatrix,
kPairSampleSample,
kPairSampleNumber,
kPairCount
};
kPairCount
};
class PairingCalculator {
public:
PairingCalculator(const NodeValueTable &table_a, const NodeValueTable &table_b);
class PairingCalculator {
public:
PairingCalculator(const NodeValueTable &table_a,
const NodeValueTable &table_b);
bool FoundMostLikelyPairing() const;
Pairing GetMostLikelyPairing() const;
bool FoundMostLikelyPairing() const;
Pairing GetMostLikelyPairing() const;
const NodeValue& GetMostLikelyValueA() const;
const NodeValue& GetMostLikelyValueB() const;
const NodeValue &GetMostLikelyValueA() const;
const NodeValue &GetMostLikelyValueB() const;
private:
static QVector<int> GetPairLikelihood(const NodeValueTable& table);
private:
static QVector<int> GetPairLikelihood(const NodeValueTable &table);
Pairing most_likely_pairing_;
Pairing most_likely_pairing_;
NodeValue most_likely_value_a_;
NodeValue most_likely_value_a_;
NodeValue most_likely_value_b_;
NodeValue most_likely_value_b_;
};
};
template <typename T, typename U>
static T PerformAll(Operation operation, T a, U b);
template<typename T, typename U>
static T PerformAll(Operation operation, T a, U b);
template <typename T, typename U>
static T PerformMultDiv(Operation operation, T a, U b);
template<typename T, typename U>
static T PerformMultDiv(Operation operation, T a, U b);
template <typename T, typename U>
static T PerformAddSub(Operation operation, T a, U b);
template<typename T, typename U>
static T PerformAddSub(Operation operation, T a, U b);
template <typename T, typename U>
static T PerformMult(Operation operation, T a, U b);
template<typename T, typename U>
static T PerformMult(Operation operation, T a, U b);
template <typename T, typename U>
static T PerformAddSubMult(Operation operation, T a, U b);
template<typename T, typename U>
static T PerformAddSubMult(Operation operation, T a, U b);
template <typename T, typename U>
static T PerformAddSubMultDiv(Operation operation, T a, U b);
template<typename T, typename U>
static T PerformAddSubMultDiv(Operation operation, T a, U b);
static void PerformAllOnFloatBuffer(Operation operation, float *a, float b, int start, int end);
static void PerformAllOnFloatBuffer(Operation operation, float *a, float b,
int start, int end);
#if defined(Q_PROCESSOR_X86) || defined(Q_PROCESSOR_ARM)
static void PerformAllOnFloatBufferSSE(Operation operation, float *a, float b, int start, int end);
static void PerformAllOnFloatBufferSSE(Operation operation, float *a,
float b, int start, int end);
#endif
static QString GetShaderUniformType(const NodeValue::Type& type);
static QString GetShaderUniformType(const NodeValue::Type &type);
static QString GetShaderVariableCall(const QString& input_id, const NodeValue::Type& type, const QString &coord_op = QString());
static QString GetShaderVariableCall(const QString &input_id,
const NodeValue::Type &type,
const QString &coord_op = QString());
static QVector4D RetrieveVector(const NodeValue& val);
static QVector4D RetrieveVector(const NodeValue &val);
static float RetrieveNumber(const NodeValue& val);
static float RetrieveNumber(const NodeValue &val);
static bool NumberIsNoOp(const Operation& op, const float& number);
static bool NumberIsNoOp(const Operation &op, const float &number);
ShaderCode GetShaderCodeInternal(const QString &shader_id, const QString &param_a_in, const QString &param_b_in) const;
ShaderCode GetShaderCodeInternal(const QString &shader_id,
const QString &param_a_in,
const QString &param_b_in) const;
void PushVector(NodeValueTable* output, NodeValue::Type type, const QVector4D& vec) const;
void PushVector(NodeValueTable *output, NodeValue::Type type,
const QVector4D &vec) const;
void ValueInternal(Operation operation, Pairing pairing, const QString& param_a_in, const NodeValue &val_a, const QString& param_b_in, const NodeValue& val_b, const NodeGlobals &globals, NodeValueTable *output) const;
void ProcessSamplesInternal(const NodeValueRow &values, Operation operation, const QString& param_a_in, const QString& param_b_in, const SampleBuffer &input, SampleBuffer &output, int index) const;
void ValueInternal(Operation operation, Pairing pairing,
const QString &param_a_in, const NodeValue &val_a,
const QString &param_b_in, const NodeValue &val_b,
const NodeGlobals &globals,
NodeValueTable *output) const;
void ProcessSamplesInternal(const NodeValueRow &values, Operation operation,
const QString &param_a_in,
const QString &param_b_in,
const SampleBuffer &input, SampleBuffer &output,
int index) const;
};
}