You’re reading an older version of the Slamcore SDK documenation. The latest one is 23.01.

Class slamcore::ConstImageView

template<class T>
class ConstImageView

Convenience constant pixel accessor wrapper for ImageInterface.

Public Functions

inline ConstImageView(const slamcore::ImageInterface &image)

Construct ConstImageView from ImageInterface.

The image format must be suitable for the image view, this means that the bytes per pixel must fit the image view’s pixel type, otherwise a runtime error is thrown.

Parameters

image – The image to construct the view around.

inline T operator()(const std::size_t row, const std::size_t col) const

Access to a specific pixel of the image.

This should never be called with arguments row or column out of bounds, since it would cause undefined behaviour.

Parameters
  • row – Row to access to.

  • col – Column to access to.

inline T at(const std::size_t row, const std::size_t col) const

Access to a specific pixel of the image.

As opposed to operator(), this performs a bounds check, and a runtime error is thrown if the requested row or column are out of bounds.

Parameters
  • row – Row to access to.

  • col – Column to access to.