2 #if __has_include(<score_plugin_gfx.hpp>)
3 #define SCORE_JIT_HAS_TEXGEN 1
4 #include <Process/Execution/ProcessComponent.hpp>
5 #include <Process/GenericProcessFactory.hpp>
6 #include <Process/Process.hpp>
7 #include <Process/ProcessMetadata.hpp>
8 #include <Process/Script/ScriptEditor.hpp>
9 #include <Process/Script/ScriptProcess.hpp>
11 #include <Scenario/Commands/ScriptEditCommand.hpp>
13 #include <Control/DefaultEffectItem.hpp>
14 #include <Effect/EffectFactory.hpp>
15 #include <JitCpp/EditScript.hpp>
17 #include <ossia/dataflow/execution_state.hpp>
18 #include <ossia/dataflow/graph_node.hpp>
19 #include <ossia/dataflow/node_process.hpp>
28 , Jit::TexgenModel,
"b9a20181-2925-4ade-925e-a2fd05fcbf9b",
"Jit",
29 "Texture generator", Process::ProcessCategory::Script,
"Visuals",
30 "Generate a texture",
"ossia score", QStringList{}, {}, {},
31 Process::ProcessFlags::SupportsAll)
35 using TexgenFunction = void(
unsigned char* rgb,
int width,
int height,
int t);
36 using TexgenCompiler = Driver;
37 using TexgenFactory = std::function<TexgenFunction>;
41 friend class JitUpdateUI;
42 SCORE_SERIALIZE_FRIENDS
43 PROCESS_METADATA_IMPL(TexgenModel)
50 ~TexgenModel()
override;
57 bool validate(
const QString& txt)
const noexcept;
58 const QString& script() const noexcept {
return m_text; }
60 void scriptChanged(
const QString& txt) W_SIGNAL(scriptChanged, txt);
61 void programChanged() W_SIGNAL(programChanged);
63 static constexpr
bool hasExternalUI() noexcept {
return true; }
65 QString prettyName() const noexcept override;
67 TexgenFactory factory;
69 void errorMessage(
int line, const QString& e) W_SIGNAL(errorMessage, line, e);
71 PROPERTY(QString, script READ script WRITE setScript NOTIFY scriptChanged)
73 QString effect() const noexcept override;
74 void loadPreset(const
Process::Preset& preset) override;
75 Process::Preset savePreset() const noexcept override;
77 [[nodiscard]]
Process::ScriptChangeResult reload();
79 std::unique_ptr<TexgenCompiler> m_compiler;
87 EffectProcessFactory_T<Jit::TexgenModel>::customConstructionData() const noexcept;
91 EffectProcessFactory_T<Jit::TexgenModel>::descriptor(QString d) const noexcept;
97 struct TexgenLanguageSpec
99 static constexpr
const char* language =
"C++";
106 TexgenModel, TexgenModel::p_script, TexgenLanguageSpec>>;
108 class TexgenExecutor final
111 COMPONENT_METADATA(
"ec4bd3af-8d81-4d92-9b53-86a34d8108f8")
114 static constexpr
bool is_unique = true;
116 TexgenExecutor(Jit::TexgenModel& proc, const
Execution::Context& ctx, QObject* parent);
117 ~TexgenExecutor() override;
119 using TexgenExecutorFactory =
Execution::ProcessComponentFactory_T<TexgenExecutor>;
126 SCORE_COMMAND_DECL(CommandFactoryName(), EditTexgen,
"Edit a texture script")
128 using
Scenario::EditScript<TexgenModel, TexgenModel::p_script>::EditScript;
136 struct StaticPropertyCommand<Jit::TexgenModel::p_script> : Jit::EditTexgen
138 using Jit::EditTexgen::EditTexgen;
Definition: DataStreamVisitor.hpp:202
Definition: JSONVisitor.hpp:423
Definition: DefaultEffectItem.hpp:26
Definition: EffectFactory.hpp:66
Definition: EffectFactory.hpp:14
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: ScriptEditor.hpp:42
Definition: ScriptEditCommand.hpp:23
The id_base_t class.
Definition: Identifier.hpp:57
Components used for the execution of a score.
Definition: ProcessComponent.cpp:12
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: Process/Execution/ProcessComponent.hpp:89
Definition: ScriptProcess.hpp:14
Definition: TimeValue.hpp:21