The State class relates a shape and related properties to a measure of how close it brings the working image to the target image.
More...
#include <state.h>
The State class relates a shape and related properties to a measure of how close it brings the working image to the target image.
- Author
- Sam Twidale (https://samcodes.co.uk/)
◆ State() [1/3]
geometrize::State::State |
( |
| ) |
|
std::uint8_t m_alpha
The alpha of the shape.
Definition: state.h:42
double m_score
The score of the state, a measure of the improvement applying the state to the current bitmap will ha...
Definition: state.h:41
std::shared_ptr< geometrize::Shape > m_shape
The geometric primitive owned by the state.
Definition: state.h:43
◆ State() [2/3]
geometrize::State::State |
( |
const std::shared_ptr< geometrize::Shape > & |
shape, |
|
|
std::uint8_t |
alpha |
|
) |
| |
Creates a new state.
- Parameters
-
shape | The shape. |
alpha | The color alpha of the geometric shape. |
◆ ~State()
geometrize::State::~State |
( |
| ) |
|
|
default |
◆ State() [3/3]
geometrize::State::State |
( |
const State & |
other | ) |
|
◆ mutate()
mutate Modifies the current state in a random fashion.
- Returns
- The old state, useful for undoing the mutation or keeping track of previous states.
34{
38 return oldState;
39}
The State class relates a shape and related properties to a measure of how close it brings the workin...
Definition: state.h:21
◆ operator=()
State & geometrize::State::operator= |
( |
const State & |
other | ) |
|
20{
21 if(this != &other) {
24 m_shape = other.m_shape->clone();
25 }
26 return *this;
27}
◆ m_alpha
std::uint8_t geometrize::State::m_alpha |
◆ m_score
double geometrize::State::m_score |
The score of the state, a measure of the improvement applying the state to the current bitmap will have.
◆ m_shape
The geometric primitive owned by the state.
The documentation for this class was generated from the following files:
- /home/appveyor/projects/geometrize-lib-docs/geometrize-lib/geometrize/geometrize/state.h
- /home/appveyor/projects/geometrize-lib-docs/geometrize-lib/geometrize/geometrize/state.cpp