https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Rename mln::clone as mln::duplicate.
Clone is renamed for a couple of reasons:
- a kernel routine is named clone so the user can get strange
errors when missing including mln/routine/clone;
- clone is a cs term and it is not very expressive for image
processing partitioners.
* mln/core/routine/clone.hh: Rename as...
* mln/core/routine/duplicate.hh: ...this.
* tests/core/routine/clone.cc: Rename as...
* tests/core/routine/duplicate.cc: ...this.
* tests/unit_test/mln_core_routine_clone.cc: Rename as...
* tests/unit_test/mln_core_routine_duplicate.cc: ...this.
* mln/core/image/plain.hh,
* mln/core/routine/essential.hh,
* mln/core/routine/all.hh,
* mln/transform/internal/influence_zone_functor.hh,
* mln/border/resize.hh,
* mln/geom/seeds2tiling_roundness.hh,
* mln/geom/seeds2tiling.hh,
* mln/geom/resize.hh,
* mln/morpho/elementary/dilation.hh,
* mln/morpho/elementary/like_ero_set.hh,
* mln/morpho/elementary/gradient_internal.hh,
* mln/morpho/elementary/erosion.hh,
* mln/morpho/elementary/gradient_external.hh,
* mln/morpho/erosion.hh,
* mln/morpho/general.spe.hh,
* mln/morpho/dilation.hh,
* mln/morpho/includes.hh,
* mln/canvas/distance_geodesic.hh,
* tools/area_flooding.cc,
* tests/arith/plus.cc,
* tests/level/transform_inplace.cc,
* tests/level/apply_full.cc,
* tests/level/saturate_full.cc,
* tests/border/find_full.cc,
* tests/border/find.cc,
* doc/tutorial/samples/ima2d-6-clone.cc (clone): Replace by...
(duplicate): ...this.
doc/tutorial/samples/ima2d-6-clone.cc | 2 +-
mln/border/resize.hh | 4 ++--
mln/canvas/distance_geodesic.hh | 2 +-
mln/core/image/plain.hh | 6 +++---
mln/core/routine/all.hh | 2 +-
mln/core/routine/duplicate.hh | 14 +++++++-------
mln/core/routine/essential.hh | 2 +-
mln/geom/resize.hh | 2 +-
mln/geom/seeds2tiling.hh | 4 ++--
mln/geom/seeds2tiling_roundness.hh | 4 ++--
mln/morpho/dilation.hh | 4 ++--
mln/morpho/elementary/dilation.hh | 2 +-
mln/morpho/elementary/erosion.hh | 2 +-
mln/morpho/elementary/gradient_external.hh | 2 +-
mln/morpho/elementary/gradient_internal.hh | 2 +-
mln/morpho/elementary/like_ero_set.hh | 12 ++++++------
mln/morpho/erosion.hh | 4 ++--
mln/morpho/general.spe.hh | 6 +++---
mln/morpho/includes.hh | 2 +-
mln/transform/internal/influence_zone_functor.hh | 4 ++--
tests/arith/plus.cc | 4 ++--
tests/border/find.cc | 4 ++--
tests/border/find_full.cc | 2 +-
tests/core/routine/duplicate.cc | 12 ++++++------
tests/level/apply_full.cc | 4 ++--
tests/level/saturate_full.cc | 2 +-
tests/level/transform_inplace.cc | 14 +++++++-------
tools/area_flooding.cc | 6 +++---
28 files changed, 65 insertions(+), 65 deletions(-)
Index: mln/core/image/plain.hh
--- mln/core/image/plain.hh (revision 3078)
+++ mln/core/image/plain.hh (working copy)
@@ -35,7 +35,7 @@
*/
# include <mln/core/internal/image_identity.hh>
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/metal/is_not_const.hh>
@@ -126,7 +126,7 @@
template <typename I>
inline
data< plain<I> >::data(const I& ima)
- : ima_(clone(ima))
+ : ima_(duplicate(ima))
{
}
@@ -196,7 +196,7 @@
plain<I>::operator I () const
{
mln_precondition(this->has_data());
- return clone(this->data_->ima_);
+ return duplicate(this->data_->ima_);
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/routine/essential.hh
--- mln/core/routine/essential.hh (revision 3078)
+++ mln/core/routine/essential.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_ROUTINE_ESSENTIAL_HH_
# define MLN_CORE_ROUTINE_ESSENTIAL_HH_
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/core/routine/exact.hh>
# include <mln/core/routine/extend.hh>
# include <mln/core/routine/initialize.hh>
Index: mln/core/routine/all.hh
--- mln/core/routine/all.hh (revision 3078)
+++ mln/core/routine/all.hh (working copy)
@@ -36,7 +36,7 @@
*/
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/core/routine/exact.hh>
# include <mln/core/routine/extend.hh>
# include <mln/core/routine/initialize.hh>
Index: mln/core/routine/duplicate.hh
--- mln/core/routine/duplicate.hh (revision 3078)
+++ mln/core/routine/duplicate.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_ROUTINE_CLONE_HH
# define MLN_CORE_ROUTINE_CLONE_HH
-/*! \file mln/core/routine/clone.hh
+/*! \file mln/core/routine/duplicate.hh
*
* \brief Clone an image, that is, get an effective copy.
*/
@@ -44,29 +44,29 @@
/*! \brief Clone the image \p model with the values of the image \p
* data.
*
- * \param[in] model The image to be cloneed.
- * \result The clone.
+ * \param[in] model The image to be duplicateed.
+ * \result The duplicate.
*
* \pre model.has_data
*/
template <typename I>
- mln_concrete(I) clone(const Image<I>& model);
+ mln_concrete(I) duplicate(const Image<I>& model);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
inline
- mln_concrete(I) clone(const Image<I>& model)
+ mln_concrete(I) duplicate(const Image<I>& model)
{
// FIXME: Add a static check that mln_concrete(I) actually *is* concrete...
- trace::entering("core::clone");
+ trace::entering("core::duplicate");
mln_concrete(I) tmp;
initialize(tmp, model);
data::fill(tmp, model);
- trace::exiting("core::clone");
+ trace::exiting("core::duplicate");
return tmp;
}
Property changes on: mln/core/routine/duplicate.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/transform/internal/influence_zone_functor.hh
--- mln/transform/internal/influence_zone_functor.hh (revision 3078)
+++ mln/transform/internal/influence_zone_functor.hh (working copy)
@@ -32,7 +32,7 @@
///
/// Influence zone functor.
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
@@ -67,7 +67,7 @@
void
influence_zone_functor<I>::init(const I& input)
{
- output = clone(input);
+ output = duplicate(input);
}
template <typename I>
Index: mln/border/resize.hh
--- mln/border/resize.hh (revision 3078)
+++ mln/border/resize.hh (working copy)
@@ -39,7 +39,7 @@
/// instance an image extended by an image, or a stack of images.
# include <mln/core/concept/image.hh>
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/core/routine/primary.hh>
# include <mln/border/get.hh>
# include <mln/data/fill.hh>
@@ -79,7 +79,7 @@
if (border::get(ima) == thickness)
return; // No-op.
- mln_concrete(I) memo = clone(ima);
+ mln_concrete(I) memo = duplicate(ima);
ima.resize_(thickness);
data::fill(ima, memo);
Index: mln/geom/seeds2tiling_roundness.hh
--- mln/geom/seeds2tiling_roundness.hh (revision 3078)
+++ mln/geom/seeds2tiling_roundness.hh (working copy)
@@ -40,7 +40,7 @@
# include <mln/core/alias/w_window2d_int.hh>
# include <mln/core/site_set/p_priority.hh>
# include <mln/core/site_set/p_queue_fast.hh>
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/accu/mean.hh>
# include <mln/estim/min_max.hh>
# include <mln/algebra/vec.hh>
@@ -88,7 +88,7 @@
I& ima = exact(ima_);
const N& nbh = exact(nbh_);
image2d<unsigned> dist = geom::chamfer(ima, w_win, max);
- I out = clone(ima_);
+ I out = duplicate(ima_);
p_priority<mln_psite(I), p_queue_fast<unsigned> > q;
// Init.
Index: mln/geom/seeds2tiling.hh
--- mln/geom/seeds2tiling.hh (revision 3078)
+++ mln/geom/seeds2tiling.hh (working copy)
@@ -38,7 +38,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/site_set/p_queue.hh>
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/accu/mean.hh>
# include <mln/estim/min_max.hh>
# include <mln/algebra/vec.hh>
@@ -76,7 +76,7 @@
trace::entering("geom::impl::seed2tiling");
I& ima = exact(ima_);
- I out = clone(ima_);
+ I out = duplicate(ima_);
const N& nbh = exact(nbh_);
p_queue<mln_psite(I)> q;
Index: mln/geom/resize.hh
--- mln/geom/resize.hh (revision 3078)
+++ mln/geom/resize.hh (working copy)
@@ -34,7 +34,7 @@
*/
# include <mln/core/concept/image.hh>
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/make/w_window1d.hh>
# include <mln/accu/mean.hh>
# include <mln/border/resize.hh>
Index: mln/morpho/elementary/dilation.hh
--- mln/morpho/elementary/dilation.hh (revision 3078)
+++ mln/morpho/elementary/dilation.hh (working copy)
@@ -72,7 +72,7 @@
bool val[] =
{
0, // ext_value
- 1, // do_clone
+ 1, // do_duplicate
0, // on_input_p
1, // on_input_n
1, // output_p
Index: mln/morpho/elementary/like_ero_set.hh
--- mln/morpho/elementary/like_ero_set.hh (revision 3078)
+++ mln/morpho/elementary/like_ero_set.hh (working copy)
@@ -67,7 +67,7 @@
bool
ext_value = val[0],
- do_clone = val[1],
+ do_duplicate = val[1],
on_input_p = val[2],
on_input_n = val[3],
output_p = val[4];
@@ -78,8 +78,8 @@
extension::adjust_fill(input, nbh, ext_value);
mln_concrete(I) output;
- if (do_clone)
- output = clone(input);
+ if (do_duplicate)
+ output = duplicate(input);
else
{
initialize(output, input);
@@ -110,7 +110,7 @@
bool
ext_value = val[0],
- do_clone = val[1],
+ do_duplicate = val[1],
on_input_p = val[2],
on_input_n = val[3],
output_p = val[4];
@@ -121,8 +121,8 @@
extension::adjust_fill(input, nbh, ext_value);
mln_concrete(I) output;
- if (do_clone)
- output = clone(input);
+ if (do_duplicate)
+ output = duplicate(input);
else
{
initialize(output, input);
Index: mln/morpho/elementary/gradient_internal.hh
--- mln/morpho/elementary/gradient_internal.hh (revision 3078)
+++ mln/morpho/elementary/gradient_internal.hh (working copy)
@@ -83,7 +83,7 @@
bool val[] =
{
1, // ext_value
- 0, // do_clone
+ 0, // do_duplicate
1, // on_input_p
0, // on_input_n
1, // output_p
Index: mln/morpho/elementary/erosion.hh
--- mln/morpho/elementary/erosion.hh (revision 3078)
+++ mln/morpho/elementary/erosion.hh (working copy)
@@ -72,7 +72,7 @@
bool val[] =
{
1, // ext_value
- 1, // do_clone
+ 1, // do_duplicate
1, // on_input_p
0, // on_input_n
0, // output_p
Index: mln/morpho/elementary/gradient_external.hh
--- mln/morpho/elementary/gradient_external.hh (revision 3078)
+++ mln/morpho/elementary/gradient_external.hh (working copy)
@@ -83,7 +83,7 @@
bool val[] =
{
0, // ext_value
- 0, // do_clone
+ 0, // do_duplicate
0, // on_input_p
1, // on_input_n
1, // output_p
Index: mln/morpho/erosion.hh
--- mln/morpho/erosion.hh (revision 3078)
+++ mln/morpho/erosion.hh (working copy)
@@ -105,7 +105,7 @@
extension::adjust_fill(input, win, true);
O output;
- output = clone(input);
+ output = duplicate(input);
mln_piter(I) p(input.domain());
mln_qiter(W) q(win, p);
@@ -137,7 +137,7 @@
extension::adjust_fill(input, win, true);
O output;
- output = clone(input);
+ output = duplicate(input);
mln_pixter(const I) p(input);
mln_qixter(const I, W) q(p, win);
Index: mln/morpho/general.spe.hh
--- mln/morpho/general.spe.hh (revision 3078)
+++ mln/morpho/general.spe.hh (working copy)
@@ -371,7 +371,7 @@
general_dispatch_wrt_win(const Op& op, const I& input, const
win::rectangle2d& win)
{
if (win.size() == 1)
- return clone(input);
+ return duplicate(input);
if (win.size() <= 9) // FIXME: Hard-coded!
return general_dispatch_for_generic(op, input, win);
return impl::general_rectangle2d(op, input, win);
@@ -414,7 +414,7 @@
general_dispatch_wrt_win(const Op& op, const I& input, const
win::line<M,i,C>& win)
{
if (win.size() == 1)
- return clone(input);
+ return duplicate(input);
else if (win.size() == 3)
return general_dispatch_for_generic(op, input, win);
else
@@ -456,7 +456,7 @@
general_dispatch_diagonal(const Op& op, const I& input, const W& win)
{
if (win.size() == 1)
- return clone(input);
+ return duplicate(input);
else if (win.size() == 3)
return general_dispatch_for_generic(op, input, win);
else
Index: mln/morpho/dilation.hh
--- mln/morpho/dilation.hh (revision 3078)
+++ mln/morpho/dilation.hh (working copy)
@@ -106,7 +106,7 @@
extension::adjust_fill(input, win, false);
O output;
- output = clone(input);
+ output = duplicate(input);
mln_piter(I) p(input.domain());
mln_qiter(W) q(win, p);
@@ -138,7 +138,7 @@
extension::adjust_fill(input, win, false);
O output;
- output = clone(input);
+ output = duplicate(input);
mln_pixter(const I) p(input);
mln_qixter(const I, W) q(p, win);
Index: mln/morpho/includes.hh
--- mln/morpho/includes.hh (revision 3078)
+++ mln/morpho/includes.hh (working copy)
@@ -38,7 +38,7 @@
# include <mln/core/concept/window.hh>
# include <mln/core/concept/neighborhood.hh>
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/value/ops.hh>
Index: mln/canvas/distance_geodesic.hh
--- mln/canvas/distance_geodesic.hh (revision 3078)
+++ mln/canvas/distance_geodesic.hh (working copy)
@@ -35,7 +35,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/site_set/p_queue_fast.hh>
-# include <mln/core/routine/clone.hh>
+# include <mln/core/routine/duplicate.hh>
# include <mln/data/fill.hh>
Index: tools/area_flooding.cc
--- tools/area_flooding.cc (revision 3078)
+++ tools/area_flooding.cc (working copy)
@@ -51,7 +51,7 @@
#include <mln/value/int_u8.hh>
#include <mln/value/int_u16.hh>
-#include <mln/core/routine/clone.hh>
+#include <mln/core/routine/duplicate.hh>
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
@@ -120,13 +120,13 @@
unsigned nregions = mln_max(unsigned);
unsigned max_nregions = atoi(argv[1]);
- ima_t result = clone(lg_ima);
+ ima_t result = duplicate(lg_ima);
while (area < max_area && nregions > max_nregions)
{
++area;
std::cerr << "area = " << area << " \t"
<< "nregions = " << nregions << std::endl;
- ima_t work = clone(result);
+ ima_t work = duplicate(result);
// Compute the closing.
morpho::closing_area_on_vertices(work, nbh, area, result);
// Compute the number of local minima (but get rid of the image,
Index: tests/core/routine/duplicate.cc
--- tests/core/routine/duplicate.cc (revision 3078)
+++ tests/core/routine/duplicate.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/core/routine/clone.cc
+/// \file tests/core/routine/duplicate.cc
///
-/// Tests on mln::clone.
+/// Tests on mln::duplicate.
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
@@ -36,7 +36,7 @@
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
-#include <mln/core/routine/clone.hh>
+#include <mln/core/routine/duplicate.hh>
@@ -48,14 +48,14 @@
{
box2d b = make::box2d(2,2);
- std::cout << border::find( clone(ima | b) ) << std::endl;
+ std::cout << border::find( duplicate(ima | b) ) << std::endl;
debug::println(ima | b);
- debug::println(clone(ima | b));
+ debug::println(duplicate(ima | b));
}
{
- image2d<int> ima_ = clone(ima);
+ image2d<int> ima_ = duplicate(ima);
std::cout << ima_.border() << std::endl;
ima_(point2d(1,1)) = 51;
debug::println(ima);
Property changes on: tests/core/routine/duplicate.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: tests/arith/plus.cc
--- tests/arith/plus.cc (revision 3078)
+++ tests/arith/plus.cc (working copy)
@@ -62,7 +62,7 @@
// #include <mln/core/image/image2d.hh>
-// #include <mln/core/routine/clone.hh>
+// #include <mln/core/routine/duplicate.hh>
// #include <mln/value/int_u8.hh>
// #include <mln/arith/plus.hh>
@@ -85,7 +85,7 @@
// image2d<int> ref(3,3);
// debug::iota(ref);
-// image2d<int> ima_i = clone(ref);
+// image2d<int> ima_i = duplicate(ref);
// ima_i += ima_i;
// mln_assertion(ima_i == 2 * ref);
Index: tests/level/transform_inplace.cc
--- tests/level/transform_inplace.cc (revision 3078)
+++ tests/level/transform_inplace.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/core/image/extension_val.hh>
-#include <mln/core/routine/clone.hh>
+#include <mln/core/routine/duplicate.hh>
#include <mln/fun/v2v/inc.hh>
@@ -63,7 +63,7 @@
image2d<int> ref(size, size);
debug::iota(ref);
- image2d<int> ima = clone(ref);
+ image2d<int> ima = duplicate(ref);
level::transform_inplace(ima, fun::v2v::inc<int>());
level::transform_inplace(ima, fun::v2v::dec<int>());
@@ -75,7 +75,7 @@
image1d<unsigned short> ref(size);
debug::iota(ref);
- image1d<unsigned short> ima = clone(ref);
+ image1d<unsigned short> ima = duplicate(ref);
level::transform_inplace(ima, fun::v2v::inc<int>());
level::transform_inplace(ima, fun::v2v::dec<int>());
@@ -88,7 +88,7 @@
image3d<unsigned short> ref(size, size, size);
debug::iota(ref);
- image3d<unsigned short> ima = clone(ref);
+ image3d<unsigned short> ima = duplicate(ref);
level::transform_inplace(ima, fun::v2v::inc<int>());
level::transform_inplace(ima, fun::v2v::dec<int>());
@@ -115,7 +115,7 @@
debug::iota(ref);
II ref_if = ref | fun::p2b::chess();
- I ima = clone(ref);
+ I ima = duplicate(ref);
II ima_if = ima | fun::p2b::chess();
level::transform_inplace(ima_if, fun::v2v::inc<int>());
@@ -134,7 +134,7 @@
debug::iota(ref);
II sub_ref(ref, make::box2d(4,4, 10,10));
- I ima = clone(ref);
+ I ima = duplicate(ref);
II sub_ima(ima, make::box2d(4,4, 10,10));
level::transform_inplace(sub_ima, fun::v2v::inc<int>());
@@ -150,7 +150,7 @@
I ref(size, size);
- I ima = clone(ref);
+ I ima = duplicate(ref);
II extend_ima(ima, 5);
level::transform_inplace(extend_ima, fun::v2v::inc<int>());
Index: tests/level/apply_full.cc
--- tests/level/apply_full.cc (revision 3078)
+++ tests/level/apply_full.cc (working copy)
@@ -40,7 +40,7 @@
#include <mln/value/int_s16.hh>
-#include <mln/core/routine/clone.hh>
+#include <mln/core/routine/duplicate.hh>
#include <mln/level/apply.hh>
#include <mln/debug/iota.hh>
@@ -62,7 +62,7 @@
void
chck(I& ref)
{
- I out = clone (ref);
+ I out = duplicate (ref);
mln_piter(I) p (ref.domain ());
Index: tests/level/saturate_full.cc
--- tests/level/saturate_full.cc (revision 3078)
+++ tests/level/saturate_full.cc (working copy)
@@ -40,7 +40,7 @@
#include <mln/value/int_s16.hh>
-#include <mln/core/routine/clone.hh>
+#include <mln/core/routine/duplicate.hh>
#include <mln/level/saturate.hh>
#include <mln/debug/iota.hh>
Index: tests/border/find_full.cc
--- tests/border/find_full.cc (revision 3078)
+++ tests/border/find_full.cc (working copy)
@@ -45,7 +45,7 @@
#include <mln/debug/iota.hh>
#include <mln/border/find.hh>
-#include <mln/core/routine/clone.hh>
+#include <mln/core/routine/duplicate.hh>
struct f_box1d_t : mln::Function_p2b< f_box1d_t >
Index: tests/border/find.cc
--- tests/border/find.cc (revision 3078)
+++ tests/border/find.cc (working copy)
@@ -35,7 +35,7 @@
#include <mln/debug/iota.hh>
#include <mln/border/find.hh>
-#include <mln/core/routine/clone.hh>
+#include <mln/core/routine/duplicate.hh>
@@ -46,5 +46,5 @@
debug::iota(ima);
box2d b = make::box2d(2,2);
- mln_assertion(border::find( clone(ima | b)) == 51);
+ mln_assertion(border::find( duplicate(ima | b)) == 51);
}
Property changes on: tests/unit_test/mln_core_routine_duplicate.cc:#include
___________________________________________________________________
Added: svn:mergeinfo
Index: doc/tutorial/samples/ima2d-6-clone.cc
--- doc/tutorial/samples/ima2d-6-clone.cc (revision 3078)
+++ doc/tutorial/samples/ima2d-6-clone.cc (working copy)
@@ -5,7 +5,7 @@
// \{
image2d<int> ima1(5, 5);
- image2d<int> ima3 = clone(ima1); // Makes a deep copy.
+ image2d<int> ima3 = duplicate(ima1); // Makes a deep copy.
point2d p(2, 2);
ima3(p) = 3;