
* apps/graph-morpho/cplx2d.hh: New symlink to... * sandbox/theo/esiee/laurent/ismm09/cplx2d.hh: ...this file. * apps/graph-morpho/morpho.hh (combine(const mln::image2d<T>&, const mln::image2d<T>&)): New function. --- milena/ChangeLog | 10 ++++++++++ milena/apps/graph-morpho/cplx2d.hh | 1 + milena/apps/graph-morpho/morpho.hh | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 0 deletions(-) create mode 120000 milena/apps/graph-morpho/cplx2d.hh diff --git a/milena/ChangeLog b/milena/ChangeLog index 667b4bc..b1c3939 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,15 @@ 2009-09-21 Roland Levillain <roland@lrde.epita.fr> + Add impl::combine for mln::image2d<T>. + + * apps/graph-morpho/cplx2d.hh: New symlink to... + * sandbox/theo/esiee/laurent/ismm09/cplx2d.hh: ...this file. + * apps/graph-morpho/morpho.hh + (combine(const mln::image2d<T>&, const mln::image2d<T>&)): + New function. + +2009-09-21 Roland Levillain <roland@lrde.epita.fr> + Add impl::combine for mln::bin_1complex_image2d. * apps/graph-morpho/morpho.hh diff --git a/milena/apps/graph-morpho/cplx2d.hh b/milena/apps/graph-morpho/cplx2d.hh new file mode 120000 index 0000000..c08d52c --- /dev/null +++ b/milena/apps/graph-morpho/cplx2d.hh @@ -0,0 +1 @@ +../../sandbox/theo/esiee/laurent/ismm09/cplx2d.hh \ No newline at end of file diff --git a/milena/apps/graph-morpho/morpho.hh b/milena/apps/graph-morpho/morpho.hh index f23fc59..70d19b1 100644 --- a/milena/apps/graph-morpho/morpho.hh +++ b/milena/apps/graph-morpho/morpho.hh @@ -37,6 +37,7 @@ Groningen, The Netherlands. */ # include <mln/core/alias/complex_image.hh> +# include <mln/core/image/image2d.hh> # include <mln/core/routine/duplicate.hh> @@ -44,6 +45,12 @@ # include <mln/core/image/complex_neighborhoods.hh> # include <mln/core/image/complex_neighborhood_piter.hh> +# include <mln/data/paste.hh> + +// FIXME: Careful, cplx2d.hh is a symlink to a file in Théo's sandbox, +// and might be changed. +# include "apps/graph-morpho/cplx2d.hh" + /*----------------------------. | Vertices-edges combinator. | @@ -76,6 +83,28 @@ namespace impl output(e) = edges(e); return output; } + + // ------------------------------------------------------------- // + // Implementations on (mln::image2d-based) cubical 2-complexes. // + // ------------------------------------------------------------- // + + /// Combine the vertices and the edges of two + /// mln::image2d<T> images to create a new graph image + /// (``operator'' \f$\ovee\f$) + template <typename T> + inline + mln::image2d<T> + combine(const mln::image2d<T>& vertices, + const mln::image2d<T>& edges) + { + mln_precondition(vertices.domain() == edges.domain()); + mln::image2d<T> output; + mln::initialize(output, vertices); + mln::data::fill(output, false); + mln::data::paste(vertices | mln::cplx2d::is_pixel, output); + mln::data::paste(edges | mln::cplx2d::is_edge, output); + return output; + } } /// Combine the vertices and the edges of two images to create a new -- 1.6.4.2