Ocean
|
This class implements a container holding constraints. More...
Public Types | |
typedef std::vector< std::unique_ptr< Constraint > > | ConstraintsVector |
Definition of a vector holding constraints. More... | |
Public Member Functions | |
Constraints ()=default | |
Creates a new constraint container. More... | |
Constraints (const Constraints &constraints) | |
Copy constructor. More... | |
Constraints (Constraints &&constraints)=default | |
Default move constructor. More... | |
Constraints (const Constraints &constraints, const Scalar scale) | |
Copies a constraint container and applies an explicit scale factor. More... | |
~Constraints ()=default | |
Destructs the constraint container. More... | |
void | addConstraint (std::unique_ptr< Constraint > constraint) |
Adds a new constraint. More... | |
size_t | size () const |
Returns the number of constraints. More... | |
void | initializeDecisions (const uint8_t *mask, const unsigned int width, const unsigned int height, const unsigned int maskPaddingElements) const |
Initializes the constraint decisions. More... | |
Scalar | cost (const unsigned int insideX, const unsigned int insideY, const Vector2 &outside) const |
Returns the cost for one inside point and one outside point. More... | |
Scalar | cost (const unsigned int insideX, const unsigned int insideY, const unsigned int outsideX, const unsigned int outsideY) const |
Returns the cost for one inside point and one outside point. More... | |
bool | isEmpty () const |
Returns whether this container does not hold any constraint. More... | |
operator bool () const | |
Returns whether this container holds at least one constraint. More... | |
Constraints & | operator= (Constraints &&constraints)=default |
Default move operator. More... | |
Private Member Functions | |
Constraints & | operator= (const Constraints &constraints)=delete |
Disabled assign operator. More... | |
Private Attributes | |
ConstraintsVector | constraints_ |
Vector holding the internal constraints. More... | |
Frame | decisionFrame_ |
Decision frame. More... | |
This class implements a container holding constraints.
typedef std::vector<std::unique_ptr<Constraint> > Ocean::CV::Synthesis::Constraints::ConstraintsVector |
Definition of a vector holding constraints.
|
default |
Creates a new constraint container.
Ocean::CV::Synthesis::Constraints::Constraints | ( | const Constraints & | constraints | ) |
Copy constructor.
constraints | The constraints to be copied |
|
default |
Default move constructor.
constraints | The constraints to be moved |
Ocean::CV::Synthesis::Constraints::Constraints | ( | const Constraints & | constraints, |
const Scalar | scale | ||
) |
Copies a constraint container and applies an explicit scale factor.
constraints | The constraints to be copied |
scale | The scale factor to be applied for each constraint to be copied, with range (0, infinity) |
|
default |
Destructs the constraint container.
|
inline |
Adds a new constraint.
The given constraint will be released by the container.
constraint | The constraint to be added |
|
inline |
Returns the cost for one inside point and one outside point.
insideX | Horizontal inside position |
insideY | Vertical inside position |
outsideX | Horizontal outside point |
outsideY | Vertical outside point |
|
inline |
Returns the cost for one inside point and one outside point.
insideX | Horizontal inside position |
insideY | Vertical inside position |
outside | The outside point |
void Ocean::CV::Synthesis::Constraints::initializeDecisions | ( | const uint8_t * | mask, |
const unsigned int | width, | ||
const unsigned int | height, | ||
const unsigned int | maskPaddingElements | ||
) | const |
Initializes the constraint decisions.
mask | The mask to create the decisions for, must be valid |
width | The width of the mask in pixel |
height | The height of the mask in pixel |
maskPaddingElements | The number of padding elements at the end of each mask row, in elements, with range [0, infinity) |
|
inline |
Returns whether this container does not hold any constraint.
|
inlineexplicit |
Returns whether this container holds at least one constraint.
|
privatedelete |
Disabled assign operator.
|
default |
Default move operator.
constraints | The constraints to be moved |
|
inline |
Returns the number of constraints.
The number of constraints
|
private |
Vector holding the internal constraints.
|
mutableprivate |
Decision frame.