Commit 9bc7070a authored by Gilles Rochefort's avatar Gilles Rochefort Committed by Davis E. King

Add some operator() to cv_image for compatibility with mmod loss. (#900)

* Add some operator() to cv_image for compatibility with mmod.

* Update documentation
parent 261f12d4
......@@ -80,6 +80,32 @@ namespace dlib
return reinterpret_cast<const pixel_type*>( _data + _widthStep*row);
}
inline const pixel_type& operator()(const long row, const long column) const
{
DLIB_ASSERT(0<= column && column < nc(),
"\tcont pixel_type& cv_image::operator()(const long rown const long column)"
<< "\n\t you have asked for an out of bounds column "
<< "\n\t column: " << column
<< "\n\t nc(): " << nc()
<< "\n\t this: " << this
);
return (*this)[row][column];
}
inline pixel_type& operator()(const long row, const long column)
{
DLIB_ASSERT(0<= column && column < nc(),
"\tcont pixel_type& cv_image::operator()(const long rown const long column)"
<< "\n\t you have asked for an out of bounds column "
<< "\n\t column: " << column
<< "\n\t nc(): " << nc()
<< "\n\t this: " << this
);
return (*this)[row][column];
}
long nr() const { return _nr; }
long nc() const { return _nc; }
long width_step() const { return _widthStep; }
......
......@@ -157,6 +157,30 @@ namespace dlib
of this image
!*/
inline const pixel_type& operator()(
const long row, const long column
) const
/*!
requires
- 0 <= row < nr()
- 0 <= column < nc()
ensures
- returns a const reference to the pixel at coordinates (row, column)
of this image
!*/
inline pixel_type& operator()(
const long row, const long column
)
/*!
requires
- 0 <= row < nr()
- 0 <= column < nc()
ensures
- returns a reference to the pixel at coordinates (row, column)
of this image
!*/
cv_image& operator= (
const cv_image& item
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment