Ocean
Ocean::CV::Synthesis::Constraints Class Reference

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...
 
Constraintsoperator= (Constraints &&constraints)=default
 Default move operator. More...
 

Private Member Functions

Constraintsoperator= (const Constraints &constraints)=delete
 Disabled assign operator. More...
 

Private Attributes

ConstraintsVector constraints_
 Vector holding the internal constraints. More...
 
Frame decisionFrame_
 Decision frame. More...
 

Detailed Description

This class implements a container holding constraints.

Member Typedef Documentation

◆ ConstraintsVector

typedef std::vector<std::unique_ptr<Constraint> > Ocean::CV::Synthesis::Constraints::ConstraintsVector

Definition of a vector holding constraints.

Constructor & Destructor Documentation

◆ Constraints() [1/4]

Ocean::CV::Synthesis::Constraints::Constraints ( )
default

Creates a new constraint container.

◆ Constraints() [2/4]

Ocean::CV::Synthesis::Constraints::Constraints ( const Constraints constraints)

Copy constructor.

Parameters
constraintsThe constraints to be copied

◆ Constraints() [3/4]

Ocean::CV::Synthesis::Constraints::Constraints ( Constraints &&  constraints)
default

Default move constructor.

Parameters
constraintsThe constraints to be moved

◆ Constraints() [4/4]

Ocean::CV::Synthesis::Constraints::Constraints ( const Constraints constraints,
const Scalar  scale 
)

Copies a constraint container and applies an explicit scale factor.

Parameters
constraintsThe constraints to be copied
scaleThe scale factor to be applied for each constraint to be copied, with range (0, infinity)

◆ ~Constraints()

Ocean::CV::Synthesis::Constraints::~Constraints ( )
default

Destructs the constraint container.

Member Function Documentation

◆ addConstraint()

void Ocean::CV::Synthesis::Constraints::addConstraint ( std::unique_ptr< Constraint constraint)
inline

Adds a new constraint.

The given constraint will be released by the container.

Parameters
constraintThe constraint to be added

◆ cost() [1/2]

Scalar Ocean::CV::Synthesis::Constraints::cost ( const unsigned int  insideX,
const unsigned int  insideY,
const unsigned int  outsideX,
const unsigned int  outsideY 
) const
inline

Returns the cost for one inside point and one outside point.

Parameters
insideXHorizontal inside position
insideYVertical inside position
outsideXHorizontal outside point
outsideYVertical outside point
Returns
Resulting cost

◆ cost() [2/2]

Scalar Ocean::CV::Synthesis::Constraints::cost ( const unsigned int  insideX,
const unsigned int  insideY,
const Vector2 outside 
) const
inline

Returns the cost for one inside point and one outside point.

Parameters
insideXHorizontal inside position
insideYVertical inside position
outsideThe outside point
Returns
Resulting cost

◆ initializeDecisions()

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.

Parameters
maskThe mask to create the decisions for, must be valid
widthThe width of the mask in pixel
heightThe height of the mask in pixel
maskPaddingElementsThe number of padding elements at the end of each mask row, in elements, with range [0, infinity)

◆ isEmpty()

bool Ocean::CV::Synthesis::Constraints::isEmpty ( ) const
inline

Returns whether this container does not hold any constraint.

Returns
True, if so

◆ operator bool()

Ocean::CV::Synthesis::Constraints::operator bool ( ) const
inlineexplicit

Returns whether this container holds at least one constraint.

Returns
True, if so

◆ operator=() [1/2]

Constraints& Ocean::CV::Synthesis::Constraints::operator= ( const Constraints constraints)
privatedelete

Disabled assign operator.

Returns
Reference to this object

◆ operator=() [2/2]

Constraints& Ocean::CV::Synthesis::Constraints::operator= ( Constraints &&  constraints)
default

Default move operator.

Parameters
constraintsThe constraints to be moved
Returns
Reference to this object

◆ size()

size_t Ocean::CV::Synthesis::Constraints::size ( ) const
inline

Returns the number of constraints.

The number of constraints

Field Documentation

◆ constraints_

ConstraintsVector Ocean::CV::Synthesis::Constraints::constraints_
private

Vector holding the internal constraints.

◆ decisionFrame_

Frame Ocean::CV::Synthesis::Constraints::decisionFrame_
mutableprivate

Decision frame.


The documentation for this class was generated from the following file: