37 const std::vector<geometrize::Scanline>& lines,
96 std::vector<geometrize::ShapeResult>
step(
97 const std::function<std::shared_ptr<geometrize::Shape>(
void)>& shapeCreator,
99 std::uint32_t shapeCount,
100 std::uint32_t maxShapeMutations,
101 std::uint32_t maxThreads,
142 void setSeed(std::uint32_t seed);
146 std::unique_ptr<Model::ModelImpl>
d;
The Bitmap class is a helper class for working with bitmap data.
Definition: bitmap.h:16
The Model class is the model for the core optimization/fitting algorithm.
Definition: model.h:48
Model(const Model &)=delete
geometrize::Bitmap & getTarget()
getTarget Gets the target bitmap.
Definition: model.cpp:262
~Model()
Definition: model.cpp:227
Model & operator=(const Model &)=delete
geometrize::ShapeResult drawShape(std::shared_ptr< geometrize::Shape > shape, geometrize::rgba color)
drawShape Draws a shape on the model. Typically used when to manually add a shape to the image (e....
Definition: model.cpp:257
void reset(geometrize::rgba backgroundColor)
reset Resets the model back to the state it was in when it was created.
Definition: model.cpp:230
geometrize::Bitmap & getCurrent()
getCurrent Gets the current bitmap.
Definition: model.cpp:267
void setSeed(std::uint32_t seed)
setSeed Sets the seed that the random number generators of this model use. Note that the model also u...
Definition: model.cpp:282
std::int32_t getWidth() const
getWidth Gets the width of the target bitmap.
Definition: model.cpp:235
std::int32_t getHeight() const
getHeight Gets the height of the target bitmap.
Definition: model.cpp:240
Model(const geometrize::Bitmap &target)
Model Creates a model that will aim to replicate the target bitmap with shapes.
Definition: model.cpp:221
std::unique_ptr< Model::ModelImpl > d
Definition: model.h:146
std::vector< geometrize::ShapeResult > step(const std::function< std::shared_ptr< geometrize::Shape >(void)> &shapeCreator, std::uint8_t alpha, std::uint32_t shapeCount, std::uint32_t maxShapeMutations, std::uint32_t maxThreads, const geometrize::core::EnergyFunction &energyFunction=nullptr, const geometrize::ShapeAcceptancePreconditionFunction &addShapePrecondition=nullptr)
step Steps the primitive optimization/fitting algorithm.
Definition: model.cpp:245
std::function< double(const std::vector< geometrize::Scanline > &lines, const std::uint32_t alpha, const geometrize::Bitmap &target, const geometrize::Bitmap ¤t, geometrize::Bitmap &buffer, double score)> EnergyFunction
EnergyFunction Type alias for a function that calculates a measure of the improvement adding the scan...
Definition: core.h:44
std::function< bool(double lastScore, double newScore, const geometrize::Shape &shape, const std::vector< geometrize::Scanline > &lines, const geometrize::rgba &color, const geometrize::Bitmap &before, const geometrize::Bitmap &after, const geometrize::Bitmap &target)> ShapeAcceptancePreconditionFunction
ShapeAcceptancePreconditionFunction Type alias for a function that is used to decide whether or not t...
Definition: model.h:41
The ShapeResult struct is a container for info about a shape added to the model.
Definition: shaperesult.h:20
The rgba struct is a helper for manipulating RGBA8888 color data.
Definition: rgba.h:13