Ocean
Ocean::CV::Synthesis::Mapping Class Referenceabstract

This class is the base class for all mappings. More...

Inheritance diagram for Ocean::CV::Synthesis::Mapping:

Public Member Functions

unsigned int width () const
 Returns the width of this mapping object. More...
 
unsigned int height () const
 Returns the height of this mapping object. More...
 
virtual void applyMapping (Frame &frame, const Frame &mask, const unsigned int xStart, const unsigned int xWidth, const unsigned int yStart, const unsigned int yHeight, Worker *worker=nullptr) const =0
 Applies the current mapping for one given frame. More...
 
 operator bool () const
 Returns whether this mapping object is not empty. More...
 
template<unsigned int tChannels>
unsigned int appearanceCostNormalization () const
 Calculates the normalization term for the appearance cost in accordance to the frame dimension of this mapping. More...
 
template<unsigned int tChannels>
unsigned int spatialCostNormalization () const
 Calculates the normalization term for the spatial cost in accordance to the frame dimension of this mapping. More...
 
template<>
unsigned int appearanceCostNormalization () const
 
template<>
unsigned int appearanceCostNormalization () const
 
template<>
unsigned int appearanceCostNormalization () const
 
template<>
unsigned int appearanceCostNormalization () const
 
template<>
unsigned int spatialCostNormalization () const
 
template<>
unsigned int spatialCostNormalization () const
 
template<>
unsigned int spatialCostNormalization () const
 
template<>
unsigned int spatialCostNormalization () const
 

Protected Member Functions

 Mapping ()=default
 Creates a new mapping object. More...
 
 Mapping (const Mapping &pixelMapping)
 Copies a mapping from a given mapping object. More...
 
 Mapping (Mapping &&pixelMapping) noexcept
 Moves constructor. More...
 
 Mapping (const unsigned int width, const unsigned int height)
 Creates a new mapping object. More...
 
virtual ~Mapping ()
 Destructs a mapping object. More...
 
template<unsigned int tChannels>
unsigned int calculateSpatialCostNormalization (const unsigned int width, const unsigned int height)
 Calculates the normalization term for the spatial cost in accordance to a specified frame dimension. More...
 
Mappingoperator= (const Mapping &mapping)
 Assign operator. More...
 
Mappingoperator= (Mapping &&mapping) noexcept
 Move operator. More...
 

Static Protected Member Functions

template<unsigned int tChannels>
static unsigned int calculateAppearanceCostNormalization (const unsigned int width, const unsigned int height)
 Calculates the normalization term for the appearance cost in accordance to a specified frame dimension. More...
 

Protected Attributes

unsigned int width_ = 0u
 Width of this pixel mapping object in pixel. More...
 
unsigned int height_ = 0u
 Height of this pixel mapping object in pixel. More...
 
unsigned int appearanceCostNormalizationInt8_ = 0u
 Appearance cost normalization factor for 1 channel 8 bit frames. More...
 
unsigned int appearanceCostNormalizationInt16_ = 0u
 Appearance cost normalization factor for 2 channel 16 bit frames. More...
 
unsigned int appearanceCostNormalizationInt24_ = 0u
 Appearance cost normalization factor for 3 channel 24 bit frames. More...
 
unsigned int appearanceCostNormalizationInt32_ = 0u
 Appearance cost normalization factor for 4 channel 32 bit frames. More...
 
unsigned int sapatialCostNormalizationInt8_ = 0u
 Spatial cost normalization factor for 1 channel 8 bit frames. More...
 
unsigned int spatialCostNormalizationInt16_ = 0u
 Spatial cost normalization factor for 2 channel 16 bit frames. More...
 
unsigned int spatialCostNormalizationInt24_ = 0u
 Spatial cost normalization factor for 3 channel 24 bit frames. More...
 
unsigned int spatialCostNormalizationInt32_ = 0u
 Spatial cost normalization factor for 4 channel 32 bit frames. More...
 

Detailed Description

This class is the base class for all mappings.

A mapping object stores source pixel locations for every target pixel (every pixel) of the work area.

Constructor & Destructor Documentation

◆ Mapping() [1/4]

Ocean::CV::Synthesis::Mapping::Mapping ( )
protecteddefault

Creates a new mapping object.

◆ Mapping() [2/4]

Ocean::CV::Synthesis::Mapping::Mapping ( const Mapping pixelMapping)
inlineprotected

Copies a mapping from a given mapping object.

Parameters
pixelMappingPixel mapping to be copied

◆ Mapping() [3/4]

Ocean::CV::Synthesis::Mapping::Mapping ( Mapping &&  pixelMapping)
inlineprotectednoexcept

Moves constructor.

Parameters
pixelMappingPixel mapping to be moved

◆ Mapping() [4/4]

Ocean::CV::Synthesis::Mapping::Mapping ( const unsigned int  width,
const unsigned int  height 
)
inlineprotected

Creates a new mapping object.

◆ ~Mapping()

Ocean::CV::Synthesis::Mapping::~Mapping ( )
inlineprotectedvirtual

Destructs a mapping object.

Member Function Documentation

◆ appearanceCostNormalization() [1/5]

template<unsigned int tChannels>
unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalization
inline

Calculates the normalization term for the appearance cost in accordance to the frame dimension of this mapping.

Returns
The normalization term for the appearance cost, with range [1, infinity)

◆ appearanceCostNormalization() [2/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalization ( ) const
inline

◆ appearanceCostNormalization() [3/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalization ( ) const
inline

◆ appearanceCostNormalization() [4/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalization ( ) const
inline

◆ appearanceCostNormalization() [5/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalization ( ) const
inline

◆ applyMapping()

virtual void Ocean::CV::Synthesis::Mapping::applyMapping ( Frame frame,
const Frame mask,
const unsigned int  xStart,
const unsigned int  xWidth,
const unsigned int  yStart,
const unsigned int  yHeight,
Worker worker = nullptr 
) const
pure virtual

Applies the current mapping for one given frame.


Only mask pixels will be updated in the frame while the specification of a bounding box in which the mapping will be applied is used to improve the performance of the execution.

Parameters
frameThe frame holding source and target area, with frame dimension identical to width() x height()
maskThe 8 bit mask defining source and target area with 0xFF defining a non-mask pixel, with same frame dimension and pixel origin as the provided frame
xStartHorizontal start position of the update area in pixel, with range [0, width())
xWidthWidth of the update area in pixel, with range [1, width() - xStart]
yStartVertical start position of the update area in pixel, with range [0, height())
yHeightHeight of the update area in pixel, with range [1, height() - yStart]
workerOptional worker object to distribute the computation

Implemented in Ocean::CV::Synthesis::MappingI1, and Ocean::CV::Synthesis::MappingF1.

◆ calculateAppearanceCostNormalization()

template<unsigned int tChannels>
unsigned int Ocean::CV::Synthesis::Mapping::calculateAppearanceCostNormalization ( const unsigned int  width,
const unsigned int  height 
)
inlinestaticprotected

Calculates the normalization term for the appearance cost in accordance to a specified frame dimension.

Parameters
widthThe width of the frame in pixel, with range [0, infinity)
heightThe height of the frame in pixel, with range [0, infinity)
Returns
The normalization term for the appearance cost, with range [1, infinity)

◆ calculateSpatialCostNormalization()

template<unsigned int tChannels>
unsigned int Ocean::CV::Synthesis::Mapping::calculateSpatialCostNormalization ( const unsigned int  width,
const unsigned int  height 
)
inlineprotected

Calculates the normalization term for the spatial cost in accordance to a specified frame dimension.

Parameters
widthThe width of the frame in pixel, with range [0, infinity)
heightThe height of the frame in pixel, with range [0, infinity)
Returns
The normalization term for the spatial cost, with range [1, infinity)

◆ height()

unsigned int Ocean::CV::Synthesis::Mapping::height ( ) const
inline

Returns the height of this mapping object.

Returns
Mapping height in pixel, with range [0, infinity)

◆ operator bool()

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

Returns whether this mapping object is not empty.

Returns
True, if so

◆ operator=() [1/2]

Mapping & Ocean::CV::Synthesis::Mapping::operator= ( const Mapping mapping)
inlineprotected

Assign operator.

Parameters
mappingThe mapping object to be copied
Returns
Reference to this object

◆ operator=() [2/2]

Mapping & Ocean::CV::Synthesis::Mapping::operator= ( Mapping &&  mapping)
inlineprotectednoexcept

Move operator.

Parameters
mappingThe mapping object to be moved
Returns
Reference to this object

◆ spatialCostNormalization() [1/5]

template<unsigned int tChannels>
unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalization
inline

Calculates the normalization term for the spatial cost in accordance to the frame dimension of this mapping.

Returns
The normalization term for the spatial cost, with range [1, infinity)

◆ spatialCostNormalization() [2/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalization ( ) const
inline

◆ spatialCostNormalization() [3/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalization ( ) const
inline

◆ spatialCostNormalization() [4/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalization ( ) const
inline

◆ spatialCostNormalization() [5/5]

template<>
unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalization ( ) const
inline

◆ width()

unsigned int Ocean::CV::Synthesis::Mapping::width ( ) const
inline

Returns the width of this mapping object.

Returns
Mapping width in pixel, with range [0, infinity)

Field Documentation

◆ appearanceCostNormalizationInt16_

unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalizationInt16_ = 0u
protected

Appearance cost normalization factor for 2 channel 16 bit frames.

◆ appearanceCostNormalizationInt24_

unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalizationInt24_ = 0u
protected

Appearance cost normalization factor for 3 channel 24 bit frames.

◆ appearanceCostNormalizationInt32_

unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalizationInt32_ = 0u
protected

Appearance cost normalization factor for 4 channel 32 bit frames.

◆ appearanceCostNormalizationInt8_

unsigned int Ocean::CV::Synthesis::Mapping::appearanceCostNormalizationInt8_ = 0u
protected

Appearance cost normalization factor for 1 channel 8 bit frames.

◆ height_

unsigned int Ocean::CV::Synthesis::Mapping::height_ = 0u
protected

Height of this pixel mapping object in pixel.

◆ sapatialCostNormalizationInt8_

unsigned int Ocean::CV::Synthesis::Mapping::sapatialCostNormalizationInt8_ = 0u
protected

Spatial cost normalization factor for 1 channel 8 bit frames.

◆ spatialCostNormalizationInt16_

unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalizationInt16_ = 0u
protected

Spatial cost normalization factor for 2 channel 16 bit frames.

◆ spatialCostNormalizationInt24_

unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalizationInt24_ = 0u
protected

Spatial cost normalization factor for 3 channel 24 bit frames.

◆ spatialCostNormalizationInt32_

unsigned int Ocean::CV::Synthesis::Mapping::spatialCostNormalizationInt32_ = 0u
protected

Spatial cost normalization factor for 4 channel 32 bit frames.

◆ width_

unsigned int Ocean::CV::Synthesis::Mapping::width_ = 0u
protected

Width of this pixel mapping object in pixel.


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