https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Propagate the update of fastest image interface namings.
* tests/level/paste.cc: Re-activate 3D tests.
* mln/debug/println_with_border.spe.hh,
* mln/debug/println_with_border.hh,
* mln/core/image/fi_adaptor.hh,
* mln/core/image/image3d.hh,
* mln/core/dpoints_pixter.hh,
* mln/core/internal/image_base.hh,
* mln/core/internal/check/image_fastest.hh,
* mln/core/pixel.hh,
* mln/core/concept/doc/image_fastest.hh,
* mln/level/memset_.hh,
* mln/level/memcpy_.hh,
* mln/border/fill.hh,
* mln/border/duplicate.hh,
* mln/canvas/labeling.hh,
* sandbox/duhamel/paste.hh,
* sandbox/duhamel/fill.hh,
* sandbox/duhamel/border_duplicate.hh,
* sandbox/duhamel/border_fill.hh,
* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh:
Update fastest interface naming.
mln/border/duplicate.hh | 6 +--
mln/border/fill.hh | 8 ++--
mln/canvas/labeling.hh | 2 -
mln/core/concept/doc/image_fastest.hh | 12 +++---
mln/core/dpoints_pixter.hh | 4 +-
mln/core/image/fi_adaptor.hh | 18 ++++-----
mln/core/image/image3d.hh | 43 ++++++++++++++---------
mln/core/internal/check/image_fastest.hh | 4 +-
mln/core/internal/image_base.hh | 5 ++
mln/core/pixel.hh | 2 -
mln/debug/println_with_border.hh | 2 -
mln/debug/println_with_border.spe.hh | 2 -
mln/level/memcpy_.hh | 8 ++--
mln/level/memset_.hh | 6 +--
sandbox/duhamel/border_duplicate.hh | 6 +--
sandbox/duhamel/border_fill.hh | 8 ++--
sandbox/duhamel/fill.hh | 2 -
sandbox/duhamel/paste.hh | 2 -
sandbox/garrigues/tiled_image2d/tiled_image2d.hh | 4 +-
sandbox/nivault/plugin-gimp/src/gimp-image.hh | 18 ++++-----
tests/level/paste.cc | 34 +++++++++---------
21 files changed, 107 insertions(+), 89 deletions(-)
Index: tests/level/paste.cc
--- tests/level/paste.cc (revision 2231)
+++ tests/level/paste.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image/image2d.hh>
-// #include <mln/core/image/image3d.hh>
+#include <mln/core/image/image3d.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/level/fill.hh>
@@ -63,20 +63,20 @@
assert(ima == (ima2 | b));
}
-// // tests in three dimension
-// {
-// box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
-// image3d<int> ima(b, 2);
-// debug::iota(ima);
-
-// box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
-// image3d<int> ima2(b2, 2);
-// debug::iota(ima2);
-
-// level::paste(ima, ima2); // Fast version.
-// assert(ima == (ima2 | b));
-
-// level::impl::generic::paste(ima, ima2); // Not so fast version...
-// assert(ima == (ima2 | b));
-// }
+ // tests in three dimension
+ {
+ box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
+ image3d<int> ima(b, 2);
+ debug::iota(ima);
+
+ box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
+ image3d<int> ima2(b2, 2);
+ debug::iota(ima2);
+
+ level::paste(ima, ima2); // Fast version.
+ assert(ima == (ima2 | b));
+
+ level::impl::generic::paste(ima, ima2); // Not so fast version...
+ assert(ima == (ima2 | b));
+ }
}
Index: mln/debug/println_with_border.spe.hh
--- mln/debug/println_with_border.spe.hh (revision 2231)
+++ mln/debug/println_with_border.spe.hh (working copy)
@@ -61,7 +61,7 @@
println_with_border(const box2d& b, const I& input)
{
const std::size_t ncols = b.ncols() + 2 * input.border();
- for (size_t i = 0; i < input.ncells(); i++)
+ for (size_t i = 0; i < input.nelements(); i++)
{
std::cout << format(input.buffer()[i]) << ' ';
if (((i + 1) % ncols) == 0)
Index: mln/debug/println_with_border.hh
--- mln/debug/println_with_border.hh (revision 2231)
+++ mln/debug/println_with_border.hh (working copy)
@@ -65,7 +65,7 @@
void
println_with_border(const S&, const I& input)
{
- for (size_t i = 0; i < input.ncells(); i++)
+ for (size_t i = 0; i < input.nelements(); i++)
std::cout << format(input.buffer()[i]) << ' ';
std::cout << std::endl;
}
Index: mln/core/image/fi_adaptor.hh
--- mln/core/image/fi_adaptor.hh (revision 2231)
+++ mln/core/image/fi_adaptor.hh (working copy)
@@ -170,7 +170,7 @@
const box2d& domain() const;
/// Give the number of cells.
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point2d& p) const;
@@ -194,10 +194,10 @@
/// Fast Image method
/// Give the offset corresponding to the delta-point \p dp.
- int offset(const dpoint2d& dp) const;
+ int delta_index(const dpoint2d& dp) const;
/// Give the point corresponding to the offset \p o.
- point2d point_at_offset(unsigned o) const;
+ point2d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -307,7 +307,7 @@
template <typename I>
std::size_t
- fi_adaptor<I>::ncells() const
+ fi_adaptor<I>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
@@ -337,7 +337,7 @@
const mln_value(I)&
fi_adaptor<I>::operator[](unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(this->data_->buffer_ + o);
}
@@ -345,7 +345,7 @@
mln_value(I)&
fi_adaptor<I>::operator[](unsigned o)
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(this->data_->buffer_ + o);
}
@@ -387,7 +387,7 @@
template <typename I>
int
- fi_adaptor<I>::offset(const dpoint2d& dp) const
+ fi_adaptor<I>::delta_index(const dpoint2d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0] * this->data_->b_.len(1) + dp[1];
@@ -396,9 +396,9 @@
template <typename I>
point2d
- fi_adaptor<I>::point_at_offset(unsigned o) const
+ fi_adaptor<I>::point_at_index(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
point2d p = make::point2d(this->data_->b_.max_row() - o /
this->data_->b_.len(1) - this->data_->b_.min_row(),
o % this->data_->b_.len(1) + this->data_->b_.min_col());
mln_postcondition(& this->operator()(p) == this->data_->buffer_ + o);
Index: mln/core/image/image3d.hh
--- mln/core/image/image3d.hh (revision 2231)
+++ mln/core/image/image3d.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -172,11 +173,14 @@
/// Give the definition domain.
const box3d& domain() const;
+ /// Give the bounding box domain.
+ const box3d& bbox() const;
+
/// Give the border thickness.
unsigned border() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point3d& p) const;
@@ -185,10 +189,10 @@
T& operator()(const point3d& p);
/// Read-only access to the image value located at offset \p o.
- const T& operator[](unsigned o) const;
+ const T& element(unsigned o) const;
/// Read-write access to the image value located at offset \p o.
- T& operator[](unsigned o);
+ T& element(unsigned o);
/// Read-only access to the image value located at (\p ind).
const T& at(int sli, int row, int col) const;
@@ -200,10 +204,10 @@
/// Fast Image method
/// Give the offset corresponding to the delta-point \p dp.
- int offset(const dpoint3d& dp) const;
+ int delta_index(const dpoint3d& dp) const;
/// Give the point corresponding to the offset \p o.
- point3d point_at_offset(unsigned o) const;
+ point3d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -400,6 +404,15 @@
template <typename T>
inline
+ const box3d&
+ image3d<T>::bbox() const
+ {
+ mln_precondition(this->has_data());
+ return data_->b_;
+ }
+
+ template <typename T>
+ inline
unsigned
image3d<T>::border() const
{
@@ -410,10 +423,10 @@
template <typename T>
inline
std::size_t
- image3d<T>::ncells() const
+ image3d<T>::nelements() const
{
mln_precondition(this->has_data());
- return data_->vb_.npoints();
+ return data_->vb_.nsites();
}
template <typename T>
@@ -446,18 +459,18 @@
template <typename T>
inline
const T&
- image3d<T>::operator[](unsigned o) const
+ image3d<T>::element(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(data_->buffer_ + o);
}
template <typename T>
inline
T&
- image3d<T>::operator[](unsigned o)
+ image3d<T>::element(unsigned o)
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(data_->buffer_ + o);
}
@@ -500,7 +513,7 @@
template <typename T>
inline
int
- image3d<T>::offset(const dpoint3d& dp) const
+ image3d<T>::delta_index(const dpoint3d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0];
@@ -510,9 +523,9 @@
template <typename T>
inline
point3d
- image3d<T>::point_at_offset(unsigned o) const
+ image3d<T>::point_at_index(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
point3d p = make::point3d(o / (data_->vb_.len(1) * data_->vb_.len(2)) +
data_->vb_.min_sli(),
(o % (data_->vb_.len(1) * data_->vb_.len(2))) / data_->vb_.len(2) +
data_->vb_.min_row(),
o % data_->vb_.len(2) + data_->vb_.min_col());
Index: mln/core/dpoints_pixter.hh
--- mln/core/dpoints_pixter.hh (revision 2231)
+++ mln/core/dpoints_pixter.hh (working copy)
@@ -264,7 +264,7 @@
dpoints_fwd_pixter<I>::init_(const Dps& dps)
{
for (unsigned i = 0; i < dps.ndpoints(); ++i)
- offset_.push_back(this->image_.offset(dps.dp(i)));
+ offset_.push_back(this->image_.delta_index(dps.dp(i)));
// offset_[0] is absolute
// other offsets are relative:
if (dps.ndpoints() > 1)
@@ -375,7 +375,7 @@
dpoints_bkd_pixter<I>::init_(const Dps& dps)
{
for (unsigned i = 0; i < dps.ndpoints(); ++i)
- offset_.push_back(this->image_.offset(dps.dp(i)));
+ offset_.push_back(this->image_.delta_index(dps.dp(i)));
// offset_[ndpoints() - 1] is absolute
// other offsets are relative:
if (dps.ndpoints() > 1)
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2231)
+++ mln/core/internal/image_base.hh (working copy)
@@ -31,6 +31,8 @@
/*! \file mln/core/internal/image_base.hh
*
* \brief Definition of the common base class for all images.
+ *
+ * \todo Provide coord iff the site is a grid point.
*/
# include <mln/core/concept/image.hh>
@@ -82,6 +84,9 @@
public image_checked_<E>
{
+ /// Coordinate associated type.
+ typedef mln_deduce(S, site, coord) coord;
+
/// Value associated type.
typedef T value;
Index: mln/core/internal/check/image_fastest.hh
--- mln/core/internal/check/image_fastest.hh (revision 2231)
+++ mln/core/internal/check/image_fastest.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Class that statically checks the interface of fastest
* images.
*
- * \todo Check and convert p in offset_at towards E::psite.
+ * \todo Check and convert p in index_of_point towards E::psite.
*/
# include <mln/core/internal/force_exact.hh>
@@ -60,7 +60,7 @@
* \warning This method is final.
*
* \pre The image has to be initialized and to own the point \p p.
- * \post p == point_at_offset(result)
+ * \post p == point_at_index(result)
*/
template <typename P>
unsigned
Index: mln/core/pixel.hh
--- mln/core/pixel.hh (revision 2231)
+++ mln/core/pixel.hh (working copy)
@@ -102,7 +102,7 @@
if (this->value_ptr_ == 0 || ! this->image_.has_data())
return false;
int o = this->value_ptr_ - this->image_.buffer();
- mln_psite(I) p = this->image_.point_at_offset(o);
+ mln_psite(I) p = this->image_.point_at_index(o);
return this->image_.has(p);
}
Index: mln/core/concept/doc/image_fastest.hh
--- mln/core/concept/doc/image_fastest.hh (revision 2231)
+++ mln/core/concept/doc/image_fastest.hh (working copy)
@@ -58,7 +58,7 @@
*
* \pre The image has to be initialized.
*/
- int offset(const dpoint& dp);
+ int delta_index(const dpoint& dp);
/*! \brief Give the point at offset \p o.
@@ -66,9 +66,9 @@
* \param[in] o An offset.
*
* \pre The image has to be initialized.
- * \pre o < ncells()
+ * \pre o < nelements()
*/
- point point_at_offset(unsigned o) const;
+ point point_at_index(unsigned o) const;
/*! \brief Give a hook to the value buffer.
@@ -83,7 +83,7 @@
*
* \param[in] o An offset.
*
- * \pre o < ncells()
+ * \pre o < nelements()
*
* \return The value at \p o (not assignable).
*/
@@ -94,7 +94,7 @@
*
* \param[in] o An offset.
*
- * \pre o < ncells()
+ * \pre o < nelements()
*
* \return The value at \p o (assignable).
*/
@@ -106,7 +106,7 @@
*
* \pre The image has to be initialized.
*/
- std::size_t ncells() const;
+ std::size_t nelements() const;
};
} // end of namespace mln::doc
Index: mln/level/memset_.hh
--- mln/level/memset_.hh (revision 2231)
+++ mln/level/memset_.hh (working copy)
@@ -131,8 +131,8 @@
P& pix = internal::force_exact<P>(pix_);
mln_precondition(pix.ima().has_data());
mln_precondition(& pix.val() >= & pix.ima()[0]);
- mln_precondition(& pix.val() < & pix.ima()[0] + pix.ima().ncells());
- mln_precondition(& pix.val() + n <= & pix.ima()[0] +
pix.ima().ncells());
+ mln_precondition(& pix.val() < & pix.ima()[0] + pix.ima().nelements());
+ mln_precondition(& pix.val() + n <= & pix.ima()[0] +
pix.ima().nelements());
impl::memset__(pix, v, n);
@@ -150,7 +150,7 @@
mln_precondition(input.has_data());
mln_precondition(input.has(p));
- mln_precondition(input.offset_at(p) + n <= input.ncells());
+ mln_precondition(input.index_of_point(p) + n <= input.nelements());
pixel<I> pix(input, p);
impl::memset__(pix, v, n);
Index: mln/level/memcpy_.hh
--- mln/level/memcpy_.hh (revision 2231)
+++ mln/level/memcpy_.hh (working copy)
@@ -126,12 +126,12 @@
mln_precondition(src.ima().has_data());
mln_precondition(&dest.val() >= &dest.ima()[0]);
- mln_precondition(&dest.val() < &dest.ima()[0] + dest.ima().ncells());
- mln_precondition(&dest.val() + n <= &dest.ima()[0] +
dest.ima().ncells());
+ mln_precondition(&dest.val() < &dest.ima()[0] +
dest.ima().nelements());
+ mln_precondition(&dest.val() + n <= &dest.ima()[0] +
dest.ima().nelements());
mln_precondition(&src.val() >= &src.ima()[0]);
- mln_precondition(&src.val() < &src.ima()[0] + src.ima().ncells());
- mln_precondition(&src.val() + n <= &src.ima()[0] + src.ima().ncells());
+ mln_precondition(&src.val() < &src.ima()[0] + src.ima().nelements());
+ mln_precondition(&src.val() + n <= &src.ima()[0] +
src.ima().nelements());
impl::memcpy__(dest, src, n);
Index: mln/border/fill.hh
--- mln/border/fill.hh (revision 2231)
+++ mln/border/fill.hh (working copy)
@@ -76,7 +76,7 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
std::memset((void*)&ima[st],
*(const int*)(&v),
end - st);
@@ -84,7 +84,7 @@
}
std::memset((void*)&ima[st],
*(const int*)(&v),
- ima.ncells () - st);
+ ima.nelements () - st);
trace::exiting("border::impl::fill_size_1_");
}
@@ -102,12 +102,12 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
for (std::size_t i = st; i < end; ++i)
const_cast<I&>(ima)[i] = v;
st = end + len_r;
}
- for (std::size_t i = st; i < ima.ncells (); ++i)
+ for (std::size_t i = st; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = v;
trace::exiting("border::impl::fill_size_n_");
Index: mln/border/duplicate.hh
--- mln/border/duplicate.hh (revision 2231)
+++ mln/border/duplicate.hh (working copy)
@@ -78,7 +78,7 @@
const_cast<I&>(ima)[i] = ima[border];
std::size_t st = border + len_c - 1;
- for (std::size_t i = st + 1; i < ima.ncells (); ++i)
+ for (std::size_t i = st + 1; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = ima[st];
trace::exiting("border::impl::duplicate_1d_");
@@ -102,7 +102,7 @@
// Duplicate
for_all (pl)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
@@ -154,7 +154,7 @@
// Duplicate
for (std::size_t j = 0; j < len_r; ++j)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
Index: mln/canvas/labeling.hh
--- mln/canvas/labeling.hh (revision 2231)
+++ mln/canvas/labeling.hh (working copy)
@@ -270,7 +270,7 @@
labeling_fastest<F>::init()
{
initialize(parent, f.input);
- for (unsigned p = 0; p < parent.ncells(); ++p)
+ for (unsigned p = 0; p < parent.nelements(); ++p)
parent[p] = p; // make_set
initialize(output, f.input);
mln::level::fill(output, 0); // FIXME: Use literal::zero.
Index: sandbox/duhamel/paste.hh
--- sandbox/duhamel/paste.hh (revision 2231)
+++ sandbox/duhamel/paste.hh (working copy)
@@ -15,7 +15,7 @@
template <typename I>
void paste(const I& data_, I& destination_)
{
- imacpy_ (destination_, data_, destination_.ncells());
+ imacpy_ (destination_, data_, destination_.nelements());
}
template <typename I, typename J>
Index: sandbox/duhamel/fill.hh
--- sandbox/duhamel/fill.hh (revision 2231)
+++ sandbox/duhamel/fill.hh (working copy)
@@ -91,7 +91,7 @@
point2d u = min;
point2d v = min + down;
std::size_t k = ima.offset (down);
- std::size_t max = ima.ncells() / k;
+ std::size_t max = ima.nelements() / k;
for (std::size_t i = 0; i < k; ++i)
*ptr++ = value;
Index: sandbox/duhamel/border_duplicate.hh
--- sandbox/duhamel/border_duplicate.hh (revision 2231)
+++ sandbox/duhamel/border_duplicate.hh (working copy)
@@ -82,7 +82,7 @@
const_cast<I&>(ima)[i] = ima[border];
std::size_t st = border + len_c - 1;
- for (std::size_t i = st + 1; i < ima.ncells (); ++i)
+ for (std::size_t i = st + 1; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = ima[st];
}
@@ -104,7 +104,7 @@
// Duplicate
for_all (pl)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
@@ -151,7 +151,7 @@
// Duplicate
for (std::size_t j = 0; j < len_r; ++j)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
Index: sandbox/duhamel/border_fill.hh
--- sandbox/duhamel/border_fill.hh (revision 2231)
+++ sandbox/duhamel/border_fill.hh (working copy)
@@ -231,7 +231,7 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
std::memset((void*)&ima[st],
*(const int*)(&v),
end - st);
@@ -239,7 +239,7 @@
}
std::memset((void*)&ima[st],
*(const int*)(&v),
- ima.ncells () - st);
+ ima.nelements () - st);
}
template <typename I>
@@ -254,12 +254,12 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
for (std::size_t i = st; i < end; ++i)
const_cast<I&>(ima)[i] = v;
st = end + len_r;
}
- for (std::size_t i = st; i < ima.ncells (); ++i)
+ for (std::size_t i = st; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = v;
}
} // end of namespace mln::border::impl
Index: sandbox/nivault/plugin-gimp/src/gimp-image.hh
--- sandbox/nivault/plugin-gimp/src/gimp-image.hh (revision 2231)
+++ sandbox/nivault/plugin-gimp/src/gimp-image.hh (working copy)
@@ -194,7 +194,7 @@
unsigned border() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// const-only access to the image value located at point \p p.
const T& operator()(const point& p) const;
@@ -218,10 +218,10 @@
/// Fast Image method
// /// Give the offset corresponding to the delta-point \p dp.
-// int offset(const dpoint2d& dp) const;
+// int delta_index(const dpoint2d& dp) const;
// /// Give the point corresponding to the offset \p o.
-// point2d point_at_offset(unsigned o) const;
+// point2d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -390,7 +390,7 @@
template <GimpImageType t>
std::size_t
- gimp_image<t>::ncells() const
+ gimp_image<t>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
@@ -438,7 +438,7 @@
// const mln_value(gimp_image<t>)&
// gimp_image<t>::operator[](unsigned o) const
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// return *(this->data_->buffer_ + o);
// }
@@ -447,7 +447,7 @@
// mln_value(gimp_image<t>)&
// gimp_image<t>::operator[](unsigned o)
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// return *(this->data_->buffer_ + o);
// }
@@ -490,7 +490,7 @@
// template <GimpImageType t>
// int
-// gimp_image<t>::offset(const dpoint2d& dp) const
+// gimp_image<t>::delta_index(const dpoint2d& dp) const
// {
// mln_precondition(this->has_data());
// int o = dp[0] * this->data_->b_.len(1) + dp[1];
@@ -500,9 +500,9 @@
// template <GimpImageType t>
// point2d
-// gimp_image<t>::point_at_offset(unsigned o) const
+// gimp_image<t>::point_at_index(unsigned o) const
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// point2d p = make::point2d(o / this->data_->b_.len(1) +
this->data_->b_.min_row(),
// o % this->data_->b_.len(1) + this->data_->b_.min_col());
// mln_postcondition(& this->operator()(p) == this->data_->buffer_ +
o);
Index: sandbox/garrigues/tiled_image2d/tiled_image2d.hh
--- sandbox/garrigues/tiled_image2d/tiled_image2d.hh (revision 2231)
+++ sandbox/garrigues/tiled_image2d/tiled_image2d.hh (working copy)
@@ -187,7 +187,7 @@
const box2d& domain() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point2d& p) const;
@@ -320,7 +320,7 @@
template <typename T>
inline
std::size_t
- tiled_image2d<T>::ncells() const
+ tiled_image2d<T>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();