118 if(!isScriptModeEnabled) {
119 emit
q->
signal_step(imageRunnerOptions,
nullptr,
nullptr);
130 const auto geometrizerEngineClone = [
this, scripts]() {
131 auto engine = std::make_shared<geometrize::script::GeometrizerEngine>(
m_geometrizer.
getEngine()->get_state());
134 engine->installScripts(scripts);
139 const auto shapeCreator = [geometrizerEngineClone, imageRunnerOptions, targetWidth, targetHeight]() {
141 return geometrizerEngineClone->makeShapeCreator(imageRunnerOptions.shapeTypes, targetWidth, targetHeight);
145 const geometrize::core::EnergyFunction energyFunction = [geometrizerEngineClone]() {
147 return geometrizerEngineClone->makeEnergyFunction();
150 emit
q->
signal_step(imageRunnerOptions, shapeCreator, energyFunction);
ImageTaskWorker m_worker
Thread that the image task worker runs on.
Definition: imagetask.cpp:232
ImageTask * q
Definition: imagetask.cpp:227
geometrize::script::GeometrizerEngine m_geometrizer
The image task worker.
Definition: imagetask.cpp:233
chaiscript::ChaiScript * getEngine()
getEngine Gets a pointer to the script engine used by the shape mutation engine.
Definition: geometrizerengine.cpp:52
geometrize::Bitmap & getTarget()
getTarget Gets the current target bitmap.
Definition: imagetaskworker.cpp:51
void signal_step(geometrize::ImageRunnerOptions options, std::function< std::shared_ptr< geometrize::Shape >()> shapeCreator, geometrize::core::EnergyFunction energyFunction)
signal_step Signal that the image task emits to make the internal model step.
preferences::ImageTaskPreferences m_preferences
Definition: imagetask.cpp:228
bool isScriptModeEnabled() const
Definition: imagetaskpreferences.cpp:247
geometrize::ImageRunnerOptions getImageRunnerOptions() const
getImageRunnerOptions Gets a copy of the image runner options.
Definition: imagetaskpreferences.cpp:197
std::map< std::string, std::string > getScripts() const
Definition: imagetaskpreferences.cpp:262