Commit 91659410 authored by Edwin Carlinet's avatar Edwin Carlinet
Browse files

Add insertion for reindexation in ndimage.

    *  mln/core/image/ndimage.hpp: Check that the new index is correct.
parent e9f9b802
...@@ -325,6 +325,7 @@ namespace mln ...@@ -325,6 +325,7 @@ namespace mln
/// \postcondition `this->index_of_point(domain().pmin) == index_first` /// \postcondition `this->index_of_point(domain().pmin) == index_first`
void reindex(size_type index_first) void reindex(size_type index_first)
{ {
mln_precondition(index_first >= m_index_first);
std::ptrdiff_t diff = index_first - m_index_first; std::ptrdiff_t diff = index_first - m_index_first;
m_ptr_origin -= diff; m_ptr_origin -= diff;
m_index_first += diff; m_index_first += diff;
......
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