https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Rename init_with_ as init_.
* mln/core/internal/image_base.hh
(init_with_): Rename as...
(init_): ...this.
* mln/core/image2d_b.hh,
* mln/core/sub_image.hh,
* mln/core/clone.hh,
* mln/io/internal/pnm/load.hh: Update.
core/clone.hh | 2 +-
core/image2d_b.hh | 29 +++++++++++++++++++++--------
core/internal/image_base.hh | 2 +-
core/sub_image.hh | 16 ++++++++--------
io/internal/pnm/load.hh | 2 +-
5 files changed, 32 insertions(+), 19 deletions(-)
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 1157)
+++ mln/core/internal/image_base.hh (working copy)
@@ -60,7 +60,7 @@
/// Declaration of the general image initialization routine.
template <typename I, typename J>
- void init_with_(Image<I>& target, const Image<J>& model);
+ void init_(Image<I>& target, const Image<J>& model);
// FIXME: Say more about it!
Index: mln/core/image2d_b.hh
--- mln/core/image2d_b.hh (revision 1157)
+++ mln/core/image2d_b.hh (working copy)
@@ -151,7 +151,7 @@
/// Initialize an empty image.
- void init_with_(const box2d& b, unsigned bdr = border::thickness);
+ void init_(const box2d& b, unsigned bdr = border::thickness);
/// Test if \p p is valid.
@@ -208,7 +208,7 @@
{
template <typename T, typename J>
- void init_with_(image2d_b<T>& target, const J& model);
+ void init_(image2d_b<T>& target, const J& model);
} // end of namespace mln::impl
@@ -217,17 +217,30 @@
# ifndef MLN_INCLUDE_ONLY
- // impl::init_with_
+ // impl::init_
namespace impl
{
+// void init(tag::border, unsigned b, const image2d_b<T>& model)
+// {
+// b = model.border();
+// }
+
template <typename T, typename J>
- void init_with_(image2d_b<T>& target, const J& model)
+ void init_(image2d_b<T>& target, const J& model)
{
box2d b = geom::bbox(model);
unsigned bdr = border::get(model);
- target.init_with_(b, bdr);
+
+ // FIXME
+
+// box2d b;
+// init(tag::bbox, b, model);
+// unsigned bdr;
+// init(tag::border, bdr, model);
+
+ target.init_(b, bdr);
}
} // end of namespace mln::impl
@@ -313,18 +326,18 @@
template <typename T>
image2d_b<T>::image2d_b(int nrows, int ncols, unsigned bdr)
{
- init_with_(make::box2d(nrows, ncols), bdr);
+ init_(make::box2d(nrows, ncols), bdr);
}
template <typename T>
image2d_b<T>::image2d_b(const box2d& b, unsigned bdr)
{
- init_with_(b, bdr);
+ init_(b, bdr);
}
template <typename T>
void
- image2d_b<T>::init_with_(const box2d& b, unsigned bdr)
+ image2d_b<T>::init_(const box2d& b, unsigned bdr)
{
mln_precondition(! this->has_data());
this->data_ = new internal::data_< image2d_b<T> >(b, bdr);
Index: mln/core/sub_image.hh
--- mln/core/sub_image.hh (revision 1157)
+++ mln/core/sub_image.hh (working copy)
@@ -71,7 +71,7 @@
sub_image(I& ima, const S& pset);
/// Initialization.
- void init_with_(I& ima, const S& pset);
+ void init_(I& ima, const S& pset);
/// Give the definition domain.
const S& domain() const;
@@ -95,7 +95,7 @@
{
template <typename I, typename S, typename J>
- void init_with_(sub_image<I,S>& target, const J& model);
+ void init_(sub_image<I,S>& target, const J& model);
} // end of namespace mln::impl
@@ -103,18 +103,18 @@
# ifndef MLN_INCLUDE_ONLY
- // impl::init_with_
+ // impl::init_
namespace impl
{
template <typename I, typename S, typename J>
- void init_with_(sub_image<I,S>& target, const J& model)
+ void init_(sub_image<I,S>& target, const J& model)
{
I ima;
- init_with_(ima, model); // rec
+ init_(ima, model); // rec
S pset = model.domain();
- target.init_with_(ima, pset);
+ target.init_(ima, pset);
}
} // end of namespace mln::impl
@@ -145,12 +145,12 @@
template <typename I, typename S>
sub_image<I,S>::sub_image(I& ima, const S& pset)
{
- init_with_(ima, pset);
+ init_(ima, pset);
}
template <typename I, typename S>
void
- sub_image<I,S>::init_with_(I& ima, const S& pset)
+ sub_image<I,S>::init_(I& ima, const S& pset)
{
mln_precondition(! this->has_data());
this->data_ = new internal::data_< sub_image<I,S> >(ima, pset);
Index: mln/core/clone.hh
--- mln/core/clone.hh (revision 1157)
+++ mln/core/clone.hh (working copy)
@@ -58,7 +58,7 @@
{
// FIXME: Add a static check that mln_concrete(I) actually *is* concrete...
mln_concrete(I) tmp;
- impl::init_with_(tmp, exact(model));
+ impl::init_(tmp, exact(model));
level::fill(tmp, model);
return tmp;
}
Index: mln/io/internal/pnm/load.hh
--- mln/io/internal/pnm/load.hh (revision 1157)
+++ mln/io/internal/pnm/load.hh (working copy)
@@ -208,7 +208,7 @@
abort();
}
- ima.init_with(nrows, ncols);
+ ima.init_(make::box2d(nrows, ncols));
if (type = type_)
load_raw_2d(file, ima);
else