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
+2 -1
View File
@@ -20,6 +20,7 @@
#include "acceleratedjob.h"
namespace olive {
namespace olive
{
}
+35 -28
View File
@@ -24,47 +24,54 @@
#include "node/param.h"
#include "node/valuedatabase.h"
namespace olive {
class AcceleratedJob
namespace olive
{
class AcceleratedJob {
public:
AcceleratedJob() = default;
AcceleratedJob() = default;
virtual ~AcceleratedJob(){}
virtual ~AcceleratedJob()
{
}
NodeValue Get(const QString& input) const
{
return value_map_.value(input);
}
NodeValue Get(const QString &input) const
{
return value_map_.value(input);
}
void Insert(const QString &input, const NodeValueRow &row)
{
value_map_.insert(input, row.value(input));
}
void Insert(const QString &input, const NodeValueRow &row)
{
value_map_.insert(input, row.value(input));
}
void Insert(const QString& input, const NodeValue& value)
{
value_map_.insert(input, value);
}
void Insert(const QString &input, const NodeValue &value)
{
value_map_.insert(input, value);
}
void Insert(const NodeValueRow &row)
{
void Insert(const NodeValueRow &row)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
value_map_.insert(row);
value_map_.insert(row);
#else
for (auto it=row.cbegin(); it!=row.cend(); it++) {
value_map_.insert(it.key(), it.value());
}
for (auto it = row.cbegin(); it != row.cend(); it++) {
value_map_.insert(it.key(), it.value());
}
#endif
}
}
const NodeValueRow &GetValues() const { return value_map_; }
NodeValueRow &GetValues() { return value_map_; }
const NodeValueRow &GetValues() const
{
return value_map_;
}
NodeValueRow &GetValues()
{
return value_map_;
}
private:
NodeValueRow value_map_;
NodeValueRow value_map_;
};
}
+26 -15
View File
@@ -27,28 +27,39 @@
#include "node/value.h"
#include "render/job/acceleratedjob.h"
namespace olive {
class CacheJob : public AcceleratedJob
namespace olive
{
class CacheJob : public AcceleratedJob {
public:
CacheJob() = default;
CacheJob(const QString &filename, const NodeValue &fallback = NodeValue())
{
filename_ = filename;
}
CacheJob() = default;
CacheJob(const QString &filename, const NodeValue &fallback = NodeValue())
{
filename_ = filename;
}
const QString &GetFilename() const { return filename_; }
void SetFilename(const QString &s) { filename_ = s; }
const QString &GetFilename() const
{
return filename_;
}
void SetFilename(const QString &s)
{
filename_ = s;
}
const NodeValue &GetFallback() const { return fallback_; }
void SetFallback(const NodeValue &val) { fallback_ = val; }
const NodeValue &GetFallback() const
{
return fallback_;
}
void SetFallback(const NodeValue &val)
{
fallback_ = val;
}
private:
QString filename_;
NodeValue fallback_;
QString filename_;
NodeValue fallback_;
};
}
+121 -65
View File
@@ -29,97 +29,153 @@
#include "render/colorprocessor.h"
#include "render/texture.h"
namespace olive {
namespace olive
{
class Node;
class ColorTransformJob : public AcceleratedJob
{
class ColorTransformJob : public AcceleratedJob {
public:
ColorTransformJob()
{
processor_ = nullptr;
custom_shader_src_ = nullptr;
input_alpha_association_ = kAlphaNone;
clear_destination_ = true;
force_opaque_ = false;
}
ColorTransformJob()
{
processor_ = nullptr;
custom_shader_src_ = nullptr;
input_alpha_association_ = kAlphaNone;
clear_destination_ = true;
force_opaque_ = false;
}
ColorTransformJob(const NodeValueRow &row) :
ColorTransformJob()
{
Insert(row);
}
ColorTransformJob(const NodeValueRow &row)
: ColorTransformJob()
{
Insert(row);
}
QString id() const
{
if (id_.isEmpty()) {
return processor_->id();
} else {
return id_;
}
}
QString id() const
{
if (id_.isEmpty()) {
return processor_->id();
} else {
return id_;
}
}
void SetOverrideID(const QString &id) { id_ = id; }
void SetOverrideID(const QString &id)
{
id_ = id;
}
const NodeValue &GetInputTexture() const { return input_texture_; }
void SetInputTexture(const NodeValue &tex) { input_texture_ = tex; }
void SetInputTexture(TexturePtr tex)
{
Q_ASSERT(!tex->IsDummy());
input_texture_ = NodeValue(NodeValue::kTexture, tex);
}
const NodeValue &GetInputTexture() const
{
return input_texture_;
}
void SetInputTexture(const NodeValue &tex)
{
input_texture_ = tex;
}
void SetInputTexture(TexturePtr tex)
{
Q_ASSERT(!tex->IsDummy());
input_texture_ = NodeValue(NodeValue::kTexture, tex);
}
ColorProcessorPtr GetColorProcessor() const { return processor_; }
void SetColorProcessor(ColorProcessorPtr p) { processor_ = p; }
ColorProcessorPtr GetColorProcessor() const
{
return processor_;
}
void SetColorProcessor(ColorProcessorPtr p)
{
processor_ = p;
}
const AlphaAssociated &GetInputAlphaAssociation() const { return input_alpha_association_; }
void SetInputAlphaAssociation(const AlphaAssociated &e) { input_alpha_association_ = e; }
const AlphaAssociated &GetInputAlphaAssociation() const
{
return input_alpha_association_;
}
void SetInputAlphaAssociation(const AlphaAssociated &e)
{
input_alpha_association_ = e;
}
const Node *CustomShaderSource() const { return custom_shader_src_; }
const QString &CustomShaderID() const { return custom_shader_id_; }
void SetNeedsCustomShader(const Node *node, const QString &id = QString())
{
custom_shader_src_ = node;
custom_shader_id_ = id;
}
const Node *CustomShaderSource() const
{
return custom_shader_src_;
}
const QString &CustomShaderID() const
{
return custom_shader_id_;
}
void SetNeedsCustomShader(const Node *node, const QString &id = QString())
{
custom_shader_src_ = node;
custom_shader_id_ = id;
}
bool IsClearDestinationEnabled() const { return clear_destination_; }
void SetClearDestinationEnabled(bool e) { clear_destination_ = e; }
bool IsClearDestinationEnabled() const
{
return clear_destination_;
}
void SetClearDestinationEnabled(bool e)
{
clear_destination_ = e;
}
const QMatrix4x4 &GetTransformMatrix() const { return matrix_; }
void SetTransformMatrix(const QMatrix4x4 &m) { matrix_ = m; }
const QMatrix4x4 &GetTransformMatrix() const
{
return matrix_;
}
void SetTransformMatrix(const QMatrix4x4 &m)
{
matrix_ = m;
}
const QMatrix4x4 &GetCropMatrix() const { return crop_matrix_; }
void SetCropMatrix(const QMatrix4x4 &m) { crop_matrix_ = m; }
const QMatrix4x4 &GetCropMatrix() const
{
return crop_matrix_;
}
void SetCropMatrix(const QMatrix4x4 &m)
{
crop_matrix_ = m;
}
const QString &GetFunctionName() const { return function_name_; }
void SetFunctionName(const QString &function_name = QString()) { function_name_ = function_name; };
const QString &GetFunctionName() const
{
return function_name_;
}
void SetFunctionName(const QString &function_name = QString())
{
function_name_ = function_name;
};
bool GetForceOpaque() const { return force_opaque_; }
void SetForceOpaque(bool e) { force_opaque_ = e; }
bool GetForceOpaque() const
{
return force_opaque_;
}
void SetForceOpaque(bool e)
{
force_opaque_ = e;
}
private:
ColorProcessorPtr processor_;
QString id_;
ColorProcessorPtr processor_;
QString id_;
NodeValue input_texture_;
NodeValue input_texture_;
const Node *custom_shader_src_;
QString custom_shader_id_;
const Node *custom_shader_src_;
QString custom_shader_id_;
AlphaAssociated input_alpha_association_;
AlphaAssociated input_alpha_association_;
bool clear_destination_;
bool clear_destination_;
QMatrix4x4 matrix_;
QMatrix4x4 matrix_;
QMatrix4x4 crop_matrix_;
QMatrix4x4 crop_matrix_;
QString function_name_;
bool force_opaque_;
QString function_name_;
bool force_opaque_;
};
}
+83 -73
View File
@@ -23,105 +23,115 @@
#include "node/project/footage/footage.h"
namespace olive {
class FootageJob : public AcceleratedJob
namespace olive
{
class FootageJob : public AcceleratedJob {
public:
FootageJob() :
type_(Track::kNone)
{
}
FootageJob()
: type_(Track::kNone)
{
}
FootageJob(const TimeRange &time, const QString& decoder, const QString& filename, Track::Type type, const rational& length, LoopMode loop_mode) :
time_(time),
decoder_(decoder),
filename_(filename),
type_(type),
length_(length),
loop_mode_(loop_mode)
{
}
FootageJob(const TimeRange &time, const QString &decoder,
const QString &filename, Track::Type type,
const rational &length, LoopMode loop_mode)
: time_(time)
, decoder_(decoder)
, filename_(filename)
, type_(type)
, length_(length)
, loop_mode_(loop_mode)
{
}
const QString& decoder() const
{
return decoder_;
}
const QString &decoder() const
{
return decoder_;
}
const QString& filename() const
{
return filename_;
}
const QString &filename() const
{
return filename_;
}
Track::Type type() const
{
return type_;
}
Track::Type type() const
{
return type_;
}
const VideoParams& video_params() const
{
return video_params_;
}
const VideoParams &video_params() const
{
return video_params_;
}
void set_video_params(const VideoParams& p)
{
video_params_ = p;
}
void set_video_params(const VideoParams &p)
{
video_params_ = p;
}
const AudioParams& audio_params() const
{
return audio_params_;
}
const AudioParams &audio_params() const
{
return audio_params_;
}
void set_audio_params(const AudioParams& p)
{
audio_params_ = p;
}
void set_audio_params(const AudioParams &p)
{
audio_params_ = p;
}
const QString& cache_path() const
{
return cache_path_;
}
const QString &cache_path() const
{
return cache_path_;
}
void set_cache_path(const QString& p)
{
cache_path_ = p;
}
void set_cache_path(const QString &p)
{
cache_path_ = p;
}
const rational& length() const
{
return length_;
}
const rational &length() const
{
return length_;
}
void set_length(const rational& length)
{
length_ = length;
}
void set_length(const rational &length)
{
length_ = length;
}
const TimeRange &time() const { return time_; }
const TimeRange &time() const
{
return time_;
}
LoopMode loop_mode() const { return loop_mode_; }
void set_loop_mode(LoopMode m) { loop_mode_ = m; }
LoopMode loop_mode() const
{
return loop_mode_;
}
void set_loop_mode(LoopMode m)
{
loop_mode_ = m;
}
private:
TimeRange time_;
TimeRange time_;
QString decoder_;
QString decoder_;
QString filename_;
QString filename_;
Track::Type type_;
Track::Type type_;
VideoParams video_params_;
VideoParams video_params_;
AudioParams audio_params_;
AudioParams audio_params_;
QString cache_path_;
QString cache_path_;
rational length_;
LoopMode loop_mode_;
rational length_;
LoopMode loop_mode_;
};
}
+9 -10
View File
@@ -24,18 +24,17 @@
#include "acceleratedjob.h"
#include "codec/frame.h"
namespace olive {
class GenerateJob : public AcceleratedJob
namespace olive
{
public:
GenerateJob() = default;
GenerateJob(const NodeValueRow &row) :
GenerateJob()
{
Insert(row);
}
class GenerateJob : public AcceleratedJob {
public:
GenerateJob() = default;
GenerateJob(const NodeValueRow &row)
: GenerateJob()
{
Insert(row);
}
};
}
+31 -28
View File
@@ -23,44 +23,47 @@
#include "acceleratedjob.h"
namespace olive {
class SampleJob : public AcceleratedJob
namespace olive
{
class SampleJob : public AcceleratedJob {
public:
SampleJob()
{
}
SampleJob()
{
}
SampleJob(const TimeRange &time, const NodeValue& value)
{
samples_ = value.toSamples();
time_ = time;
}
SampleJob(const TimeRange &time, const NodeValue &value)
{
samples_ = value.toSamples();
time_ = time;
}
SampleJob(const TimeRange &time, const QString& from, const NodeValueRow& row)
{
samples_ = row[from].toSamples();
time_ = time;
}
SampleJob(const TimeRange &time, const QString &from,
const NodeValueRow &row)
{
samples_ = row[from].toSamples();
time_ = time;
}
const SampleBuffer &samples() const
{
return samples_;
}
const SampleBuffer &samples() const
{
return samples_;
}
bool HasSamples() const
{
return samples_.is_allocated();
}
bool HasSamples() const
{
return samples_.is_allocated();
}
const TimeRange &time() const { return time_; }
const TimeRange &time() const
{
return time_;
}
private:
SampleBuffer samples_;
TimeRange time_;
SampleBuffer samples_;
TimeRange time_;
};
}
+67 -68
View File
@@ -27,95 +27,94 @@
#include "acceleratedjob.h"
#include "render/texture.h"
namespace olive {
class ShaderJob : public AcceleratedJob
namespace olive
{
class ShaderJob : public AcceleratedJob {
public:
ShaderJob()
{
iterations_ = 1;
iterative_input_ = nullptr;
}
ShaderJob()
{
iterations_ = 1;
iterative_input_ = nullptr;
}
ShaderJob(const NodeValueRow &row) :
ShaderJob()
{
Insert(row);
}
ShaderJob(const NodeValueRow &row)
: ShaderJob()
{
Insert(row);
}
const QString& GetShaderID() const
{
return shader_id_;
}
const QString &GetShaderID() const
{
return shader_id_;
}
void SetShaderID(const QString& id)
{
shader_id_ = id;
}
void SetShaderID(const QString &id)
{
shader_id_ = id;
}
void SetIterations(int iterations, const NodeInput& iterative_input)
{
SetIterations(iterations, iterative_input.input());
}
void SetIterations(int iterations, const NodeInput &iterative_input)
{
SetIterations(iterations, iterative_input.input());
}
void SetIterations(int iterations, const QString& iterative_input)
{
iterations_ = iterations;
iterative_input_ = iterative_input;
}
void SetIterations(int iterations, const QString &iterative_input)
{
iterations_ = iterations;
iterative_input_ = iterative_input;
}
int GetIterationCount() const
{
return iterations_;
}
int GetIterationCount() const
{
return iterations_;
}
const QString& GetIterativeInput() const
{
return iterative_input_;
}
const QString &GetIterativeInput() const
{
return iterative_input_;
}
Texture::Interpolation GetInterpolation(const QString& id) const
{
return interpolation_.value(id, Texture::kDefaultInterpolation);
}
Texture::Interpolation GetInterpolation(const QString &id) const
{
return interpolation_.value(id, Texture::kDefaultInterpolation);
}
const QHash<QString, Texture::Interpolation> &GetInterpolationMap() const
{
return interpolation_;
}
const QHash<QString, Texture::Interpolation> &GetInterpolationMap() const
{
return interpolation_;
}
void SetInterpolation(const NodeInput& input, Texture::Interpolation interp)
{
interpolation_.insert(input.input(), interp);
}
void SetInterpolation(const NodeInput &input, Texture::Interpolation interp)
{
interpolation_.insert(input.input(), interp);
}
void SetInterpolation(const QString& id, Texture::Interpolation interp)
{
interpolation_.insert(id, interp);
}
void SetInterpolation(const QString &id, Texture::Interpolation interp)
{
interpolation_.insert(id, interp);
}
void SetVertexCoordinates(const QVector<float> &vertex_coords)
{
vertex_overrides_ = vertex_coords;
}
void SetVertexCoordinates(const QVector<float> &vertex_coords)
{
vertex_overrides_ = vertex_coords;
}
const QVector<float>& GetVertexCoordinates()
{
return vertex_overrides_;
}
const QVector<float> &GetVertexCoordinates()
{
return vertex_overrides_;
}
private:
QString shader_id_;
QString shader_id_;
int iterations_;
int iterations_;
QString iterative_input_;
QString iterative_input_;
QHash<QString, Texture::Interpolation> interpolation_;
QVector<float> vertex_overrides_;
QHash<QString, Texture::Interpolation> interpolation_;
QVector<float> vertex_overrides_;
};
}