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 QUrl(
"https://ossia.io/score-docs/processes/texgen.html#texture-generator"),
32 Process::ProcessFlags::SupportsAll)
36using TexgenFunction = void(
unsigned char* rgb,
int width,
int height,
int t);
37using TexgenCompiler = Driver;
38using TexgenFactory = std::function<TexgenFunction>;
42 friend class JitUpdateUI;
43 SCORE_SERIALIZE_FRIENDS
44 PROCESS_METADATA_IMPL(TexgenModel)
51 ~TexgenModel()
override;
58 bool validate(
const QString& txt)
const noexcept;
59 const QString& script() const noexcept {
return m_text; }
61 void scriptChanged(
const QString& txt) W_SIGNAL(scriptChanged, txt);
62 void programChanged() W_SIGNAL(programChanged);
64 static constexpr
bool hasExternalUI() noexcept {
return true; }
66 QString prettyName() const noexcept override;
68 TexgenFactory factory;
70 void errorMessage(
int line, const QString& e) W_SIGNAL(errorMessage, line, e);
72 PROPERTY(QString, script READ script WRITE setScript NOTIFY scriptChanged)
74 QString effect() const noexcept override;
75 void loadPreset(const
Process::Preset& preset) override;
76 Process::Preset savePreset() const noexcept override;
78 [[nodiscard]]
Process::ScriptChangeResult reload();
80 std::unique_ptr<TexgenCompiler> m_compiler;
88EffectProcessFactory_T<Jit::TexgenModel>::customConstructionData() const noexcept;
92EffectProcessFactory_T<Jit::TexgenModel>::descriptor(QString d) const noexcept;
94Process::Descriptor EffectProcessFactory_T<Jit::TexgenModel>::descriptor(
95 const
Process::ProcessModel& d) const noexcept;
101struct TexgenLanguageSpec
103 static constexpr const char* language =
"C++";
110 TexgenModel, TexgenModel::p_script, TexgenLanguageSpec>>;
112class TexgenExecutor final
115 COMPONENT_METADATA(
"ec4bd3af-8d81-4d92-9b53-86a34d8108f8")
118 static constexpr
bool is_unique = true;
120 TexgenExecutor(Jit::TexgenModel& proc, const
Execution::Context& ctx, QObject* parent);
121 ~TexgenExecutor() override;
123using TexgenExecutorFactory =
Execution::ProcessComponentFactory_T<TexgenExecutor>;
130 SCORE_COMMAND_DECL(CommandFactoryName(), EditTexgen,
"Edit a texture script")
132 using
Scenario::EditScript<TexgenModel, TexgenModel::p_script>::EditScript;
140struct StaticPropertyCommand<Jit::TexgenModel::p_script> : Jit::EditTexgen
142 using Jit::EditTexgen::EditTexgen;
Definition DataStreamVisitor.hpp:202
Definition JSONVisitor.hpp:423
Definition DefaultEffectItem.hpp:26
Definition EffectFactory.hpp:67
Definition EffectFactory.hpp:14
The Process class.
Definition score-lib-process/Process/Process.hpp:61
Definition ScriptEditor.hpp:42
Definition ScriptEditCommand.hpp:18
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:13
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