Mech-Eye API 2.5.1
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
Public Member Functions
Array2D< ElementData > Class Template Reference

Represents a 2D container of data. More...

#include <Array2D.h>

Public Member Functions

 Array2D ()
 Constructor.
 
 ~Array2D ()
 Describes a destructor.
 
size_t width () const
 Returns the width of the Array2D object.
 
size_t height () const
 Returns the height of the Array2D object.
 
bool isEmpty () const
 Returns true if the Array2D object has no elements.
 
const ElementData * data () const
 Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.
 
ElementData * data ()
 Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.
 
const ElementData & operator[] (std::size_t n) const
 Returns a reference to the constant element with the specified index in the Array2D object using the operator [].
 
ElementData & operator[] (std::size_t n)
 Returns a reference to the constant element with the specified index in the Array2D object using the operator [].
 
const ElementData & at (uint32_t row, uint32_t col) const
 Returns a reference to the constant element at the specified row and column in the Array2D object.
 
ElementData & at (uint32_t row, uint32_t col)
 Returns a reference to the element at the specified row and column in the Array2D object.
 
Array2D< ElementData > clone () const
 Creates a deep copy of the Array2D object.
 
void resize (size_t width, size_t height)
 Changes the size of the Array2D object. It destroys the existing data and reallocates memory according to the new size, if the new size is different from the old size.
 
void release ()
 Deallocates the data in the Array2D object.
 

Detailed Description

template<typename ElementData>
class mmind::eye::Array2D< ElementData >

Represents a 2D container of data.

Constructor & Destructor Documentation

◆ Array2D()

template<typename ElementData >
Array2D ( )
inline

Constructor.

◆ ~Array2D()

template<typename ElementData >
~Array2D ( )
inline

Describes a destructor.

Member Function Documentation

◆ at() [1/2]

template<typename ElementData >
ElementData & at ( uint32_t  row,
uint32_t  col 
)
inline

Returns a reference to the element at the specified row and column in the Array2D object.

Parameters
rowThe index along the height dimension. An exception is thrown if the input row is greater than width.
colThe index along the width dimension. An exception is thrown if the input col is greater than height.

◆ at() [2/2]

template<typename ElementData >
const ElementData & at ( uint32_t  row,
uint32_t  col 
) const
inline

Returns a reference to the constant element at the specified row and column in the Array2D object.

Parameters
[in]rowThe index along the height dimension. An exception is thrown if the input row is greater than width.
[in]colThe index along the width dimension. An exception is thrown if the input col is greater than height.

◆ clone()

template<typename ElementData >
Array2D< ElementData > clone ( ) const
inline

Creates a deep copy of the Array2D object.

◆ data() [1/2]

template<typename ElementData >
ElementData * data ( )
inline

Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.

◆ data() [2/2]

template<typename ElementData >
const ElementData * data ( ) const
inline

Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.

◆ height()

template<typename ElementData >
size_t height ( ) const
inline

Returns the height of the Array2D object.

◆ isEmpty()

template<typename ElementData >
bool isEmpty ( ) const
inline

Returns true if the Array2D object has no elements.

◆ operator[]() [1/2]

template<typename ElementData >
ElementData & operator[] ( std::size_t  n)
inline

Returns a reference to the constant element with the specified index in the Array2D object using the operator [].

Parameters
[in]nThe index of an element. An exception is thrown if the input n is greater than width * height.

◆ operator[]() [2/2]

template<typename ElementData >
const ElementData & operator[] ( std::size_t  n) const
inline

Returns a reference to the constant element with the specified index in the Array2D object using the operator [].

Parameters
[in]nThe index of an element. An exception is thrown if the input n is greater than width * height.

◆ release()

template<typename ElementData >
void release ( )
inline

Deallocates the data in the Array2D object.

◆ resize()

template<typename ElementData >
void resize ( size_t  width,
size_t  height 
)
inline

Changes the size of the Array2D object. It destroys the existing data and reallocates memory according to the new size, if the new size is different from the old size.

Parameters
[in]widthThe new width of the Array2D object.
[in]heightThe new height of the Array2D object.

◆ width()

template<typename ElementData >
size_t width ( ) const
inline

Returns the width of the Array2D object.


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