Template Class Frame

Class Documentation

template<typename ElementType>
class Frame

Definition of data structure in device capturing image.

Public Functions

inline Frame()

Constructor

inline ~Frame()

Destructor

inline uint32_t width() const

Returns the width of the Frame

inline uint32_t height() const

Returns the height of the Frame

inline bool empty() const

Returns true if the Frame has no elements.

inline const ElementType *data() const

Returns the pointer to the element data.

inline ElementType *data()

Returns the pointer to the element data.

inline const ElementType &operator[](std::size_t n) const

Returns a const element reference to the specified index in the Frame using the operator [].

Parameters

n – Index along the one dimension. It will throw an exception if the input n is greater than width * height.

inline ElementType &operator[](std::size_t n)

Returns a element reference to the specified index in the Frame using the operator [].

Parameters

n – Index along the one dimension. It will throw an exception if the input n is greater than width * height.

inline const ElementType &at(uint32_t row, uint32_t col) const

Returns a const element reference to the specified row and col index in the Frame.

Parameters
  • row – Index along the dimension height. It will throw an exception if the input row is greater than width.

  • col – Index along the dimension width. It will throw an exception if the input col is greater than height.

inline ElementType &at(uint32_t row, uint32_t col)

Returns an element reference to the specified row and col index in the Frame.

Parameters
  • row – Index along the dimension height. It will throw an exception if the input row is greater than width.

  • col – Index along the dimension width. It will throw an exception if the input col is greater than height.

inline void resize(uint32_t width, uint32_t height)

Change the Frame size to a new one. It will destroy the existing data and reallocate memory according to the new size.

Parameters
  • width – New number of the Frame width.

  • height – New number of the Frame height.

inline void release()

Deallocated the Frame data.