Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
imagetaskpreferences.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <map>
5 #include <memory>
6 #include <string>
7 
8 #include "geometrize/runner/imagerunneroptions.h"
9 
10 namespace geometrize
11 {
12 
13 namespace preferences
14 {
15 
23 std::string getImageTaskPreferencesAutoSavePath(const std::string& hashOfFirstTargetImage);
24 
29 {
30 public:
32  ImageTaskPreferences(const std::string& filePath);
35  virtual ~ImageTaskPreferences();
36 
42  bool load(const std::string& filePath);
43 
49  bool save(const std::string& filePath);
50 
55  geometrize::ImageRunnerOptions getImageRunnerOptions() const;
56 
57  void enableShapeTypes(geometrize::ShapeTypes shapes);
58  void disableShapeTypes(geometrize::ShapeTypes shapes);
59  void setShapeTypes(geometrize::ShapeTypes shapes);
60  void setShapeAlpha(std::uint8_t alpha);
61  void setCandidateShapeCount(std::uint32_t shapeCount);
62  void setMaxShapeMutations(std::uint32_t maxMutations);
63  void setSeed(std::uint32_t seed);
64  void setMaxThreads(std::uint32_t maxThreads);
65 
66  bool isScriptModeEnabled() const;
67  void setScriptModeEnabled(bool enabled);
68  void setScript(const std::string& scriptName, const std::string& code);
69  void setScripts(const std::map<std::string, std::string>& scripts);
70  std::map<std::string, std::string> getScripts() const;
71 
72 private:
74  std::shared_ptr<ImageTaskPreferencesImpl> d;
75 };
76 
77 }
78 
79 }
void setCandidateShapeCount(std::uint32_t shapeCount)
Definition: imagetaskpreferences.cpp:222
The ImageTaskPreferences class models the preferences associated with an image task.
Definition: imagetaskpreferences.h:28
std::string getImageTaskPreferencesAutoSavePath(const std::string &hashOfFirstTargetImage)
getImageTaskPreferencesAutoSavePath Gets the absolute path to where the image task preferences config...
Definition: imagetaskpreferences.cpp:24
void setMaxThreads(std::uint32_t maxThreads)
Definition: imagetaskpreferences.cpp:237
bool load(const std::string &filePath)
load Loads the image task preferences from a file.
Definition: imagetaskpreferences.cpp:187
ImageTaskPreferences()
Definition: imagetaskpreferences.cpp:165
void setMaxShapeMutations(std::uint32_t maxMutations)
Definition: imagetaskpreferences.cpp:227
ImageTaskPreferences & operator=(const ImageTaskPreferences &other)
Definition: imagetaskpreferences.cpp:177
bool isScriptModeEnabled() const
Definition: imagetaskpreferences.cpp:247
void enableShapeTypes(geometrize::ShapeTypes shapes)
Definition: imagetaskpreferences.cpp:202
void setScript(const std::string &scriptName, const std::string &code)
Definition: imagetaskpreferences.cpp:252
std::shared_ptr< ImageTaskPreferencesImpl > d
Definition: imagetaskpreferences.h:73
void setScriptModeEnabled(bool enabled)
Definition: imagetaskpreferences.cpp:242
virtual ~ImageTaskPreferences()
Definition: imagetaskpreferences.cpp:173
geometrize::ImageRunnerOptions getImageRunnerOptions() const
getImageRunnerOptions Gets a copy of the image runner options.
Definition: imagetaskpreferences.cpp:197
void setShapeAlpha(std::uint8_t alpha)
Definition: imagetaskpreferences.cpp:217
bool save(const std::string &filePath)
save Saves the image task preferences to a file.
Definition: imagetaskpreferences.cpp:192
void setShapeTypes(geometrize::ShapeTypes shapes)
Definition: imagetaskpreferences.cpp:212
std::map< std::string, std::string > getScripts() const
Definition: imagetaskpreferences.cpp:262
void setScripts(const std::map< std::string, std::string > &scripts)
Definition: imagetaskpreferences.cpp:257
void setSeed(std::uint32_t seed)
Definition: imagetaskpreferences.cpp:232
void disableShapeTypes(geometrize::ShapeTypes shapes)
Definition: imagetaskpreferences.cpp:207