Ocean
Ocean::CV::FramePyramid Class Reference

This class implements a frame pyramid. More...

Inheritance diagram for Ocean::CV::FramePyramid:

Public Types

enum  DownsamplingMode : uint32_t { DM_FILTER_11 , DM_FILTER_14641 }
 Definition of individual down sampling modes. More...
 
using DownsamplingFunction = std::function< bool(const Frame &sourceLayer, Frame &targetLayer, Worker *worker)>
 Definition of a function allowing to downsample a frame. More...
 

Public Member Functions

 FramePyramid ()
 Creates an empty frame pyramid object. More...
 
 FramePyramid (const FramePyramid &framePyramid, const bool copyData)
 Copy constructor. More...
 
 FramePyramid (FramePyramid &&framePyramid) noexcept
 Move constructor. More...
 
 FramePyramid (const unsigned int layers, const FrameType &frameType)
 Creates a frame pyramid object for a given frame type and layer number. More...
 
 FramePyramid (const uint8_t *frame, const unsigned int width, const unsigned int height, const unsigned int channels, const FrameType::PixelOrigin pixelOrigin, const unsigned int layers, const unsigned int framePaddingElements, const bool copyFirstLayer, Worker *worker=nullptr, const FrameType::PixelFormat pixelFormat=FrameType::FORMAT_UNDEFINED, const Timestamp timestamp=Timestamp(false))
 Creates a new pyramid frame for frames with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling. More...
 
 FramePyramid (const Frame &frame, const unsigned int layers, const bool copyFirstLayer, Worker *worker=nullptr)
 Creates a new pyramid frame for frames with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling. More...
 
 FramePyramid (const uint8_t *frame, const unsigned int width, const unsigned int height, const unsigned int channels, const FrameType::PixelOrigin pixelOrigin, const DownsamplingMode downsamplingMode, const unsigned int layers, const unsigned int framePaddingElements, const bool copyFirstLayer, Worker *worker, const FrameType::PixelFormat pixelFormat=FrameType::FORMAT_UNDEFINED, const Timestamp timestamp=Timestamp(false))
 Creates a frame pyramid based on a frame with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a custom downsampling. More...
 
 FramePyramid (const Frame &frame, const DownsamplingMode downsamplingMode, const unsigned int layers, const bool copyFirstLayer, Worker *worker)
 Creates a frame pyramid based on a frame applying a custom downsampling. More...
 
 FramePyramid (const Frame &frame, const DownsamplingFunction &downsamplingFunction, const unsigned int layers, const bool copyFirstLayer, Worker *worker)
 Creates a frame pyramid based on a frame applying a custom downsampling. More...
 
 FramePyramid (const DownsamplingMode downsamplingMode, Frame &&frame, const unsigned int layers, Worker *worker)
 Creates a frame pyramid based on a frame applying a custom downsampling. More...
 
 FramePyramid (const DownsamplingFunction &downsamplingFunction, Frame &&frame, const unsigned int layers, Worker *worker)
 Creates a frame pyramid based on a frame applying a custom downsampling. More...
 
 FramePyramid (const FramePyramid &framePyramid, const unsigned int firstLayerIndex, const unsigned int layers, bool copyData)
 Creates a new frame pyramid based on an existing frame pyramid. More...
 
const Framelayer (const unsigned int layer) const
 Returns the frame of a specified layer. More...
 
Framelayer (const unsigned int layer)
 Returns the frame of a specified layer. More...
 
const FramefinestLayer () const
 Returns the finest layer frame of this pyramid. More...
 
FramefinestLayer ()
 Returns the coarsest layer frame of this pyramid. More...
 
const FramecoarsestLayer () const
 Returns the coarsest layer frame of this pyramid regarding to the number of valid layers. More...
 
FramecoarsestLayer ()
 Returns the finest layer frame of this pyramid regarding to the number of valid layers. More...
 
unsigned int layers () const
 Returns the number of layers this pyramid holds. More...
 
unsigned int width (const unsigned int layer) const
 Returns the width of a given layer. More...
 
unsigned int height (const unsigned int layer) const
 Returns the height of a given layer. More...
 
unsigned int finestWidth () const
 Returns the width of the finest (first) layer. More...
 
unsigned int finestHeight () const
 Returns the height of the finest (first) layer. More...
 
unsigned int coarsestWidth () const
 Returns the width of the coarsest (last) layer regarding to the number of valid layers. More...
 
unsigned int coarsestHeight () const
 Returns the height of the coarsest (last) layer regarding to the number of valid layers. More...
 
unsigned int coarsestSizeFactor () const
 Returns the size factor for the coarsest layer in relation to the finest layer regarding to the number of valid layers. More...
 
const FrameTypeframeType () const
 Returns the frame type of the finest layer. More...
 
bool replace (const Frame &frame, const DownsamplingMode downsamplingMode, const unsigned int layers, const bool copyFirstLayer, Worker *worker)
 Replaces this frame pyramid based on a new frame. More...
 
bool replace (const Frame &frame, const DownsamplingFunction &downsamplingFunction, const unsigned int layers, const bool copyFirstLayer, Worker *worker)
 Replaces this frame pyramid based on a new frame. More...
 
bool replace (const DownsamplingMode downsamplingMode, Frame &&frame, const unsigned int layers, Worker *worker)
 Replaces this frame pyramid based on a new frame. More...
 
bool replace (const DownsamplingFunction &downsamplingFunction, Frame &&frame, const unsigned int layers, Worker *worker)
 Replaces this frame pyramid based on a new frame. More...
 
bool replace8BitPerChannel (const uint8_t *frame, const unsigned int width, const unsigned int height, const unsigned int channels, const FrameType::PixelOrigin pixelOrigin, const DownsamplingMode downsamplingMode, const unsigned int layers, const unsigned int framePaddingElements, const bool copyFirstLayer, Worker *worker, const FrameType::PixelFormat pixelFormat=FrameType::FORMAT_UNDEFINED, const Timestamp timestamp=Timestamp(false))
 Replaces this frame pyramid based on a new frame. More...
 
bool replace8BitPerChannel11 (const uint8_t *frame, const unsigned int width, const unsigned int height, const unsigned int channels, const FrameType::PixelOrigin pixelOrigin, const unsigned int layers, const unsigned int framePaddingElements, const bool copyFirstLayer, Worker *worker, const FrameType::PixelFormat pixelFormat=FrameType::FORMAT_UNDEFINED, const Timestamp timestamp=Timestamp(false))
 Replaces this frame pyramid by a new frame with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling. More...
 
bool replace8BitPerChannel11 (const Frame &frame, const unsigned int layers, const bool copyFirstLayer, Worker *worker)
 Replaces this frame pyramid by a new frame with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling. More...
 
bool replace (const FrameType &frameType, const bool forceOwner, const unsigned int layers)
 Replaces this frame pyramid with a new pyramid defined by the frame type of the finest layer. More...
 
void reduceLayers (const size_t layers)
 Reduces the number of pyramid layers. More...
 
void clear ()
 Releases the internal frame layers. More...
 
bool isOwner (const unsigned int layerIndex=AS_MANY_LAYERS_AS_POSSIBLE) const
 Returns whether the frame pyramid is the owner of the entire image data or owner of a specific pyramid layer. More...
 
bool isValid () const
 Returns whether this pyramid holds at least one frame layer. More...
 
const Memorymemory () const
 Returns the pyramid's memory block. More...
 
FramePyramidoperator= (FramePyramid &&right) noexcept
 Move operator. More...
 
const Frameoperator[] (const unsigned int layer) const
 Returns the frame of a specified layer. More...
 
Frameoperator[] (const unsigned int layer)
 Returns the frame of a specified layer. More...
 
 operator bool () const
 Returns whether this pyramid holds at least one frame layer. More...
 

Static Public Member Functions

static constexpr unsigned int sizeFactor (const unsigned int layer)
 Returns the size factor of a specified layer in relation to the finest layer. More...
 
static unsigned int idealLayers (const unsigned int width, const unsigned int height, const unsigned int invalidCoarsestWidthOrHeight, unsigned int *coarsestLayerWidth=nullptr, unsigned int *coarsestLayerHeight=nullptr)
 Determines the number of layers until an invalid frame size would be reached in the next layer. More...
 
static unsigned int idealLayers (const unsigned int width, const unsigned int height, const unsigned int invalidCoarsestWidth, const unsigned int invalidCoarsestHeight, unsigned int *coarsestLayerWidth=nullptr, unsigned int *coarsestLayerHeight=nullptr)
 Determines the number of layers until an invalid frame size would be reached in the next layer. More...
 
static unsigned int idealLayers (const unsigned int width, const unsigned int height, const unsigned int invalidCoarsestWidth, const unsigned int invalidCoarsestHeight, const unsigned int layerFactor, const unsigned int maximalRadius=(unsigned int)(-1), const unsigned int coarsestLayerRadius=2u, unsigned int *coarsestLayerWidth=nullptr, unsigned int *coarsestLayerHeight=nullptr)
 Determines the number of layers until an invalid frame size would be reached in the next layer or an overall size radius is reached. More...
 

Static Public Attributes

static constexpr unsigned int AS_MANY_LAYERS_AS_POSSIBLE = (unsigned int)(-1)
 Definition of a value that can be used to create as many pyramid layers as possible (so that the coarsest pyramid layer has resolution 1x1). More...
 

Protected Member Functions

 FramePyramid (Frame &&)=delete
 Disabled constructor. More...
 
 FramePyramid (const Frame &, const bool)=delete
 Disabled constructor. More...
 
 FramePyramid (const Frame &frame, const DownsamplingMode downsamplingMode, const unsigned int layers, Worker *worker)=delete
 Disabled constructor to prevent confusion between all constructors. More...
 
 FramePyramid (const Frame &frame, const DownsamplingFunction &downsamplingFunction, const unsigned int layers, Worker *worker)=delete
 Disabled constructor to prevent confusion between all constructors. More...
 
bool replace (const FrameType &frameType, const bool reserveFirstLayerMemory, const bool forceOwner, const unsigned int layers)
 Replaces this frame pyramid with a new pyramid defined by the frame type of the finest layer. More...
 
bool replace (const Frame &frame, const bool forceOwner, const unsigned int layers=AS_MANY_LAYERS_AS_POSSIBLE)=delete
 Deleted function to prevent confusion between Frame and FrameType. More...
 
FramePyramidoperator= (const FramePyramid &)=delete
 Disabled assign operator Use a constructor or the move operator instead. More...
 
bool replace (const Frame &, const DownsamplingMode, const unsigned int layers, Worker *worker)=delete
 Deleted function to prevent confusion between several different replace functions. More...
 
bool replace (const Frame &, const DownsamplingFunction &, const unsigned int layers, Worker *worker)=delete
 Deleted function to prevent confusion between several different replace functions. More...
 

Static Protected Member Functions

static size_t calculateMemorySize (const unsigned int width, const unsigned int height, const FrameType::PixelFormat pixelFormat, const unsigned int layers, const bool includeFirstLayer, unsigned int *totalLayers=nullptr)
 Calculates the size of the entire pyramid in bytes covering all images in all pyramid layers. More...
 
static bool downsampleByTwo11 (const Frame &finerLayer, Frame &coarserLayer, Worker *worker)
 Downsamples a frame with 1-1 filter. More...
 
static bool downsampleAlphaByTwo11 (const Frame &finerLayer, Frame &coarserLayer, Worker *worker)
 Downsamples a frame with 1-1 filter which contains an alpha channel. More...
 
static bool downsampleByTwo14641 (const Frame &finerLayer, Frame &coarserLayer, Worker *worker)
 Downsamples a frame with 1-4-6-4-1 filter. More...
 
static CV::FramePyramid::DownsamplingFunction downsamplingFunction (const CV::FramePyramid::DownsamplingMode downsamplingMode, const FrameType::PixelFormat pixelFormat)
 Returns the downsampling function for a specified downsampling mode. More...
 

Protected Attributes

Frames layers_
 The individual layers of this pyramid, zero if not valid. More...
 
Memory memory_
 Optional memory which may be used by at least one pyramid layer. More...
 

Static Protected Attributes

static constexpr size_t memoryAlignmentBytes_ = 8
 The number of bytes for memory alignment. More...
 

Detailed Description

This class implements a frame pyramid.


A frame pyramid holds the same frame with several scale spaces.
Each further layer holds the frame with half size (half width and half height).
The finest layer has index 0 and the coarsest layer has the highest index.

Member Typedef Documentation

◆ DownsamplingFunction

using Ocean::CV::FramePyramid::DownsamplingFunction = std::function<bool(const Frame& sourceLayer, Frame& targetLayer, Worker* worker)>

Definition of a function allowing to downsample a frame.

Parameters
sourceLayerThe source layer to downsample
targetLayerThe target layer reviving the downsampled image content
workerOptional worker to distribute the computation
Returns
True, if succeeded

Member Enumeration Documentation

◆ DownsamplingMode

Definition of individual down sampling modes.

Enumerator
DM_FILTER_11 

Down sampling is realized by a 2x2 averaging filter.

This down sampling mode is the fastest mode available, as 2x2 pixel blocks are simply averaged.
The corresponding filter mask has the following layout:

| 1 1 |
| 1 1 | * 1/4

The upper left filter element is applied to every even pixel location in the source frame.
In case, the width or height of a given frame is odd, the last column/row will apply a 121 filter.

DM_FILTER_14641 

Down sampling is realized by a 5x5 Gaussian filter.

This down sampling mode is more expensive but reduces aliasing effects on down sampled images.
The corresponding filter mask has the following layout:

| 1  4  6  4 1 |
| 4 16 24 16 4 |
| 6 24 36 24 6 | * 1/256
| 4 16 24 16 4 |
| 1  4  6  4 1 |

The center of the filter is applied to every even pixel location in the source frame.
At the border of frames, the filter responses are determined based on mirrored pixel values.

Constructor & Destructor Documentation

◆ FramePyramid() [1/16]

Ocean::CV::FramePyramid::FramePyramid ( )
inline

Creates an empty frame pyramid object.

◆ FramePyramid() [2/16]

Ocean::CV::FramePyramid::FramePyramid ( const FramePyramid framePyramid,
const bool  copyData 
)

Copy constructor.

Parameters
framePyramidFrame pyramid to be copied
copyDataTrue, to copy the image content of the frame pyramid; False, to only reuse the image content of the frame pyramid

◆ FramePyramid() [3/16]

Ocean::CV::FramePyramid::FramePyramid ( FramePyramid &&  framePyramid)
noexcept

Move constructor.

Parameters
framePyramidFrame pyramid to be moved

◆ FramePyramid() [4/16]

Ocean::CV::FramePyramid::FramePyramid ( const unsigned int  layers,
const FrameType frameType 
)
explicit

Creates a frame pyramid object for a given frame type and layer number.

The resulting pyramid may have fewer layers than desired.
The image content of the replaced frame pyramid will be uninitialized.

Parameters
layersThe preferred number of layers to be created, with range [1, infinity), AS_MANY_LAYERS_AS_POSSIBLE to create as may layers as possible
frameTypeType of the frame to create a frame pyramid for, must be valid

◆ FramePyramid() [5/16]

Ocean::CV::FramePyramid::FramePyramid ( const uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const FrameType::PixelOrigin  pixelOrigin,
const unsigned int  layers,
const unsigned int  framePaddingElements,
const bool  copyFirstLayer,
Worker worker = nullptr,
const FrameType::PixelFormat  pixelFormat = FrameType::FORMAT_UNDEFINED,
const Timestamp  timestamp = Timestamp(false) 
)
inline

Creates a new pyramid frame for frames with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling.

This constructor is intentionally restrictive to reduce binary impact when used, use other constructors or functions in case more flexibility is needed an binary size does not matter.
The constructor mainly calls replace8BitPerChannel11().

Parameters
frameThe frame for which the pyramid will be created, must be valid
widthThe width of the given frame in pixel, with range [1, infinity)
heightThe height of the given frame in pixel, with range [1, infinity)
channelsThe number of channels the given frame has, with range [1, infinity)
pixelOriginThe pixel origin of the given frame
layersNumber of pyramid layers to be created, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
pixelFormatThe explicit pixel format which will be used for each pyramid layer, must be compatible with DT_UNSIGNED_INTEGER_8 and 'channels'; FORMAT_UNDEFINED to use a generic pixel format
timestampTimestamp to be assigned to the frame pyramid (e.g., the timestamp of the frame used to created the timestamp)
See also
replace8BitPerChannel11().

◆ FramePyramid() [6/16]

Ocean::CV::FramePyramid::FramePyramid ( const Frame frame,
const unsigned int  layers,
const bool  copyFirstLayer,
Worker worker = nullptr 
)
inline

Creates a new pyramid frame for frames with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling.

This constructor is intentionally restrictive to reduce binary impact when used, use other constructors or functions in case more flexibility is needed an binary size does not matter.
In case the provided frame not a valid 1-plane DT_UNSIGNED_INTEGER_8 frame, the pyramid will be invalid.
The constructor mainly calls replace8BitPerChannel11().

Parameters
frameThe frame for which the pyramid will be created, with 1 plane and data type DT_UNSIGNED_INTEGER_8, must be valid
layersNumber of pyramid layers to be created, with range [1, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
See also
replace8BitPerChannel11().

◆ FramePyramid() [7/16]

Ocean::CV::FramePyramid::FramePyramid ( const uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const FrameType::PixelOrigin  pixelOrigin,
const DownsamplingMode  downsamplingMode,
const unsigned int  layers,
const unsigned int  framePaddingElements,
const bool  copyFirstLayer,
Worker worker,
const FrameType::PixelFormat  pixelFormat = FrameType::FORMAT_UNDEFINED,
const Timestamp  timestamp = Timestamp(false) 
)
inline

Creates a frame pyramid based on a frame with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a custom downsampling.

The resulting pyramid will contain a copy of the given frame (as finest pyramid layer) or will just use the memory, depending on 'copyFirstLayer'.
The constructor mainly calls replace8BitPerChannel().

Parameters
frameThe frame for which the pyramid will be created, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
channelsThe number of channels the given frame has, with range [1, infinity)
pixelOriginThe pixel origin of the given frame
downsamplingModeThe downsampling mode to use when creating the individual pyramid layers, must be valid
layersNumber of pyramid layers to be created, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
pixelFormatThe explicit pixel format which will be used for each pyramid layer, must be compatible with DT_UNSIGNED_INTEGER_8 and 'channels'; FORMAT_UNDEFINED to use a generic pixel format
timestampTimestamp to be assigned to the frame pyramid (e.g., the timestamp of the frame used to created the timestamp)
See also
replace8BitPerChannel().

◆ FramePyramid() [8/16]

Ocean::CV::FramePyramid::FramePyramid ( const Frame frame,
const DownsamplingMode  downsamplingMode,
const unsigned int  layers,
const bool  copyFirstLayer,
Worker worker 
)
inline

Creates a frame pyramid based on a frame applying a custom downsampling.

The resulting pyramid will contain a copy of the given frame (as finest pyramid layer) or will just use the memory, depending on 'copyFirstLayer'.

Parameters
frameThe frame for which the pyramid will be created, must be valid
downsamplingModeThe downsampling mode to use when creating the individual pyramid layers, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case,
workerOptional worker object to distribute the computation

◆ FramePyramid() [9/16]

Ocean::CV::FramePyramid::FramePyramid ( const Frame frame,
const DownsamplingFunction downsamplingFunction,
const unsigned int  layers,
const bool  copyFirstLayer,
Worker worker 
)
inline

Creates a frame pyramid based on a frame applying a custom downsampling.

The resulting pyramid will contain a copy of the given frame (as finest pyramid layer) or will just use the memory, depending on 'copyFirstLayer'.

Parameters
frameThe frame for which the pyramid will be created, must be valid
downsamplingFunctionThe custom function used to downsample the individual pyramid layers, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case,
workerOptional worker object to distribute the computation

◆ FramePyramid() [10/16]

Ocean::CV::FramePyramid::FramePyramid ( const DownsamplingMode  downsamplingMode,
Frame &&  frame,
const unsigned int  layers,
Worker worker 
)
inline

Creates a frame pyramid based on a frame applying a custom downsampling.

The resulting pyramid will re-used the given frame (as finest pyramid layer); thus, ensure that the frame's memory is valid as long as this pyramid exists.

Parameters
downsamplingModeThe downsampling mode to use when creating the individual pyramid layers, must be valid
frameThe frame for which the pyramid will be created, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
workerOptional worker object to distribute the computation

◆ FramePyramid() [11/16]

Ocean::CV::FramePyramid::FramePyramid ( const DownsamplingFunction downsamplingFunction,
Frame &&  frame,
const unsigned int  layers,
Worker worker 
)
inline

Creates a frame pyramid based on a frame applying a custom downsampling.

The resulting pyramid will re-used the given frame (as finest pyramid layer); thus, ensure that the frame's memory is valid as long as this pyramid exists.

Parameters
downsamplingFunctionThe custom function used to downsample the individual pyramid layers, must be valid
frameThe frame for which the pyramid will be created, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
workerOptional worker object to distribute the computation

◆ FramePyramid() [12/16]

Ocean::CV::FramePyramid::FramePyramid ( const FramePyramid framePyramid,
const unsigned int  firstLayerIndex,
const unsigned int  layers,
bool  copyData 
)

Creates a new frame pyramid based on an existing frame pyramid.

Parameters
framePyramidThe existing frame pyramid from which the new pyramid will be created, must be valid
firstLayerIndexThe index of the first layer to use from the source pyramid, with range [0, framePyramid.layers() - 1]
layersThe number of layers to use from the source pyramid, with range [1, infinity), AS_MANY_LAYERS_AS_POSSIBLE to use as many layers as exist
copyDataTrue, to make a copy of the image content of the existing pyramid; False, to only use the memory

◆ FramePyramid() [13/16]

Ocean::CV::FramePyramid::FramePyramid ( Frame &&  )
explicitprotecteddelete

Disabled constructor.

◆ FramePyramid() [14/16]

Ocean::CV::FramePyramid::FramePyramid ( const Frame ,
const bool   
)
protecteddelete

Disabled constructor.

◆ FramePyramid() [15/16]

Ocean::CV::FramePyramid::FramePyramid ( const Frame frame,
const DownsamplingMode  downsamplingMode,
const unsigned int  layers,
Worker worker 
)
protecteddelete

Disabled constructor to prevent confusion between all constructors.

◆ FramePyramid() [16/16]

Ocean::CV::FramePyramid::FramePyramid ( const Frame frame,
const DownsamplingFunction downsamplingFunction,
const unsigned int  layers,
Worker worker 
)
protecteddelete

Disabled constructor to prevent confusion between all constructors.

Member Function Documentation

◆ calculateMemorySize()

static size_t Ocean::CV::FramePyramid::calculateMemorySize ( const unsigned int  width,
const unsigned int  height,
const FrameType::PixelFormat  pixelFormat,
const unsigned int  layers,
const bool  includeFirstLayer,
unsigned int *  totalLayers = nullptr 
)
staticprotected

Calculates the size of the entire pyramid in bytes covering all images in all pyramid layers.

Parameters
widthThe width of the finest layer in pixel, with range [0, 65535]
heightThe height of the finest layer in pixel, with range [0, 65535]
pixelFormatThe pixel format of each layer, must be a generic 1-plane pixel format, must be valid
layersNumber of layers, with range [0, infinity)
includeFirstLayerTrue, to determine the memory for all layers; False, to skip the first layer and only determine the memory for all remaining (coarser) layers
totalLayersOptional resulting number of pyramid layers that will exist (always counts the very first layer independently of 'includeFirstLayer'), with range [0, layers]
Returns
Resulting number of bytes, with range [0, infinity)

◆ clear()

void Ocean::CV::FramePyramid::clear ( )
inline

Releases the internal frame layers.

◆ coarsestHeight()

unsigned int Ocean::CV::FramePyramid::coarsestHeight ( ) const
inline

Returns the height of the coarsest (last) layer regarding to the number of valid layers.

If no valid layer is stored in this pyramid, the finest layer is used instead.

Returns
Height in pixel

◆ coarsestLayer() [1/2]

Frame & Ocean::CV::FramePyramid::coarsestLayer ( )
inline

Returns the finest layer frame of this pyramid regarding to the number of valid layers.

If no valid layer is stored in this pyramid, the finest layer is used instead.
Beware: The frame will not be the owner of the frame data, if you need a copy of this frame enforce to copy the frame buffer!

Returns
Finest pyramid layer frame

◆ coarsestLayer() [2/2]

const Frame & Ocean::CV::FramePyramid::coarsestLayer ( ) const
inline

Returns the coarsest layer frame of this pyramid regarding to the number of valid layers.

If no valid layer is stored in this pyramid, the finest layer is used instead.
Beware: The frame will not be the owner of the frame data, if you need a copy of this frame enforce to copy the frame buffer!

Returns
Finest pyramid layer frame

◆ coarsestSizeFactor()

unsigned int Ocean::CV::FramePyramid::coarsestSizeFactor ( ) const
inline

Returns the size factor for the coarsest layer in relation to the finest layer regarding to the number of valid layers.

If no valid layer is stored in this pyramid, the finest layer is used instead.

Returns
Coarsest layer size factor

◆ coarsestWidth()

unsigned int Ocean::CV::FramePyramid::coarsestWidth ( ) const
inline

Returns the width of the coarsest (last) layer regarding to the number of valid layers.

If no valid layer is stored in this pyramid, the finest layer is used instead.

Returns
Width in pixel

◆ downsampleAlphaByTwo11()

static bool Ocean::CV::FramePyramid::downsampleAlphaByTwo11 ( const Frame finerLayer,
Frame coarserLayer,
Worker worker 
)
staticprotected

Downsamples a frame with 1-1 filter which contains an alpha channel.

Parameters
finerLayerThe finer pyramid layer, must be valid
coarserLayerThe coarser pyramid layer, must be valid
workerThe optional worker to distribute the computation
Returns
True, if succeeded

◆ downsampleByTwo11()

static bool Ocean::CV::FramePyramid::downsampleByTwo11 ( const Frame finerLayer,
Frame coarserLayer,
Worker worker 
)
staticprotected

Downsamples a frame with 1-1 filter.

Parameters
finerLayerThe finer pyramid layer, must be valid
coarserLayerThe coarser pyramid layer, must be valid
workerThe optional worker to distribute the computation
Returns
True, if succeeded

◆ downsampleByTwo14641()

static bool Ocean::CV::FramePyramid::downsampleByTwo14641 ( const Frame finerLayer,
Frame coarserLayer,
Worker worker 
)
staticprotected

Downsamples a frame with 1-4-6-4-1 filter.

Parameters
finerLayerThe finer pyramid layer, must be valid
coarserLayerThe coarser pyramid layer, must be valid
workerThe optional worker to distribute the computation
Returns
True, if succeeded

◆ downsamplingFunction()

static CV::FramePyramid::DownsamplingFunction Ocean::CV::FramePyramid::downsamplingFunction ( const CV::FramePyramid::DownsamplingMode  downsamplingMode,
const FrameType::PixelFormat  pixelFormat 
)
staticprotected

Returns the downsampling function for a specified downsampling mode.

Parameters
downsamplingModeThe downsampling mode for which the function will be returned
pixelFormatThe pixel format for which the downsampling function will be returned, must be valid
Returns
The downsampling function, nullptr if unknown

◆ finestHeight()

unsigned int Ocean::CV::FramePyramid::finestHeight ( ) const
inline

Returns the height of the finest (first) layer.

Returns
Height in pixel

◆ finestLayer() [1/2]

Frame & Ocean::CV::FramePyramid::finestLayer ( )
inline

Returns the coarsest layer frame of this pyramid.

Beware: The frame will not be the owner of the frame data, if you need a copy of this frame enforce to copy the frame buffer!

Returns
Finest pyramid layer frame

◆ finestLayer() [2/2]

const Frame & Ocean::CV::FramePyramid::finestLayer ( ) const
inline

Returns the finest layer frame of this pyramid.

Beware: The frame will not be the owner of the frame data, if you need a copy of this frame enforce to copy the frame buffer!

Returns
Finest pyramid layer frame

◆ finestWidth()

unsigned int Ocean::CV::FramePyramid::finestWidth ( ) const
inline

Returns the width of the finest (first) layer.

Returns
Width in pixel

◆ frameType()

const FrameType & Ocean::CV::FramePyramid::frameType ( ) const
inline

Returns the frame type of the finest layer.

Beware: Ensure that the pyramid holds at least one pyramid layer before calling this function.

Returns
Frame type

◆ height()

unsigned int Ocean::CV::FramePyramid::height ( const unsigned int  layer) const
inline

Returns the height of a given layer.

Parameters
layerThe layer to return the height for, with range [0, layers())
Returns
Height in pixel

◆ idealLayers() [1/3]

static unsigned int Ocean::CV::FramePyramid::idealLayers ( const unsigned int  width,
const unsigned int  height,
const unsigned int  invalidCoarsestWidth,
const unsigned int  invalidCoarsestHeight,
const unsigned int  layerFactor,
const unsigned int  maximalRadius = (unsigned int)(-1),
const unsigned int  coarsestLayerRadius = 2u,
unsigned int *  coarsestLayerWidth = nullptr,
unsigned int *  coarsestLayerHeight = nullptr 
)
static

Determines the number of layers until an invalid frame size would be reached in the next layer or an overall size radius is reached.

Parameters
widthThe width of the finest layer in pixel
heightThe height of the finest layer in pixel
invalidCoarsestWidthWidth of a coarse layer not valid any more, with range (0, infinity)
invalidCoarsestHeightHeight of a coarse layer not valid any more, with range (0, infinity)
layerFactorSize factor on each layer (a factor of 2 means that the layer dimension is halved on each layer), with range [2, infinity)
maximalRadiusMaximal radius that can be reached on the finest layer by starting with coarsestLayerRadius on the coarsest layer in pixel (the maximal expected baseline between two pixels in the finest pyramid layer), with range [1, infinity)
coarsestLayerRadiusThe search radius on the coarsest layer, with range [2, infinity)
coarsestLayerWidthOptional resulting width of the coarsest valid pyramid layer, with range [invalidCoarsestWidth + 1u, width], nullptr if not of interest
coarsestLayerHeightOptional resulting height of the coarsest valid pyramid layer, with range [invalidCoarsestHeight + 1u, height], nullptr if not of interest
Returns
Resulting layers so that the invalid frame size will not be reached, with range [1, infinity), 0 if 'width/height' is smaller or equal than 'invalidCoarsestWidth/invalidCoarsestHeight'

◆ idealLayers() [2/3]

static unsigned int Ocean::CV::FramePyramid::idealLayers ( const unsigned int  width,
const unsigned int  height,
const unsigned int  invalidCoarsestWidth,
const unsigned int  invalidCoarsestHeight,
unsigned int *  coarsestLayerWidth = nullptr,
unsigned int *  coarsestLayerHeight = nullptr 
)
static

Determines the number of layers until an invalid frame size would be reached in the next layer.

Parameters
widthThe width of the finest layer in pixel, with range [1, infinity)
heightThe height of the finest layer in pixel, with range [1, infinity)
invalidCoarsestWidthThe width of a coarse layer not valid any more, with range (0, infinity)
invalidCoarsestHeightThe height of a coarse layer not valid any more, with range (0, infinity)
coarsestLayerWidthOptional resulting width of the coarsest valid pyramid layer, with range [invalidCoarsestWidth + 1u, width], nullptr if not of interest
coarsestLayerHeightOptional resulting height of the coarsest valid pyramid layer, with range [invalidCoarsestHeight + 1u, height], nullptr if not of interest
Returns
Resulting layers so that the invalid frame size will not be reached, with range [1, infinity), 0 if 'width/height' is smaller or equal than 'invalidCoarsestWidth/invalidCoarsestHeight'

◆ idealLayers() [3/3]

static unsigned int Ocean::CV::FramePyramid::idealLayers ( const unsigned int  width,
const unsigned int  height,
const unsigned int  invalidCoarsestWidthOrHeight,
unsigned int *  coarsestLayerWidth = nullptr,
unsigned int *  coarsestLayerHeight = nullptr 
)
static

Determines the number of layers until an invalid frame size would be reached in the next layer.

Parameters
widthThe width of the finest layer in pixel, with range [1, infinity)
heightThe height of the finest layer in pixel, with range [1, infinity)
invalidCoarsestWidthOrHeightThe width or the height of a coarse layer not valid any more, with range (0, infinity)
coarsestLayerWidthOptional resulting width of the coarsest valid pyramid layer, with range [invalidCoarsestWidth + 1u, width], nullptr if not of interest
coarsestLayerHeightOptional resulting height of the coarsest valid pyramid layer, with range [invalidCoarsestHeight + 1u, height], nullptr if not of interest
Returns
Resulting layers so that the invalid frame size will not be reached, with range [1, infinity), 0 if 'width' or 'height' are smaller or equal than 'invalidCoarsestWidthOrHeight'

◆ isOwner()

bool Ocean::CV::FramePyramid::isOwner ( const unsigned int  layerIndex = AS_MANY_LAYERS_AS_POSSIBLE) const

Returns whether the frame pyramid is the owner of the entire image data or owner of a specific pyramid layer.

Parameters
layerIndexThe index of the layer to be checked, 'AS_MANY_LAYERS_AS_POSSIBLE" to check all layers
Returns
True, if so

◆ isValid()

bool Ocean::CV::FramePyramid::isValid ( ) const
inline

Returns whether this pyramid holds at least one frame layer.

Returns
True, if so

◆ layer() [1/2]

Frame & Ocean::CV::FramePyramid::layer ( const unsigned int  layer)
inline

Returns the frame of a specified layer.

Parameters
layerIndex of the layer frame to be returned, with range [0, layers())
Returns
Pyramid layer frame

◆ layer() [2/2]

const Frame & Ocean::CV::FramePyramid::layer ( const unsigned int  layer) const
inline

Returns the frame of a specified layer.

Parameters
layerIndex of the layer frame to be returned, with range [0, layers())
Returns
Pyramid layer frame

◆ layers()

unsigned int Ocean::CV::FramePyramid::layers ( ) const
inline

Returns the number of layers this pyramid holds.

Returns
Pyramid layers, with range [0, infinity)

◆ memory()

const Memory & Ocean::CV::FramePyramid::memory ( ) const
inline

Returns the pyramid's memory block.

This functions is intended for testing purposes only, don't use this function.

Returns
The pyramid's memory block, if any

◆ operator bool()

Ocean::CV::FramePyramid::operator bool ( ) const
inlineexplicit

Returns whether this pyramid holds at least one frame layer.

Returns
True, if so

◆ operator=() [1/2]

FramePyramid& Ocean::CV::FramePyramid::operator= ( const FramePyramid )
protecteddelete

Disabled assign operator Use a constructor or the move operator instead.

Returns
Reference to this object

◆ operator=() [2/2]

FramePyramid& Ocean::CV::FramePyramid::operator= ( FramePyramid &&  right)
noexcept

Move operator.

Parameters
rightThe right frame to assign
Returns
Reference to this frame

◆ operator[]() [1/2]

Frame & Ocean::CV::FramePyramid::operator[] ( const unsigned int  layer)
inline

Returns the frame of a specified layer.

Beware: The frame will not be the owner of the frame data, if you need a copy of this frame enforce to copy the frame buffer!

Parameters
layerIndex of the layer frame to be returned, with range [0, layers())
Returns
Pyramid layer frame

◆ operator[]() [2/2]

const Frame & Ocean::CV::FramePyramid::operator[] ( const unsigned int  layer) const
inline

Returns the frame of a specified layer.

Beware: The frame will not be the owner of the frame data, if you need a copy of this frame enforce to copy the frame buffer!

Parameters
layerIndex of the layer frame to be returned, with range [0, layers())
Returns
Pyramid layer frame

◆ reduceLayers()

void Ocean::CV::FramePyramid::reduceLayers ( const size_t  layers)

Reduces the number of pyramid layers.

Parameters
layersThe number of pyramid layers, with range [0, layers()]

◆ replace() [1/9]

bool Ocean::CV::FramePyramid::replace ( const DownsamplingFunction downsamplingFunction,
Frame &&  frame,
const unsigned int  layers,
Worker worker 
)

Replaces this frame pyramid based on a new frame.

The function will re-used the existing pyramid's memory if possible.
The resulting pyramid will re-used the given frame (as finest pyramid layer); thus, ensure that the frame's memory is valid as long as this pyramid exists.

Parameters
downsamplingFunctionThe custom function used to downsample the individual pyramid layers, must be valid
frameThe frame for which the pyramid will be created, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
workerOptional worker object to distribute the computation
Returns
True, if the frame pyramid was replaced
See also
replace8BitPerChannel11().

◆ replace() [2/9]

bool Ocean::CV::FramePyramid::replace ( const DownsamplingMode  downsamplingMode,
Frame &&  frame,
const unsigned int  layers,
Worker worker 
)

Replaces this frame pyramid based on a new frame.

The function will re-used the existing pyramid's memory if possible.
The resulting pyramid will re-used the given frame (as finest pyramid layer); thus, ensure that the frame's memory is valid as long as this pyramid exists.

Parameters
downsamplingModeThe downsampling mode to use when creating the individual pyramid layers, must be valid
frameThe frame for which the pyramid will be created, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
workerOptional worker object to distribute the computation
Returns
True, if the frame pyramid was replaced
See also
replace8BitPerChannel11().

◆ replace() [3/9]

bool Ocean::CV::FramePyramid::replace ( const Frame ,
const DownsamplingFunction ,
const unsigned int  layers,
Worker worker 
)
protecteddelete

Deleted function to prevent confusion between several different replace functions.

◆ replace() [4/9]

bool Ocean::CV::FramePyramid::replace ( const Frame ,
const  DownsamplingMode,
const unsigned int  layers,
Worker worker 
)
protecteddelete

Deleted function to prevent confusion between several different replace functions.

◆ replace() [5/9]

bool Ocean::CV::FramePyramid::replace ( const Frame frame,
const bool  forceOwner,
const unsigned int  layers = AS_MANY_LAYERS_AS_POSSIBLE 
)
protecteddelete

Deleted function to prevent confusion between Frame and FrameType.

Parameters
frameThe potential frame to be used
layersThe number of layers
forceOwnerThe ownership information
Returns
True, if succeeded

◆ replace() [6/9]

bool Ocean::CV::FramePyramid::replace ( const Frame frame,
const DownsamplingFunction downsamplingFunction,
const unsigned int  layers,
const bool  copyFirstLayer,
Worker worker 
)

Replaces this frame pyramid based on a new frame.

The function will re-used the existing pyramid's memory if possible.
The resulting pyramid will contain a copy of the given frame (as finest pyramid layer) or will just use the memory, depending on 'copyFirstLayer'.

Parameters
frameThe frame for which the pyramid will be created, must be valid
downsamplingFunctionThe custom function used to downsample the individual pyramid layers, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
Returns
True, if the frame pyramid was replaced
See also
replace8BitPerChannel11().

◆ replace() [7/9]

bool Ocean::CV::FramePyramid::replace ( const Frame frame,
const DownsamplingMode  downsamplingMode,
const unsigned int  layers,
const bool  copyFirstLayer,
Worker worker 
)

Replaces this frame pyramid based on a new frame.

The function will re-used the existing pyramid's memory if possible.
The resulting pyramid will contain a copy of the given frame (as finest pyramid layer) or will just use the memory, depending on 'copyFirstLayer'.

Parameters
frameThe frame for which the pyramid will be created, must be valid
downsamplingModeThe downsampling mode to use when creating the individual pyramid layers, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
Returns
True, if the frame pyramid was replaced
See also
replace8BitPerChannel11().

◆ replace() [8/9]

bool Ocean::CV::FramePyramid::replace ( const FrameType frameType,
const bool  forceOwner,
const unsigned int  layers 
)
inline

Replaces this frame pyramid with a new pyramid defined by the frame type of the finest layer.

The image content of the replaced frame pyramid will be uninitialized.

Parameters
frameTypeThe type of the finest pyramid layer, must be valid
layersThe number of layers to be created during the resizing, the resulting layers will be as many as possible but not exceed this value, with range [1, infinity)
forceOwnerTrue, to force the pyramid to be the owner of the memory afterwards; False, to allow that the pyramid is not owning the memory (because the memory is managed outside of this pyramid)
Returns
True, if succeeded

◆ replace() [9/9]

bool Ocean::CV::FramePyramid::replace ( const FrameType frameType,
const bool  reserveFirstLayerMemory,
const bool  forceOwner,
const unsigned int  layers 
)
protected

Replaces this frame pyramid with a new pyramid defined by the frame type of the finest layer.

The image content of the replaced frame pyramid will be uninitialized.

Parameters
frameTypeThe type of the finest pyramid layer, must be valid
reserveFirstLayerMemoryTrue, to reserve memory for the first pyramid layer (and to initialize the first layer frame); False, to reserve memory for the remaining pyramid layers only (and to skip initializing the first layer frame)
layersThe number of layers to be created during the resizing, the resulting layers will be as many as possible but not exceed this value, with range [1, infinity)
forceOwnerTrue, to force the pyramid to be the owner of the memory afterwards; False, to allow that the pyramid is not owning the memory (because the memory is managed outside of this pyramid)
Returns
True, if succeeded

◆ replace8BitPerChannel()

bool Ocean::CV::FramePyramid::replace8BitPerChannel ( const uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const FrameType::PixelOrigin  pixelOrigin,
const DownsamplingMode  downsamplingMode,
const unsigned int  layers,
const unsigned int  framePaddingElements,
const bool  copyFirstLayer,
Worker worker,
const FrameType::PixelFormat  pixelFormat = FrameType::FORMAT_UNDEFINED,
const Timestamp  timestamp = Timestamp(false) 
)

Replaces this frame pyramid based on a new frame.

The function will re-used the existing pyramid's memory if possible.
The resulting pyramid will contain a copy of the given frame (as finest pyramid layer).

Parameters
frameThe frame for which the pyramid will be created, must be valid
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
channelsThe number of channels the given frame has, with range [1, infinity)
pixelOriginThe pixel origin of the given frame
downsamplingModeThe downsampling mode to use when creating the individual pyramid layers, must be valid
layersNumber of pyramid layers to be created, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
pixelFormatThe explicit pixel format which will be used for each pyramid layer, must be compatible with DT_UNSIGNED_INTEGER_8 and 'channels'; FORMAT_UNDEFINED to use a generic pixel format
timestampTimestamp to be assigned to the frame pyramid (e.g., the timestamp of the frame used to created the timestamp)
Returns
True, if the frame pyramid was replaced
See also
replace().

◆ replace8BitPerChannel11() [1/2]

bool Ocean::CV::FramePyramid::replace8BitPerChannel11 ( const Frame frame,
const unsigned int  layers,
const bool  copyFirstLayer,
Worker worker 
)
inline

Replaces this frame pyramid by a new frame with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling.

This function is intentionally restrictive to reduce binary impact when used, use other function or the constructor in case more flexibility is needed an binary size does not matter.
The function will re-used the existing pyramid's memory of possible.
This function does not provide the optimal image quality for images with alpha channel, use replace() instead.

Parameters
frameThe frame for which the pyramid will be created, with 1 plane and data type DT_UNSIGNED_INTEGER_8, should not contain an alpha channel, must be valid
layersThe number of pyramid layers to be created, with range [1, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
Returns
True, if the frame pyramid was replaced
See also
isOwner(), replace().

◆ replace8BitPerChannel11() [2/2]

bool Ocean::CV::FramePyramid::replace8BitPerChannel11 ( const uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const unsigned int  channels,
const FrameType::PixelOrigin  pixelOrigin,
const unsigned int  layers,
const unsigned int  framePaddingElements,
const bool  copyFirstLayer,
Worker worker,
const FrameType::PixelFormat  pixelFormat = FrameType::FORMAT_UNDEFINED,
const Timestamp  timestamp = Timestamp(false) 
)

Replaces this frame pyramid by a new frame with 1 plane and data type DT_UNSIGNED_INTEGER_8 applying a 1-1 downsampling.

This function is intentionally restrictive to reduce binary impact when used, use other function or the constructor in case more flexibility is needed an binary size does not matter.
The function will re-used the existing pyramid's memory of possible.

Parameters
frameThe frame for which the pyramid will be created, must be valid
widthThe width of the given frame in pixel, with range [1, infinity)
heightThe height of the given frame in pixel, with range [1, infinity)
channelsThe number of channels the given frame has, with range [1, infinity)
pixelOriginThe pixel origin of the given frame
layersThe number of pyramid layers to be created, with range [1, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
copyFirstLayerTrue, to copy the memory of the first layer into the pyramid; False, to re-use the memory of the first layer only (in this case, ensure that the memory of the first layer exists as long as this pyramid exist)
workerOptional worker object to distribute the computation
pixelFormatThe explicit pixel format which will be used for each pyramid layer, must be compatible with DT_UNSIGNED_INTEGER_8 and 'channels'; FORMAT_UNDEFINED to use a generic pixel format
timestampTimestamp to be assigned to the frame pyramid (e.g., the timestamp of the frame used to created the timestamp)
Returns
True, if the frame pyramid was replaced
See also
isOwner(), replace().

◆ sizeFactor()

constexpr unsigned int Ocean::CV::FramePyramid::sizeFactor ( const unsigned int  layer)
staticconstexpr

Returns the size factor of a specified layer in relation to the finest layer.

The finest (first) layer has factor 1, the second layer has factor 2, the third layer has factor 4, ...

Parameters
layerThe layer to return the size factor for, with range [1, 31]
Returns
The resulting size factor, with range [1, infinity)

◆ width()

unsigned int Ocean::CV::FramePyramid::width ( const unsigned int  layer) const
inline

Returns the width of a given layer.

Parameters
layerThe layer to return the width for, with range [0, layers())
Returns
Width in pixel

Field Documentation

◆ AS_MANY_LAYERS_AS_POSSIBLE

constexpr unsigned int Ocean::CV::FramePyramid::AS_MANY_LAYERS_AS_POSSIBLE = (unsigned int)(-1)
staticconstexpr

Definition of a value that can be used to create as many pyramid layers as possible (so that the coarsest pyramid layer has resolution 1x1).

◆ layers_

Frames Ocean::CV::FramePyramid::layers_
protected

The individual layers of this pyramid, zero if not valid.

◆ memory_

Memory Ocean::CV::FramePyramid::memory_
protected

Optional memory which may be used by at least one pyramid layer.

◆ memoryAlignmentBytes_

constexpr size_t Ocean::CV::FramePyramid::memoryAlignmentBytes_ = 8
staticconstexprprotected

The number of bytes for memory alignment.


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