Olena-patches
  Threads by month 
                
            - ----- 2025 -----
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2024 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2023 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2022 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2021 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2020 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2019 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2018 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2017 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2016 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2015 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2014 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2013 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2012 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2011 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2010 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2009 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2008 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2007 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2006 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2005 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2004 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 
- 9625 discussions
 
                    
                        This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch exp/khalimsky has been updated
       via  d0d18bf100fa99b288d55dd025055c1c79ada3cc (commit)
      from  b0be295569b332dfffbeb4313ff208726ca01794 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
d0d18bf mln/world/k1/neighb2d.hh: New neighborhoods.
-----------------------------------------------------------------------
Summary of changes:
 milena/ChangeLog                |    4 +
 milena/mln/world/k1/neighb2d.hh |  143 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 147 insertions(+), 0 deletions(-)
 create mode 100644 milena/mln/world/k1/neighb2d.hh
hooks/post-receive
-- 
Olena, a generic and efficient image processing platform
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    27 Sep '12
                    
                        ---
 milena/ChangeLog                |    4 +
 milena/mln/world/k1/neighb2d.hh |  143 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 147 insertions(+), 0 deletions(-)
 create mode 100644 milena/mln/world/k1/neighb2d.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index dc3a807..0744148 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,9 @@
 2012-09-27  Guillaume Lazzara  <z(a)lrde.epita.fr>
 
+	* mln/world/k1/neighb2d.hh: New neighborhoods.
+
+2012-09-27  Guillaume Lazzara  <z(a)lrde.epita.fr>
+
 	More routines working on images immersed in K1.
 
 	* mln/core/concept/function.hh: Add Function_vvvv2v concept.
diff --git a/milena/mln/world/k1/neighb2d.hh b/milena/mln/world/k1/neighb2d.hh
new file mode 100644
index 0000000..7681af1
--- /dev/null
+++ b/milena/mln/world/k1/neighb2d.hh
@@ -0,0 +1,143 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief 2D neighborhood working in K1.
+
+#ifndef MLN_WORLD_K1_NEIGHB2D_HH
+# define MLN_WORLD_K1_NEIGHB2D_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/core/alias/neighb2d.hh>
+# include <mln/win/multiple.hh>
+# include <mln/make/double_neighb2d.hh>
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief 2 faces to 1 faces neighborhood.
+
+	\verbatim
+	 -
+	|x|
+	 -
+	 \endverbatim
+       */
+      const neighb2d& 2to1_faces();
+
+
+      /*! \brief 1 faces to 2 faces neighborhood.
+
+	\verbatim
+	         o
+	oxo  or  x
+	         o
+	 \endverbatim
+
+       */
+      const dbl_neighb2d& 1to2_faces();
+
+
+      /*! \brief 1 faces to 1 faces neighborhood.
+
+	\verbatim
+          |
+        -   -           |  |
+	  x       or  -      -
+        -   -           |  |
+	  |
+	 \endverbatim
+       */
+      const dbl_neighb2d& 1to1_faces()
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+      namespace internal
+      {
+
+	inline
+	bool is_row_odd(const point2d& p)
+	{
+	  return p.row() % 2;
+	}
+
+      }
+
+      typedef neighb< win::multiple<window2d, bool(*)(const point2d&)> > dbl_neighb2d;
+
+
+      const neighb2d& 2to1_faces()
+      {
+	return c4();
+      }
+
+      const dbl_neighb2d& 1to2_faces()
+      {
+	static bool 1face_h[] = { 0, 1, 0,
+				  0, 0, 0,
+				  0, 1, 0 };
+	static bool 1face_v[] = { 0, 0, 0,
+				  1, 0, 1,
+				  0, 0, 0 };
+	static dbl_neighb2d nbh = make::double_neighb2d(internal::is_row_odd, e2p_h, e2p_v);
+	return nbh;
+      }
+
+
+      const dbl_neighb2d& 1to1_faces()
+      {
+	static bool e2e_h[] = { 0, 0, 1, 0, 0,
+				0, 1, 0, 1, 0,
+				0, 0, 0, 0, 0,
+				0, 1, 0, 1, 0,
+				0, 0, 1, 0, 0 };
+	static bool e2e_v[] = { 0, 0, 0, 0, 0,
+				0, 1, 0, 1, 0,
+				1, 0, 0, 0, 1,
+				0, 1, 0, 1, 0,
+				0, 0, 0, 0, 0 };
+	static dbl_neighb2d nbh = make::double_neighb2d(internal::is_row_odd, e2e_h, e2e_v);
+	return nbh;
+      }
+
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_NEIGHB2D_HH
-- 
1.7.2.5
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch exp/khalimsky has been updated
       via  b0be295569b332dfffbeb4313ff208726ca01794 (commit)
      from  f669bdcced156e0cbf9307a77515860911ad17bd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
b0be295 More routines working on images immersed in K1.
-----------------------------------------------------------------------
Summary of changes:
 milena/ChangeLog                                   |   90 ++++++++----
 milena/mln/core/concept/function.hh                |   41 +++++
 milena/mln/world/k1/display_enlarged.hh            |    8 +-
 milena/mln/world/k1/fill_0_from_1_faces.hh         |  127 ++++++++++++++++
 milena/mln/world/k1/fill_0_from_2_faces.hh         |  127 ++++++++++++++++
 milena/mln/world/k1/fill_0_from_primary_faces.hh   |  109 ++++++++++++++
 milena/mln/world/k1/fill_1_from_2_faces.hh         |  142 ++++++++++++++++++
 milena/mln/world/k1/fill_1_from_aux_2_faces.hh     |  155 ++++++++++++++++++++
 milena/mln/world/k1/fill_2_from_1_faces.hh         |  127 ++++++++++++++++
 milena/mln/world/k1/immerse.hh                     |   18 +-
 .../k1/immerse_and_duplicate_2_to_0_1_faces.hh     |  125 ++++++++++++++++
 .../world/k1/immerse_and_duplicate_2_to_1_faces.hh |  111 ++++++++++++++
 milena/mln/world/k1/internal/face_dim.hh           |   11 ++-
 milena/mln/world/k1/is_0_face.hh                   |   12 ++-
 milena/mln/world/k1/is_1_face.hh                   |   15 ++-
 milena/mln/world/k1/is_1_face_horizontal.hh        |   11 ++-
 milena/mln/world/k1/is_1_face_vertical.hh          |   15 ++-
 milena/mln/world/k1/is_2_face.hh                   |   12 ++-
 milena/mln/world/k1/is_primary_face.hh             |   12 ++
 milena/mln/world/k1/un_immerse.hh                  |  134 +++++++++++++++--
 milena/tests/world/k1/Makefile.am                  |   18 ++-
 milena/tests/world/k1/fill_0_from_1_faces.cc       |   93 ++++++++++++
 milena/tests/world/k1/fill_0_from_2_faces.cc       |   93 ++++++++++++
 milena/tests/world/k1/fill_0_from_primary_faces.cc |   93 ++++++++++++
 milena/tests/world/k1/fill_1_from_2_faces.cc       |   94 ++++++++++++
 milena/tests/world/k1/fill_1_from_aux_2_faces.cc   |  104 +++++++++++++
 milena/tests/world/k1/fill_2_from_1_faces.cc       |   94 ++++++++++++
 .../k1/immerse_and_duplicate_2_to_0_1_faces.cc     |   55 +++++++
 .../world/k1/immerse_and_duplicate_2_to_1_faces.cc |   55 +++++++
 milena/tests/world/k1/un_immerse.cc                |   54 +++++++
 30 files changed, 2093 insertions(+), 62 deletions(-)
 create mode 100644 milena/mln/world/k1/fill_0_from_1_faces.hh
 create mode 100644 milena/mln/world/k1/fill_0_from_2_faces.hh
 create mode 100644 milena/mln/world/k1/fill_0_from_primary_faces.hh
 create mode 100644 milena/mln/world/k1/fill_1_from_2_faces.hh
 create mode 100644 milena/mln/world/k1/fill_1_from_aux_2_faces.hh
 create mode 100644 milena/mln/world/k1/fill_2_from_1_faces.hh
 create mode 100644 milena/mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh
 create mode 100644 milena/mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh
 create mode 100644 milena/tests/world/k1/fill_0_from_1_faces.cc
 create mode 100644 milena/tests/world/k1/fill_0_from_2_faces.cc
 create mode 100644 milena/tests/world/k1/fill_0_from_primary_faces.cc
 create mode 100644 milena/tests/world/k1/fill_1_from_2_faces.cc
 create mode 100644 milena/tests/world/k1/fill_1_from_aux_2_faces.cc
 create mode 100644 milena/tests/world/k1/fill_2_from_1_faces.cc
 create mode 100644 milena/tests/world/k1/immerse_and_duplicate_2_to_0_1_faces.cc
 create mode 100644 milena/tests/world/k1/immerse_and_duplicate_2_to_1_faces.cc
 create mode 100644 milena/tests/world/k1/un_immerse.cc
hooks/post-receive
-- 
Olena, a generic and efficient image processing platform
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            olena-2.0-28-gb0be295 More routines working on	images immersed in K1.
                        
                        
by Guillaume Lazzara 27 Sep '12
                    by Guillaume Lazzara 27 Sep '12
27 Sep '12
                    
                        	* mln/core/concept/function.hh: Add Function_vvvv2v concept.
	* mln/world/k1/display_enlarged.hh,
	* mln/world/k1/internal/face_dim.hh,
	* mln/world/k1/is_0_face.hh,
	* mln/world/k1/is_1_face.hh,
	* mln/world/k1/is_1_face_horizontal.hh,
	* mln/world/k1/is_1_face_vertical.hh,
	* mln/world/k1/is_2_face.hh,
	* mln/world/k1/is_primary_face.hh: Add overloads.
	* mln/world/k1/fill_0_from_1_faces.hh,
	* mln/world/k1/fill_0_from_2_faces.hh,
	* mln/world/k1/fill_0_from_primary_faces.hh,
	* mln/world/k1/fill_1_from_2_faces.hh,
	* mln/world/k1/fill_1_from_aux_2_faces.hh,
	* mln/world/k1/fill_2_from_1_faces.hh,
	* mln/world/k1/immerse.hh,
	* mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh,
	* mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh: New.
	* mln/world/k1/un_immerse.hh: Write it.
	* tests/world/k1/Makefile.am,
	* tests/world/k1/fill_0_from_1_faces.cc,
	* tests/world/k1/fill_0_from_2_faces.cc,
	* tests/world/k1/fill_0_from_primary_faces.cc,
	* tests/world/k1/fill_1_from_2_faces.cc,
	* tests/world/k1/fill_1_from_aux_2_faces.cc,
	* tests/world/k1/fill_2_from_1_faces.cc,
	* tests/world/k1/immerse_and_duplicate_2_to_0_1_faces.cc,
	* tests/world/k1/immerse_and_duplicate_2_to_1_faces.cc,
	* tests/world/k1/un_immerse.cc: New tests.
---
 milena/ChangeLog                                   |   90 ++++++++----
 milena/mln/core/concept/function.hh                |   41 +++++
 milena/mln/world/k1/display_enlarged.hh            |    8 +-
 milena/mln/world/k1/fill_0_from_1_faces.hh         |  127 ++++++++++++++++
 milena/mln/world/k1/fill_0_from_2_faces.hh         |  127 ++++++++++++++++
 milena/mln/world/k1/fill_0_from_primary_faces.hh   |  109 ++++++++++++++
 milena/mln/world/k1/fill_1_from_2_faces.hh         |  142 ++++++++++++++++++
 milena/mln/world/k1/fill_1_from_aux_2_faces.hh     |  155 ++++++++++++++++++++
 milena/mln/world/k1/fill_2_from_1_faces.hh         |  127 ++++++++++++++++
 milena/mln/world/k1/immerse.hh                     |   18 +-
 .../k1/immerse_and_duplicate_2_to_0_1_faces.hh     |  125 ++++++++++++++++
 .../world/k1/immerse_and_duplicate_2_to_1_faces.hh |  111 ++++++++++++++
 milena/mln/world/k1/internal/face_dim.hh           |   11 ++-
 milena/mln/world/k1/is_0_face.hh                   |   12 ++-
 milena/mln/world/k1/is_1_face.hh                   |   15 ++-
 milena/mln/world/k1/is_1_face_horizontal.hh        |   11 ++-
 milena/mln/world/k1/is_1_face_vertical.hh          |   15 ++-
 milena/mln/world/k1/is_2_face.hh                   |   12 ++-
 milena/mln/world/k1/is_primary_face.hh             |   12 ++
 milena/mln/world/k1/un_immerse.hh                  |  134 +++++++++++++++--
 milena/tests/world/k1/Makefile.am                  |   18 ++-
 milena/tests/world/k1/fill_0_from_1_faces.cc       |   93 ++++++++++++
 milena/tests/world/k1/fill_0_from_2_faces.cc       |   93 ++++++++++++
 milena/tests/world/k1/fill_0_from_primary_faces.cc |   93 ++++++++++++
 milena/tests/world/k1/fill_1_from_2_faces.cc       |   94 ++++++++++++
 milena/tests/world/k1/fill_1_from_aux_2_faces.cc   |  104 +++++++++++++
 milena/tests/world/k1/fill_2_from_1_faces.cc       |   94 ++++++++++++
 .../k1/immerse_and_duplicate_2_to_0_1_faces.cc     |   55 +++++++
 .../world/k1/immerse_and_duplicate_2_to_1_faces.cc |   55 +++++++
 milena/tests/world/k1/un_immerse.cc                |   54 +++++++
 30 files changed, 2093 insertions(+), 62 deletions(-)
 create mode 100644 milena/mln/world/k1/fill_0_from_1_faces.hh
 create mode 100644 milena/mln/world/k1/fill_0_from_2_faces.hh
 create mode 100644 milena/mln/world/k1/fill_0_from_primary_faces.hh
 create mode 100644 milena/mln/world/k1/fill_1_from_2_faces.hh
 create mode 100644 milena/mln/world/k1/fill_1_from_aux_2_faces.hh
 create mode 100644 milena/mln/world/k1/fill_2_from_1_faces.hh
 create mode 100644 milena/mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh
 create mode 100644 milena/mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh
 create mode 100644 milena/tests/world/k1/fill_0_from_1_faces.cc
 create mode 100644 milena/tests/world/k1/fill_0_from_2_faces.cc
 create mode 100644 milena/tests/world/k1/fill_0_from_primary_faces.cc
 create mode 100644 milena/tests/world/k1/fill_1_from_2_faces.cc
 create mode 100644 milena/tests/world/k1/fill_1_from_aux_2_faces.cc
 create mode 100644 milena/tests/world/k1/fill_2_from_1_faces.cc
 create mode 100644 milena/tests/world/k1/immerse_and_duplicate_2_to_0_1_faces.cc
 create mode 100644 milena/tests/world/k1/immerse_and_duplicate_2_to_1_faces.cc
 create mode 100644 milena/tests/world/k1/un_immerse.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index cec8c97..dc3a807 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,33 +1,71 @@
 2012-09-27  Guillaume Lazzara  <z(a)lrde.epita.fr>
 
+	More routines working on images immersed in K1.
+
+	* mln/core/concept/function.hh: Add Function_vvvv2v concept.
+
+	* mln/world/k1/display_enlarged.hh,
+	* mln/world/k1/internal/face_dim.hh,
+	* mln/world/k1/is_0_face.hh,
+	* mln/world/k1/is_1_face.hh,
+	* mln/world/k1/is_1_face_horizontal.hh,
+	* mln/world/k1/is_1_face_vertical.hh,
+	* mln/world/k1/is_2_face.hh,
+	* mln/world/k1/is_primary_face.hh: Add overloads.
+
+	* mln/world/k1/fill_0_from_1_faces.hh,
+	* mln/world/k1/fill_0_from_2_faces.hh,
+	* mln/world/k1/fill_0_from_primary_faces.hh,
+	* mln/world/k1/fill_1_from_2_faces.hh,
+	* mln/world/k1/fill_1_from_aux_2_faces.hh,
+	* mln/world/k1/fill_2_from_1_faces.hh,
+	* mln/world/k1/immerse.hh,
+	* mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh,
+	* mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh: New.
+
+	* mln/world/k1/un_immerse.hh: Write it.
+
+	* tests/world/k1/Makefile.am,
+	* tests/world/k1/fill_0_from_1_faces.cc,
+	* tests/world/k1/fill_0_from_2_faces.cc,
+	* tests/world/k1/fill_0_from_primary_faces.cc,
+	* tests/world/k1/fill_1_from_2_faces.cc,
+	* tests/world/k1/fill_1_from_aux_2_faces.cc,
+	* tests/world/k1/fill_2_from_1_faces.cc,
+	* tests/world/k1/immerse_and_duplicate_2_to_0_1_faces.cc,
+	* tests/world/k1/immerse_and_duplicate_2_to_1_faces.cc,
+	* tests/world/k1/un_immerse.cc: New tests.
+
+2012-09-27  Guillaume Lazzara  <z(a)lrde.epita.fr>
+
 	Initial commit of tools to work in K1.
 
-	* milena/mln/world/k1/display_enlarged.hh,
-	* milena/mln/world/k1/immerse.hh,
-	* milena/mln/world/k1/internal/face_dim.hh,
-	* milena/mln/world/k1/is_0_face.hh,
-	* milena/mln/world/k1/is_0_or_1_face.hh,
-	* milena/mln/world/k1/is_1_face.hh,
-	* milena/mln/world/k1/is_1_face_horizontal.hh,
-	* milena/mln/world/k1/is_1_face_vertical.hh,
-	* milena/mln/world/k1/is_2_face.hh,
-	* milena/mln/world/k1/is_primary_face.hh,
-	* milena/mln/world/k1/un_immerse.hh: New.
-
-	* milena/tests/world/k1/Makefile.am,
-	* milena/tests/world/k1/display_enlarged.cc,
-	* milena/tests/world/k1/immerse.cc,
-	* milena/tests/world/k1/is_0_face.cc,
-	* milena/tests/world/k1/is_0_or_1_face.cc,
-	* milena/tests/world/k1/is_1_face.cc,
-	* milena/tests/world/k1/is_1_face_horizontal.cc,
-	* milena/tests/world/k1/is_1_face_vertical.cc,
-	* milena/tests/world/k1/is_2_face.cc,
-	* milena/tests/world/k1/is_primary_face.cc: New tests.
-
-	* milena/tests/world/Makefile.am: Add Subdir.
-
-	* milena/mln/make/image.hh: Add overloads.
+	* mln/world/k1/display_enlarged.hh,
+	* mln/world/k1/immerse.hh,
+	* mln/world/k1/internal/face_dim.hh,
+	* mln/world/k1/is_0_face.hh,
+	* mln/world/k1/is_0_or_1_face.hh,
+	* mln/world/k1/is_1_face.hh,
+	* mln/world/k1/is_1_face_horizontal.hh,
+	* mln/world/k1/is_1_face_vertical.hh,
+	* mln/world/k1/is_2_face.hh,
+	* mln/world/k1/is_primary_face.hh,
+	* mln/world/k1/un_immerse.hh: New.
+
+	* tests/world/k1/Makefile.am,
+	* tests/world/k1/display_enlarged.cc,
+	* tests/world/k1/immerse.cc,
+	* tests/world/k1/is_0_face.cc,
+	* tests/world/k1/is_0_or_1_face.cc,
+	* tests/world/k1/is_1_face.cc,
+	* tests/world/k1/is_1_face_horizontal.cc,
+	* tests/world/k1/is_1_face_vertical.cc,
+	* tests/world/k1/is_2_face.cc,
+	* tests/world/k1/is_primary_face.cc: New tests.
+
+	* tests/world/Makefile.am: Add Subdir.
+
+	* mln/make/image.hh: Add overloads.
 
 2011-11-29  Guillaume Lazzara  <z(a)lrde.epita.fr>
 
diff --git a/milena/mln/core/concept/function.hh b/milena/mln/core/concept/function.hh
index 22e338e..4a6b241 100644
--- a/milena/mln/core/concept/function.hh
+++ b/milena/mln/core/concept/function.hh
@@ -43,6 +43,7 @@ namespace mln
   template <typename E> struct Function_v2v;
   template <typename E> struct Function_v2b;
   template <typename E> struct Function_vv2v;
+  template <typename E> struct Function_vvvv2v;
   template <typename E> struct Function_vv2b;
 
 
@@ -183,6 +184,31 @@ namespace mln
   };
 
 
+  /*----------------------------------------.
+  | (Value, Value, Value, Value) -> Value.  |
+  `----------------------------------------*/
+
+  template <>
+  struct Function_vvvv2v<void> { typedef Function<void> super; };
+
+
+  /// \brief Base class for implementation of function-objects from
+  /// four values to a value.
+  ///
+  /// The parameter \a E is the exact type.
+  ///
+  /// \ingroup modfun
+  //
+  template <typename E>
+  struct Function_vvvv2v : public Function<E>
+  {
+    typedef Function_vvvv2v<void> category;
+  protected:
+    Function_vvvv2v();
+    Function_vvvv2v(const Function_vvvv2v&);
+  };
+
+
   /*--------------------------.
   | (Value, Value) -> Boolean.|
   `--------------------------*/
@@ -297,6 +323,21 @@ namespace mln
   {
   }
 
+  // Function_vvvv2v.
+
+  template <typename E>
+  inline
+  Function_vvvv2v<E>::Function_vvvv2v()
+  {
+  }
+
+  template <typename E>
+  inline
+  Function_vvvv2v<E>::Function_vvvv2v(const Function_vvvv2v<E>& rhs)
+    : Function<E>(rhs)
+  {
+  }
+
   // Function_vv2b.
 
   template <typename E>
diff --git a/milena/mln/world/k1/display_enlarged.hh b/milena/mln/world/k1/display_enlarged.hh
index f3610c1..a247d38 100644
--- a/milena/mln/world/k1/display_enlarged.hh
+++ b/milena/mln/world/k1/display_enlarged.hh
@@ -114,21 +114,21 @@ namespace mln
 	{
 	  for (mln::def::coord col = min_col; col <= max_col; ++col)
 	  {
-	    if (is_0_face(point2d(row, col)))
+	    if (is_0_face(row, col))
 	    {
 	      output.at_(row * shift, col * shift) = ima_k1.at_(row, col);
 	    }
-	    else if (is_1_face_vertical(point2d(row, col)))
+	    else if (is_1_face_vertical(row, col))
 	    {
 	      for (mln::def::coord j = -(shift - 1); j <  (shift + 3); ++j)
 	    	output.at_(row * shift + j, col * shift) = ima_k1.at_(row, col);
 	    }
-	    else if (is_1_face_horizontal(point2d(row, col)))
+	    else if (is_1_face_horizontal(row, col))
 	    {
 	      for (mln::def::coord j = -(shift - 1); j <  (shift + 3); ++j)
 	    	output.at_(row * shift, col * shift  + j) = ima_k1.at_(row, col);
 	    }
-	    else if (is_2_face(point2d(row, col)))
+	    else if (is_2_face(row, col))
 	    {
 	      for (mln::def::coord i = -(shift - 1); i <  (shift + 3); ++i)
 	    	for (mln::def::coord j = -(shift - 1); j <  (shift + 3); ++j)
diff --git a/milena/mln/world/k1/fill_0_from_1_faces.hh b/milena/mln/world/k1/fill_0_from_1_faces.hh
new file mode 100644
index 0000000..c56f407
--- /dev/null
+++ b/milena/mln/world/k1/fill_0_from_1_faces.hh
@@ -0,0 +1,127 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Fill 1 faces in a K1 2D image using its 2 faces.
+
+#ifndef MLN_WORLD_K1_FILL_0_FROM_1_FACES_HH
+# define MLN_WORLD_K1_FILL_0_FROM_1_FACES_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_0_face.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Fill 1 faces in a K1 2D image using its 2 faces.
+
+	\param[in,out] inout A 2D image immersed in K1.
+	\param[in,out] f A functor computing a result from four values.
+
+	This function use the following neighborhood:
+
+	\verbatim
+	        |
+	       -.-
+		|
+	\endverbatim
+
+
+       */
+      template <typename I, typename F>
+      void fill_0_from_1_faces(Image<I>& inout, Function_vvvv2v<F>& f);
+
+      /// \overload
+      template <typename I, typename A>
+      void fill_0_from_1_faces(Image<I>& inout, const Accumulator<A>& accu);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+
+      template <typename I, typename F>
+      void fill_0_from_1_faces(Image<I>& inout_, Function_vvvv2v<F>& f_)
+      {
+	trace::entering("mln::world::k1::fill_0_from_1_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	F& f = exact(f_);
+
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_0_face(p))
+	    inout(p) = f(inout(p + up), inout(p + left), inout(p + right), inout(p + down));
+
+	trace::exiting("mln::world::k1::fill_0_from_1_faces");
+      }
+
+
+      template <typename I, typename A>
+      void fill_0_from_1_faces(Image<I>& inout_, const Accumulator<A>& accu_)
+      {
+	trace::entering("mln::world::k1::fill_0_from_1_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	(void) accu_;
+
+	A accu = A();
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_0_face(p))
+	  {
+	    accu.init();
+	    accu.take(inout(p + up));
+	    accu.take(inout(p + left));
+	    accu.take(inout(p + right));
+	    accu.take(inout(p + down));
+	    inout(p) = accu.to_result();
+	  }
+
+	trace::exiting("mln::world::k1::fill_0_from_1_faces");
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_FILL_0_FROM_1_FACES_HH
diff --git a/milena/mln/world/k1/fill_0_from_2_faces.hh b/milena/mln/world/k1/fill_0_from_2_faces.hh
new file mode 100644
index 0000000..7b3e57e
--- /dev/null
+++ b/milena/mln/world/k1/fill_0_from_2_faces.hh
@@ -0,0 +1,127 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Fill 1 faces in a K1 2D image using its 2 faces.
+
+#ifndef MLN_WORLD_K1_FILL_0_FROM_2_FACES_HH
+# define MLN_WORLD_K1_FILL_0_FROM_2_FACES_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_0_face.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Fill 0 faces in a K1 2D image using its 2 faces.
+
+	\param[in,out] inout A 2D image immersed in K1.
+	\param[in,out] f A functor computing a result from four values.
+
+	This function use the following neighborhood:
+
+	\verbatim
+	      x   x
+	        .
+	      x   x
+	\endverbatim
+
+
+       */
+      template <typename I, typename F>
+      void fill_0_from_2_faces(Image<I>& inout, Function_vvvv2v<F>& f);
+
+      /// \overload
+      template <typename I, typename A>
+      void fill_0_from_2_faces(Image<I>& inout, const Accumulator<A>& accu);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+
+      template <typename I, typename F>
+      void fill_0_from_2_faces(Image<I>& inout_, Function_vvvv2v<F>& f_)
+      {
+	trace::entering("mln::world::k1::fill_0_from_2_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	F& f = exact(f_);
+
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_0_face(p))
+	    inout(p) = f(inout(p + up_left), inout(p + up_right), inout(p + down_left), inout(p + down_right));
+
+	trace::exiting("mln::world::k1::fill_0_from_2_faces");
+      }
+
+
+      template <typename I, typename A>
+      void fill_0_from_2_faces(Image<I>& inout_, const Accumulator<A>& accu_)
+      {
+	trace::entering("mln::world::k1::fill_0_from_2_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	(void) accu_;
+
+	A accu = A();
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_0_face(p))
+	  {
+	    accu.init();
+	    accu.take(inout(p + up_left));
+	    accu.take(inout(p + up_right));
+	    accu.take(inout(p + down_left));
+	    accu.take(inout(p + down_right));
+	    inout(p) = accu.to_result();
+	  }
+
+	trace::exiting("mln::world::k1::fill_0_from_2_faces");
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_FILL_0_FROM_2_FACES_HH
diff --git a/milena/mln/world/k1/fill_0_from_primary_faces.hh b/milena/mln/world/k1/fill_0_from_primary_faces.hh
new file mode 100644
index 0000000..db3aed8
--- /dev/null
+++ b/milena/mln/world/k1/fill_0_from_primary_faces.hh
@@ -0,0 +1,109 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Fill 1 faces in a K1 2D image using its primary faces.
+
+#ifndef MLN_WORLD_K1_FILL_0_FROM_PRIMARY_FACES_HH
+# define MLN_WORLD_K1_FILL_0_FROM_PRIMARY_FACES_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/fill_0_from_2_faces.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Fill 0 faces in a K1 2D image using its primary faces.
+
+	\param[in,out] inout A 2D image immersed in K1.
+	\param[in,out] f A functor computing a result from four values.
+
+	This function use the following neighborhood:
+
+	\verbatim
+	      x   x
+	        .
+	      x   x
+	\endverbatim
+
+
+       */
+      template <typename I, typename F>
+      void fill_0_from_primary_faces(Image<I>& inout, Function_vvvv2v<F>& f);
+
+      /// \overload
+      template <typename I, typename A>
+      void fill_0_from_primary_faces(Image<I>& inout, const Accumulator<A>& accu);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+
+      template <typename I, typename F>
+      void fill_0_from_primary_faces(Image<I>& inout, Function_vvvv2v<F>& f)
+      {
+	trace::entering("mln::world::k1::fill_0_from_primary_faces");
+
+	mln_precondition(exact(inout).is_valid());
+
+	fill_0_from_2_faces(inout, f);
+
+	trace::exiting("mln::world::k1::fill_0_from_primary_faces");
+      }
+
+
+      template <typename I, typename A>
+      void fill_0_from_primary_faces(Image<I>& inout, const Accumulator<A>& accu)
+      {
+	trace::entering("mln::world::k1::fill_0_from_primary_faces");
+
+	mln_precondition(exact(inout).is_valid());
+
+	fill_0_from_2_faces(inout, accu);
+
+	trace::exiting("mln::world::k1::fill_0_from_primary_faces");
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_FILL_0_FROM_PRIMARY_FACES_HH
diff --git a/milena/mln/world/k1/fill_1_from_2_faces.hh b/milena/mln/world/k1/fill_1_from_2_faces.hh
new file mode 100644
index 0000000..abec694
--- /dev/null
+++ b/milena/mln/world/k1/fill_1_from_2_faces.hh
@@ -0,0 +1,142 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Fill 1 faces in a K1 2D image using its 2 faces.
+
+#ifndef MLN_WORLD_K1_FILL_1_FROM_2_FACES_HH
+# define MLN_WORLD_K1_FILL_1_FROM_2_FACES_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_1_face_vertical.hh>
+# include <mln/world/k1/is_1_face_horizontal.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Fill 1 faces in a K1 2D image using its 2 faces.
+
+	\param[in,out] inout A 2D image immersed in K1.
+	\param[in,out] f A functor computing a result from two values.
+
+	This function use the following neighborhoods:
+
+	* In case of vertical 1 faces:
+
+	\verbatim
+	      x | x
+	\endverbatim
+
+	* In case of horizontal 1 face:
+
+	\verbatim
+	        x
+		-
+		x
+	\endverbatim
+
+       */
+      template <typename I, typename F>
+      void fill_1_from_2_faces(Image<I>& inout, Function_vv2v<F>& f);
+
+      /// \overload
+      template <typename I, typename A>
+      void fill_1_from_2_faces(Image<I>& inout, const Accumulator<A>& accu);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+
+      template <typename I, typename F>
+      void fill_1_from_2_faces(Image<I>& inout_, Function_vv2v<F>& f_)
+      {
+	trace::entering("mln::world::k1::fill_1_from_2_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	F& f = exact(f_);
+
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_1_face_vertical(p))
+	    inout(p) = f(inout(p + left), inout(p + right));
+	  else if (is_1_face_horizontal(p))
+	    inout(p) = f(inout(p + up), inout(p + down));
+
+	trace::exiting("mln::world::k1::fill_1_from_2_faces");
+      }
+
+
+      template <typename I, typename A>
+      void fill_1_from_2_faces(Image<I>& inout_, const Accumulator<A>& accu_)
+      {
+	trace::entering("mln::world::k1::fill_1_from_2_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	(void) accu_;
+
+	A accu = A();
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_1_face_vertical(p))
+	  {
+	    accu.init();
+	    accu.take(inout(p + left));
+	    accu.take(inout(p + right));
+	    inout(p) = accu.to_result();
+	  }
+	  else if (is_1_face_horizontal(p))
+	  {
+	    accu.init();
+	    accu.take(inout(p + up));
+	    accu.take(inout(p + down));
+	    inout(p) = accu.to_result();
+	  }
+
+	trace::exiting("mln::world::k1::fill_1_from_2_faces");
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_FILL_1_FROM_2_FACES_HH
diff --git a/milena/mln/world/k1/fill_1_from_aux_2_faces.hh b/milena/mln/world/k1/fill_1_from_aux_2_faces.hh
new file mode 100644
index 0000000..e8a7358
--- /dev/null
+++ b/milena/mln/world/k1/fill_1_from_aux_2_faces.hh
@@ -0,0 +1,155 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Fill 1 faces in a K1 2D image using 2 faces from an
+/// auxiliary image.
+
+#ifndef MLN_WORLD_K1_FILL_1_FROM_AUX_2_FACES_HH
+# define MLN_WORLD_K1_FILL_1_FROM_AUX_2_FACES_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_1_face_vertical.hh>
+# include <mln/world/k1/is_1_face_horizontal.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Fill 1 faces in a K1 2D image using 2 faces from an
+	auxiliary image.
+
+	\param[in,out] inout A 2D image immersed in K1.
+	\param[in] aux A 2D image with the same domain as \p inout.
+	\param[in,out] f A functor computing a result from two values.
+
+	This function use the following neighborhoods:
+
+	* In case of vertical 1 faces:
+
+	\verbatim
+	      x | x
+	\endverbatim
+
+	* In case of horizontal 1 face:
+
+	\verbatim
+	        x
+		-
+		x
+	\endverbatim
+
+      */
+      template <typename I, typename J, typename F>
+      void fill_1_from_aux_2_faces(Image<I>& inout, const Image<J>& aux,
+					 Function_vv2v<F>& f);
+
+      /// \overload
+      template <typename I, typename J, typename A>
+      void fill_1_from_aux_2_faces(Image<I>& inout, const Image<J>& aux,
+					 const Accumulator<A>& accu);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+
+      template <typename I, typename J, typename F>
+      void fill_1_from_aux_2_faces(Image<I>& inout_, const Image<J>& aux_,
+					 Function_vv2v<F>& f_)
+      {
+	trace::entering("mln::world::k1::fill_1_from_aux_2_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	mln_precondition(exact(aux_).is_valid());
+	mln_precondition(exact(inout_).domain() == exact(aux_).domain());
+	I& inout = exact(inout_);
+	const J& aux = exact(aux_);
+	F& f = exact(f_);
+
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_1_face_vertical(p))
+	    inout(p) = f(aux(p + left), aux(p + right));
+	  else if (is_1_face_horizontal(p))
+	    inout(p) = f(aux(p + up), aux(p + down));
+
+	trace::exiting("mln::world::k1::fill_1_from_aux_2_faces");
+      }
+
+
+      template <typename I, typename J, typename A>
+      void fill_1_from_aux_2_faces(Image<I>& inout_, const Image<J>& aux_,
+					 const Accumulator<A>& accu_)
+      {
+	trace::entering("mln::world::k1::fill_1_from_aux_2_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	mln_precondition(exact(aux_).is_valid());
+	mln_precondition(exact(inout_).domain() == exact(aux_).domain());
+	I& inout = exact(inout_);
+	const J& aux = exact(aux_);
+	(void) accu_;
+
+	A accu = A();
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_1_face_vertical(p))
+	  {
+	    accu.init();
+	    accu.take(aux(p + left));
+	    accu.take(aux(p + right));
+	    inout(p) = accu.to_result();
+	  }
+	  else if (is_1_face_horizontal(p))
+	  {
+	    accu.init();
+	    accu.take(aux(p + up));
+	    accu.take(aux(p + down));
+	    inout(p) = accu.to_result();
+	  }
+
+	trace::exiting("mln::world::k1::fill_1_from_aux_2_faces");
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_FILL_1_FROM_AUX_2_FACES_HH
diff --git a/milena/mln/world/k1/fill_2_from_1_faces.hh b/milena/mln/world/k1/fill_2_from_1_faces.hh
new file mode 100644
index 0000000..c539e30
--- /dev/null
+++ b/milena/mln/world/k1/fill_2_from_1_faces.hh
@@ -0,0 +1,127 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Fill 2 faces in a K1 2D image using its 1 faces.
+
+#ifndef MLN_WORLD_K1_FILL_2_FROM_1_FACES_HH
+# define MLN_WORLD_K1_FILL_2_FROM_1_FACES_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_2_face.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Fill 0 faces in a K1 2D image using its 2 faces.
+
+	\param[in,out] inout A 2D image immersed in K1.
+	\param[in,out] f A functor computing a result from four values.
+
+	This function use the following neighborhood:
+
+	\verbatim
+	         -
+	        |o|
+	         -
+	\endverbatim
+
+
+       */
+      template <typename I, typename F>
+      void fill_2_from_1_faces(Image<I>& inout, Function_vvvv2v<F>& f);
+
+      /// \overload
+      template <typename I, typename A>
+      void fill_2_from_1_faces(Image<I>& inout, const Accumulator<A>& accu);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+
+      template <typename I, typename F>
+      void fill_2_from_1_faces(Image<I>& inout_, Function_vvvv2v<F>& f_)
+      {
+	trace::entering("mln::world::k1::fill_2_from_1_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	F& f = exact(f_);
+
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_2_face(p))
+	    inout(p) = f(inout(p + up), inout(p + left), inout(p + right), inout(p + down));
+
+	trace::exiting("mln::world::k1::fill_2_from_1_faces");
+      }
+
+
+      template <typename I, typename A>
+      void fill_2_from_1_faces(Image<I>& inout_, const Accumulator<A>& accu_)
+      {
+	trace::entering("mln::world::k1::fill_2_from_1_faces");
+
+	mln_precondition(exact(inout_).is_valid());
+	I& inout = exact(inout_);
+	(void) accu_;
+
+	A accu = A();
+	mln_piter(I) p(inout.domain());
+	for_all(p)
+	  if (is_2_face(p))
+	  {
+	    accu.init();
+	    accu.take(inout(p + up));
+	    accu.take(inout(p + left));
+	    accu.take(inout(p + right));
+	    accu.take(inout(p + down));
+	    inout(p) = accu.to_result();
+	  }
+
+	trace::exiting("mln::world::k1::fill_2_from_1_faces");
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_FILL_2_FROM_1_FACES_HH
diff --git a/milena/mln/world/k1/immerse.hh b/milena/mln/world/k1/immerse.hh
index 928012b..b9b58fb 100644
--- a/milena/mln/world/k1/immerse.hh
+++ b/milena/mln/world/k1/immerse.hh
@@ -66,6 +66,14 @@ namespace mln
       namespace internal
       {
 
+	/// Return the equivalent point in K1 from a point in K0.
+	inline
+	point2d immerse_point(const point2d& p)
+	{
+	  point2d tmp(2 * p.row(), 2 * p.col());
+	  return tmp;
+	}
+
 	/// \brief Return the equivalent domain in K1 from a domain in
 	/// K0.
 	template <typename B>
@@ -77,15 +85,7 @@ namespace mln
 
 	  mln_deduce(B, site, delta) one;
 	  one.set_all(1);
-	  return B(2 * b.pmin() - one, 2 * b.pmax() + one);
-	}
-
-	inline
-	point2d
-	immerse_point(const point2d& p)
-	{
-	  point2d tmp(2 * p.row(), 2 * p.col());
-	  return tmp;
+	  return B(immerse_point(b.pmin()) - one, immerse_point(b.pmax()) + one);
 	}
 
       } // end of namespace mln::world::k1::internal
diff --git a/milena/mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh b/milena/mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh
new file mode 100644
index 0000000..137f4a3
--- /dev/null
+++ b/milena/mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh
@@ -0,0 +1,125 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Immerse a 2D image into K1 and copy 2 faces data into 0 and
+/// 1 faces.
+
+#ifndef MLN_WORLD_K1_IMMERSE_AND_DUPLICATE_2_TO_0_1_FACES_HH
+# define MLN_WORLD_K1_IMMERSE_AND_DUPLICATE_2_TO_0_1_FACES_HH
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/box.hh>
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/immerse.hh>
+# include <mln/world/k1/is_1_face_vertical.hh>
+# include <mln/world/k1/is_1_face_horizontal.hh>
+# include <mln/world/k1/is_0_face.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Immerse a 2D image into K1 and copy 2 faces data into
+       *  0 and 1 faces.
+
+       Data is copied into 1 faces located at the bottom right of each
+       2 faces.
+
+	           -1 0 1 2 3
+	 0 1     -1 a a a d d
+       0 a d      0 a a a d d
+       1 b c  ->  1 a a a d d
+	          2 b b b c c
+	 	  3 b b b c c
+
+       */
+      template <typename I>
+      mln_concrete(I)
+      immerse_and_duplicate_2_to_0_1_faces(const Image<I>& ima);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+      // Facade
+
+      template <typename I>
+      mln_concrete(I) immerse_and_duplicate_2_to_0_1_faces(const Image<I>& ima_)
+      {
+	trace::entering("mln::world::k1::immerse_and_duplicate_2_to_0_1_faces");
+	mln_precondition(exact(ima_).is_valid());
+	const I& ima = exact(ima_);
+
+	mln_concrete(I) output = immerse(ima);
+
+	mln_piter(I) p(output.domain());
+	for_all(p)
+	  if (is_1_face_vertical(p))
+	  {
+	    if (output.domain().has(p + left))
+	      output(p) = output(p + left);
+	    else // Handle left border
+	      output(p) = output(p + right);
+	  }
+	  else if (is_1_face_horizontal(p))
+	  {
+	    if (output.domain().has(p + up))
+	      output(p) = output(p + up);
+	    else  // Handle top border
+	      output(p) = output(p + down);
+	  }
+	  else if (is_0_face(p))
+	  {
+	    if (output.domain().has(p + up_left))
+	      output(p) = output(p + up_left);
+	    else if (output.domain().has(p + up_right)) // Handle left border
+	      output(p) = output(p + up_right);
+	    else
+	      output(p) = output(p + down_left); // Handle top border
+	  }
+
+	// First top left corner pixel. (Special case)
+	output(output.domain().pmin()) = output(output.domain().pmin() + down_right);
+
+	trace::exiting("mln::world::k1::immerse_and_duplicate_2_to_0_1_faces");
+	return output;
+      }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IMMERSE_AND_DUPLICATE_2_TO_0_1_FACES_HH
diff --git a/milena/mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh b/milena/mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh
new file mode 100644
index 0000000..27c1eb9
--- /dev/null
+++ b/milena/mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh
@@ -0,0 +1,111 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Immerse a 2D image into K1 and copy 2 faces data into 1
+/// faces.
+
+#ifndef MLN_WORLD_K1_IMMERSE_AND_DUPLICATE_2_TO_1_FACES_HH
+# define MLN_WORLD_K1_IMMERSE_AND_DUPLICATE_2_TO_1_FACES_HH
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/box.hh>
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/immerse.hh>
+# include <mln/world/k1/is_1_face_vertical.hh>
+# include <mln/world/k1/is_1_face_horizontal.hh>
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Immerse a 2D image into K1 and copy 2 faces data into
+       *  1 faces.
+
+       Data is copied into 1 faces located at the bottom right of each
+       2 faces.
+
+	           -1 0 1 2 3
+	 0 1     -1 . a . d .
+       0 a d      0 a a a d d
+       1 b c  ->  1 . a . d .
+	          2 b b b c c
+	 	  3 . b . c .
+
+       */
+      template <typename I>
+      mln_concrete(I)
+      immerse_and_duplicate_2_to_1_faces(const Image<I>& ima);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+      // Facade
+
+      template <typename I>
+      mln_concrete(I) immerse_and_duplicate_2_to_1_faces(const Image<I>& ima_)
+      {
+	trace::entering("mln::world::k1::immerse_and_duplicate_2_to_1_faces");
+	mln_precondition(exact(ima_).is_valid());
+	const I& ima = exact(ima_);
+
+	mln_concrete(I) output = immerse(ima);
+
+	mln_piter(I) p(output.domain());
+	for_all(p)
+	  if (is_1_face_vertical(p))
+	  {
+	    if (output.domain().has(p + left))
+	      output(p) = output(p + left);
+	    else // Handle left border
+	      output(p) = output(p + right);
+	  }
+	  else if (is_1_face_horizontal(p))
+	  {
+	    if (output.domain().has(p + up))
+	      output(p) = output(p + up);
+	    else  // Handle top border
+	      output(p) = output(p + down);
+	  }
+
+	trace::exiting("mln::world::k1::immerse_and_duplicate_2_to_1_faces");
+	return output;
+      }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IMMERSE_AND_DUPLICATE_2_TO_1_FACES_HH
diff --git a/milena/mln/world/k1/internal/face_dim.hh b/milena/mln/world/k1/internal/face_dim.hh
index b933e86..34a0247 100644
--- a/milena/mln/world/k1/internal/face_dim.hh
+++ b/milena/mln/world/k1/internal/face_dim.hh
@@ -47,6 +47,9 @@ namespace mln
 	/// \brief Returns the dimension of site in K1.
 	unsigned face_dim(const point2d& p);
 
+	/// \overload
+	unsigned face_dim(const mln::def::coord& row, const mln::def::coord& col);
+
 
 # ifndef MLN_INCLUDE_ONLY
 
@@ -56,7 +59,13 @@ namespace mln
 	inline
 	unsigned face_dim(const point2d& p)
 	{
-	  return (p[0] % 2 == 0) + (p[1] % 2 == 0);
+	  return face_dim(p.row(), p.col());
+	}
+
+	inline
+	unsigned face_dim(const mln::def::coord& row, const mln::def::coord& col)
+	{
+	  return (row % 2 == 0) + (col % 2 == 0);
 	}
 
 
diff --git a/milena/mln/world/k1/is_0_face.hh b/milena/mln/world/k1/is_0_face.hh
index c9d9b0e..01878d9 100644
--- a/milena/mln/world/k1/is_0_face.hh
+++ b/milena/mln/world/k1/is_0_face.hh
@@ -46,6 +46,10 @@ namespace mln
       /// \brief Check if site is a 0 face
       bool is_0_face(const point2d& p);
 
+      /// \overload
+      bool is_0_face(const mln::def::coord& row,
+		     const mln::def::coord& col);
+
 
 # ifndef MLN_INCLUDE_ONLY
 
@@ -55,9 +59,15 @@ namespace mln
       inline
       bool is_0_face(const point2d& p)
       {
-	return internal::face_dim(p) == 0;
+	return is_0_face(p.row(), p.col());
       }
 
+      inline
+      bool is_0_face(const mln::def::coord& row,
+		     const mln::def::coord& col)
+      {
+	return internal::face_dim(row, col) == 0;
+      }
 
 # endif // ! MLN_INCLUDE_ONLY
 
diff --git a/milena/mln/world/k1/is_1_face.hh b/milena/mln/world/k1/is_1_face.hh
index aafa442..60e2fdf 100644
--- a/milena/mln/world/k1/is_1_face.hh
+++ b/milena/mln/world/k1/is_1_face.hh
@@ -47,6 +47,12 @@ namespace mln
       bool is_1_face(const point2d& p);
 
 
+      /// \overload
+      inline
+      bool is_1_face(const mln::def::coord& row,
+		     const mln::def::coord& col);
+
+
 # ifndef MLN_INCLUDE_ONLY
 
 
@@ -55,7 +61,14 @@ namespace mln
       inline
       bool is_1_face(const point2d& p)
       {
-	return internal::face_dim(p) == 1;
+	return is_1_face(p.row(), p.col());
+      }
+
+      inline
+      bool is_1_face(const mln::def::coord& row,
+		     const mln::def::coord& col)
+      {
+	return internal::face_dim(row, col) == 1;
       }
 
 
diff --git a/milena/mln/world/k1/is_1_face_horizontal.hh b/milena/mln/world/k1/is_1_face_horizontal.hh
index ff90b0c..e0e9cd8 100644
--- a/milena/mln/world/k1/is_1_face_horizontal.hh
+++ b/milena/mln/world/k1/is_1_face_horizontal.hh
@@ -47,6 +47,10 @@ namespace mln
       bool is_1_face_horizontal(const point2d& p);
 
 
+      /// \overload
+      bool is_1_face_horizontal(const mln::def::coord& row,
+				const mln::def::coord& col);
+
 # ifndef MLN_INCLUDE_ONLY
 
 
@@ -55,9 +59,14 @@ namespace mln
       inline
       bool is_1_face_horizontal(const point2d& p)
       {
-	return is_1_face(p) && p[1] % 2 == 0;
+	return is_1_face_horizontal(p.row(), p.col());
       }
 
+      bool is_1_face_horizontal(const mln::def::coord& row,
+				const mln::def::coord& col)
+      {
+	return is_1_face(row, col) && col % 2 == 0;
+      }
 
 # endif // ! MLN_INCLUDE_ONLY
 
diff --git a/milena/mln/world/k1/is_1_face_vertical.hh b/milena/mln/world/k1/is_1_face_vertical.hh
index f10067d..b96bfe3 100644
--- a/milena/mln/world/k1/is_1_face_vertical.hh
+++ b/milena/mln/world/k1/is_1_face_vertical.hh
@@ -47,6 +47,11 @@ namespace mln
       bool is_1_face_vertical(const point2d& p);
 
 
+      /// \overload
+      bool is_1_face_vertical(const mln::def::coord& row,
+			      const mln::def::coord& col);
+
+
 # ifndef MLN_INCLUDE_ONLY
 
 
@@ -55,7 +60,15 @@ namespace mln
       inline
       bool is_1_face_vertical(const point2d& p)
       {
-	return is_1_face(p) && p[0] % 2 == 0;
+	return is_1_face_vertical(p.row(), p.col());
+      }
+
+
+      inline
+      bool is_1_face_vertical(const mln::def::coord& row,
+			      const mln::def::coord& col)
+      {
+	return is_1_face(row, col) && row % 2 == 0;
       }
 
 
diff --git a/milena/mln/world/k1/is_2_face.hh b/milena/mln/world/k1/is_2_face.hh
index b3c8c98..4b40475 100644
--- a/milena/mln/world/k1/is_2_face.hh
+++ b/milena/mln/world/k1/is_2_face.hh
@@ -47,6 +47,11 @@ namespace mln
       bool is_2_face(const point2d& p);
 
 
+      /// \overload
+      bool is_2_face(const mln::def::coord& row,
+		     const mln::def::coord& col);
+
+
 # ifndef MLN_INCLUDE_ONLY
 
 
@@ -55,9 +60,14 @@ namespace mln
       inline
       bool is_2_face(const point2d& p)
       {
-	return internal::face_dim(p) == 2;
+	return is_2_face(p.row(), p.col());
       }
 
+      bool is_2_face(const mln::def::coord& row,
+		     const mln::def::coord& col)
+      {
+	return internal::face_dim(row, col) == 2;
+      }
 
 # endif // ! MLN_INCLUDE_ONLY
 
diff --git a/milena/mln/world/k1/is_primary_face.hh b/milena/mln/world/k1/is_primary_face.hh
index 572d25c..38639cc 100644
--- a/milena/mln/world/k1/is_primary_face.hh
+++ b/milena/mln/world/k1/is_primary_face.hh
@@ -47,6 +47,11 @@ namespace mln
       bool is_primary_face(const point2d& p);
 
 
+      /// \overload
+      bool is_primary_face(const mln::def::coord& row,
+			   const mln::def::coord& col);
+
+
 # ifndef MLN_INCLUDE_ONLY
 
 
@@ -58,6 +63,13 @@ namespace mln
 	return is_2_face(p);
       }
 
+      inline
+      bool is_primary_face(const mln::def::coord& row,
+			   const mln::def::coord& col)
+      {
+	return is_2_face(row, col);
+      }
+
 
 # endif // ! MLN_INCLUDE_ONLY
 
diff --git a/milena/mln/world/k1/un_immerse.hh b/milena/mln/world/k1/un_immerse.hh
index 7978be9..8506f56 100644
--- a/milena/mln/world/k1/un_immerse.hh
+++ b/milena/mln/world/k1/un_immerse.hh
@@ -1,21 +1,123 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
 
+/// \file
+///
+/// \brief Un-immerse a 2D image from K1 to K0.
 
-  inline
-  point2d
-  un_immerse(const point2d& p)
-  {
-    point2d tmp(p.row() / 2, p.col() / 2);
-    return tmp;
-  }
 
-  struct is_2_face_t : Function_v2b< is_2_face_t >
-  {
-    typedef bool result;
-    inline bool operator()(const point2d& p) const { return FIXME; } // p.row() % 2 && p.col() % 2
-  } is_2_face;
+#ifndef MLN_WORLD_K1_UN_IMMERSE_HH
+# define MLN_WORLD_K1_UN_IMMERSE_HH
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/box.hh>
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_2_face.hh>
+
+namespace mln
+{
 
-  struct is_not_2_face_t : Function_v2b< is_not_2_face_t >
+  namespace world
   {
-    typedef bool result;
-    inline bool operator()(const point2d& p) const { return FIXME; } // ! (p.row() % 2 && p.col() % 2)
-  } is_not_2_face;
+
+    namespace k1
+    {
+
+      /*! \brief Un-immerse a 2D image from K1 to K0.
+
+	\verbatim
+
+	  -1 0 1 2 3
+	-1 . - . - .            0 1
+	 0 | o | o |          0 o o
+	 1 . - . - .      ->  1 o o
+	 2 | o | o |
+	 3 . - . - .
+
+	\endverbatim
+
+       */
+      template <typename I>
+      mln_concrete(I) un_immerse(const Image<I>& ima);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+      namespace internal
+      {
+
+	/// Return the equivalent point in K1 from a point in K0.
+	inline
+	point2d un_immerse_point(const point2d& p)
+	{
+	  point2d tmp(p.row() / 2, p.col() / 2);
+	  return tmp;
+	}
+
+	/// \brief Return the equivalent domain in K0 from a domain in
+	/// K1.
+	template <typename B>
+	inline
+	B domain_K0_from_K1(const Box<B>& b_)
+	{
+	  mln_precondition(exact(b_).is_valid());
+	  const B& b = exact(b_);
+	  return B(un_immerse_point(b.pmin()), un_immerse_point(b.pmax()));
+	}
+
+      } // end of namespace mln::world::k1::internal
+
+
+
+      // Facade
+
+      template <typename I>
+      mln_concrete(I) un_immerse(const Image<I>& ima_)
+      {
+	trace::entering("mln::world::k1::un_immerse");
+	mln_precondition(exact(ima_).is_valid());
+	const I& ima = exact(ima_);
+
+	mln_concrete(I) output(internal::domain_K0_from_K1(ima.domain()));
+
+	mln_piter(I) p(ima.domain());
+	for_all(p)
+	  if (is_2_face(p))
+	    output(internal::un_immerse_point(p)) = ima(p);
+
+	trace::exiting("mln::world::k1::un_immerse");
+	return output;
+      }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_UN_IMMERSE_HH
+
diff --git a/milena/tests/world/k1/Makefile.am b/milena/tests/world/k1/Makefile.am
index daa0d94..68866fb 100644
--- a/milena/tests/world/k1/Makefile.am
+++ b/milena/tests/world/k1/Makefile.am
@@ -18,19 +18,34 @@ include $(top_srcdir)/milena/tests/tests.mk
 
 check_PROGRAMS =				\
   display_enlarged				\
+  fill_0_from_1_faces				\
+  fill_0_from_2_faces				\
+  fill_0_from_primary_faces			\
+  fill_1_from_2_faces				\
+  fill_1_from_aux_2_faces			\
+  fill_2_from_1_faces				\
   immerse					\
   immerse_and_duplicate_2_to_1_faces		\
+  immerse_and_duplicate_2_to_0_1_faces		\
   is_0_face					\
   is_0_or_1_face				\
   is_1_face					\
   is_1_face_vertical				\
   is_1_face_horizontal				\
   is_2_face					\
-  is_primary_face
+  is_primary_face				\
+  un_immerse
 
 display_enlarged_SOURCES = display_enlarged.cc
+fill_0_from_1_faces_SOURCES = fill_0_from_1_faces.cc
+fill_0_from_2_faces_SOURCES = fill_0_from_2_faces.cc
+fill_0_from_primary_faces_SOURCES = fill_0_from_primary_faces.cc
+fill_1_from_2_faces_SOURCES = fill_1_from_2_faces.cc
+fill_1_from_aux_2_faces_SOURCES = fill_1_from_aux_2_faces.cc
+fill_2_from_1_faces_SOURCES = fill_2_from_1_faces.cc
 immerse_SOURCES = immerse.cc
 immerse_and_duplicate_2_to_1_faces_SOURCES = immerse_and_duplicate_2_to_1_faces.cc
+immerse_and_duplicate_2_to_0_1_faces_SOURCES = immerse_and_duplicate_2_to_0_1_faces.cc
 is_0_face_SOURCES = is_0_face.cc
 is_0_or_1_face_SOURCES = is_0_or_1_face.cc
 is_1_face_SOURCES = is_1_face.cc
@@ -38,5 +53,6 @@ is_1_face_vertical_SOURCES = is_1_face_vertical.cc
 is_1_face_horizontal_SOURCES = is_1_face_horizontal.cc
 is_2_face_SOURCES = is_2_face.cc
 is_primary_face_SOURCES = is_primary_face.cc
+un_immerse_SOURCES = un_immerse.cc
 
 TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/world/k1/fill_0_from_1_faces.cc b/milena/tests/world/k1/fill_0_from_1_faces.cc
new file mode 100644
index 0000000..b6c1db6
--- /dev/null
+++ b/milena/tests/world/k1/fill_0_from_1_faces.cc
@@ -0,0 +1,93 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+#include <mln/accu/math/sum.hh>
+#include <mln/world/k1/fill_0_from_1_faces.hh>
+#include <mln/border/fill.hh>
+
+
+namespace mln
+{
+
+  struct sum_t : Function_vvvv2v<sum_t>
+  {
+    typedef int result;
+
+    int operator()(const int& v1, const int& v2, const int& v3, const int& v4) const
+    {
+      return v1 + v2 + v3 + v4;
+    }
+
+  };
+
+}
+
+
+
+int main()
+{
+  using namespace mln;
+
+  int refvals[5][5] = {
+    {2, 1, 3, 1, 2},
+    {1, 0, 1, 0, 1},
+    {3, 1, 4, 1, 3},
+    {1, 0, 1, 0, 1},
+    {2, 1, 3, 1, 2}
+  };
+  image2d<int> ref = make::image(refvals, point2d(-1, -1));
+
+  int vals[5][5] = {
+    {0, 1, 0, 1, 0 },
+    {1, 0, 1, 0, 1 },
+    {0, 1, 0, 1, 0 },
+    {1, 0, 1, 0, 1 },
+    {0, 1, 0, 1, 0 }
+  };
+  image2d<int> imak1 = make::image(vals, point2d(-1, -1));
+
+  /// Make sure the border is set to 0 to get deterministic results.
+  border::fill(imak1, 0);
+
+
+  // Overload with accumulator
+  {
+    accu::math::sum<int> accu;
+    world::k1::fill_0_from_1_faces(imak1, accu);
+    mln_assertion(ref == imak1);
+  }
+
+  // Overload with function
+  {
+    sum_t f;
+    world::k1::fill_0_from_1_faces(imak1, f);
+    mln_assertion(ref == imak1);
+  }
+}
diff --git a/milena/tests/world/k1/fill_0_from_2_faces.cc b/milena/tests/world/k1/fill_0_from_2_faces.cc
new file mode 100644
index 0000000..c32a0f2
--- /dev/null
+++ b/milena/tests/world/k1/fill_0_from_2_faces.cc
@@ -0,0 +1,93 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+#include <mln/accu/math/sum.hh>
+#include <mln/world/k1/fill_0_from_2_faces.hh>
+#include <mln/border/fill.hh>
+
+
+namespace mln
+{
+
+  struct sum_t : Function_vvvv2v<sum_t>
+  {
+    typedef int result;
+
+    int operator()(const int& v1, const int& v2, const int& v3, const int& v4) const
+    {
+      return v1 + v2 + v3 + v4;
+    }
+
+  };
+
+}
+
+
+
+int main()
+{
+  using namespace mln;
+
+  int refvals[5][5] = {
+    {1, 0, 2, 0, 1},
+    {0, 1, 0, 1, 0},
+    {2, 0, 4, 0, 2},
+    {0, 1, 0, 1, 0},
+    {1, 0, 2, 0, 1}
+  };
+  image2d<int> ref = make::image(refvals, point2d(-1, -1));
+
+  int vals[5][5] = {
+    {0, 0, 0, 0, 0 },
+    {0, 1, 0, 1, 0 },
+    {0, 0, 0, 0, 0 },
+    {0, 1, 0, 1, 0 },
+    {0, 0, 0, 0, 0 }
+  };
+  image2d<int> imak1 = make::image(vals, point2d(-1, -1));
+
+  /// Make sure the border is set to 0 to get deterministic results.
+  border::fill(imak1, 0);
+
+
+  // Overload with accumulator
+  {
+    accu::math::sum<int> accu;
+    world::k1::fill_0_from_2_faces(imak1, accu);
+    mln_assertion(ref == imak1);
+  }
+
+  // Overload with function
+  {
+    sum_t f;
+    world::k1::fill_0_from_2_faces(imak1, f);
+    mln_assertion(ref == imak1);
+  }
+}
diff --git a/milena/tests/world/k1/fill_0_from_primary_faces.cc b/milena/tests/world/k1/fill_0_from_primary_faces.cc
new file mode 100644
index 0000000..70b9b1a
--- /dev/null
+++ b/milena/tests/world/k1/fill_0_from_primary_faces.cc
@@ -0,0 +1,93 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+#include <mln/accu/math/sum.hh>
+#include <mln/world/k1/fill_0_from_primary_faces.hh>
+#include <mln/border/fill.hh>
+
+
+namespace mln
+{
+
+  struct sum_t : Function_vvvv2v<sum_t>
+  {
+    typedef int result;
+
+    int operator()(const int& v1, const int& v2, const int& v3, const int& v4) const
+    {
+      return v1 + v2 + v3 + v4;
+    }
+
+  };
+
+}
+
+
+
+int main()
+{
+  using namespace mln;
+
+  int refvals[5][5] = {
+    {1, 0, 2, 0, 1},
+    {0, 1, 0, 1, 0},
+    {2, 0, 4, 0, 2},
+    {0, 1, 0, 1, 0},
+    {1, 0, 2, 0, 1}
+  };
+  image2d<int> ref = make::image(refvals, point2d(-1, -1));
+
+  int vals[5][5] = {
+    {0, 0, 0, 0, 0 },
+    {0, 1, 0, 1, 0 },
+    {0, 0, 0, 0, 0 },
+    {0, 1, 0, 1, 0 },
+    {0, 0, 0, 0, 0 }
+  };
+  image2d<int> imak1 = make::image(vals, point2d(-1, -1));
+
+  /// Make sure the border is set to 0 to get deterministic results.
+  border::fill(imak1, 0);
+
+
+  // Overload with accumulator
+  {
+    accu::math::sum<int> accu;
+    world::k1::fill_0_from_primary_faces(imak1, accu);
+    mln_assertion(ref == imak1);
+  }
+
+  // Overload with function
+  {
+    sum_t f;
+    world::k1::fill_0_from_primary_faces(imak1, f);
+    mln_assertion(ref == imak1);
+  }
+}
diff --git a/milena/tests/world/k1/fill_1_from_2_faces.cc b/milena/tests/world/k1/fill_1_from_2_faces.cc
new file mode 100644
index 0000000..8822e60
--- /dev/null
+++ b/milena/tests/world/k1/fill_1_from_2_faces.cc
@@ -0,0 +1,94 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+#include <mln/accu/math/sum.hh>
+#include <mln/world/k1/fill_1_from_2_faces.hh>
+#include <mln/border/fill.hh>
+
+
+namespace mln
+{
+
+  struct sum_t : Function_vv2v<sum_t>
+  {
+    typedef int result;
+
+    int operator()(const int& v1, const int& v2) const
+    {
+      return v1 + v2;
+    }
+
+  };
+
+}
+
+
+
+int main()
+{
+  using namespace mln;
+
+  int refvals[5][5] = {
+    {1, 3, 1, 3, 1},
+    {3, 3, 6, 3, 3},
+    {1, 6, 1, 6, 1},
+    {3, 3, 6, 3, 3},
+    {1, 3, 1, 3, 1}
+  };
+  image2d<int> ref = make::image(refvals, point2d(-1, -1));
+
+  int vals[5][5] = {
+    {1, 0, 1, 0, 1 },
+    {0, 3, 0, 3, 0 },
+    {1, 0, 1, 0, 1 },
+    {0, 3, 0, 3, 0 },
+    {1, 0, 1, 0, 1 }
+  };
+  image2d<int> imak1 = make::image(vals, point2d(-1, -1));
+
+  /// Make sure the border is set to 0 to get deterministic results.
+  border::fill(imak1, 0);
+
+
+  // Overload with accumulator
+  {
+    accu::math::sum<int> accu;
+    world::k1::fill_1_from_2_faces(imak1, accu);
+    mln_assertion(ref == imak1);
+  }
+
+  // Overload with function
+  {
+    sum_t f;
+    world::k1::fill_1_from_2_faces(imak1, f);
+    mln_assertion(ref == imak1);
+  }
+
+}
diff --git a/milena/tests/world/k1/fill_1_from_aux_2_faces.cc b/milena/tests/world/k1/fill_1_from_aux_2_faces.cc
new file mode 100644
index 0000000..045f540
--- /dev/null
+++ b/milena/tests/world/k1/fill_1_from_aux_2_faces.cc
@@ -0,0 +1,104 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+#include <mln/accu/math/sum.hh>
+#include <mln/world/k1/fill_1_from_aux_2_faces.hh>
+#include <mln/border/fill.hh>
+
+
+namespace mln
+{
+
+  struct sum_t : Function_vv2v<sum_t>
+  {
+    typedef int result;
+
+    int operator()(const int& v1, const int& v2) const
+    {
+      return v1 + v2;
+    }
+
+  };
+
+}
+
+
+
+int main()
+{
+  using namespace mln;
+
+  int refvals[5][5] = {
+    {1, 1, 1, 4, 1},
+    {1, 3, 5, 3, 4},
+    {1, 5, 1, 5, 1},
+    {4, 3, 5, 3, 1},
+    {1, 4, 1, 1, 1}
+  };
+  image2d<int> ref = make::image(refvals, point2d(-1, -1));
+
+  int auxvals[5][5] = {
+    {0, 0, 0, 0, 0 },
+    {0, 1, 0, 4, 0 },
+    {0, 0, 0, 0, 0 },
+    {0, 4, 0, 1, 0 },
+    {0, 0, 0, 0, 1 }
+  };
+  image2d<int> aux = make::image(auxvals, point2d(-1, -1));
+
+
+  int vals[5][5] = {
+    {1, 0, 1, 0, 1 },
+    {0, 3, 0, 3, 0 },
+    {1, 0, 1, 0, 1 },
+    {0, 3, 0, 3, 0 },
+    {1, 0, 1, 0, 1 }
+  };
+  image2d<int> imak1 = make::image(vals, point2d(-1, -1));
+
+  /// Make sure the border is set to 0 to get deterministic results.
+  border::fill(imak1, 0);
+
+
+  // Overload with accumulator
+  {
+    accu::math::sum<int> accu;
+    world::k1::fill_1_from_aux_2_faces(imak1, aux, accu);
+    mln_assertion(ref == imak1);
+  }
+
+  // Overload with function
+  {
+    sum_t f;
+    world::k1::fill_1_from_aux_2_faces(imak1, aux, f);
+    mln_assertion(ref == imak1);
+  }
+
+}
diff --git a/milena/tests/world/k1/fill_2_from_1_faces.cc b/milena/tests/world/k1/fill_2_from_1_faces.cc
new file mode 100644
index 0000000..6fb3e96
--- /dev/null
+++ b/milena/tests/world/k1/fill_2_from_1_faces.cc
@@ -0,0 +1,94 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+#include <mln/accu/math/sum.hh>
+#include <mln/world/k1/fill_2_from_1_faces.hh>
+#include <mln/border/fill.hh>
+
+
+namespace mln
+{
+
+  struct sum_t : Function_vvvv2v<sum_t>
+  {
+    typedef int result;
+
+    int operator()(const int& v1, const int& v2, const int& v3, const int& v4) const
+    {
+      return v1 + v2 + v3 + v4;
+    }
+
+  };
+
+}
+
+
+
+int main()
+{
+  using namespace mln;
+
+  int refvals[5][5] = {
+    {0, 1, 0, 1, 0},
+    {1, 4, 1, 4, 1},
+    {0, 1, 0, 1, 0},
+    {1, 4, 1, 4, 1},
+    {0, 1, 0, 1, 0}
+  };
+  image2d<int> ref = make::image(refvals, point2d(-1, -1));
+
+  int vals[5][5] = {
+    {0, 1, 0, 1, 0 },
+    {1, 0, 1, 0, 1 },
+    {0, 1, 0, 1, 0 },
+    {1, 0, 1, 0, 1 },
+    {0, 1, 0, 1, 0 }
+  };
+  image2d<int> imak1 = make::image(vals, point2d(-1, -1));
+
+  /// Make sure the border is set to 0 to get deterministic results.
+  border::fill(imak1, 0);
+
+
+  // Overload with accumulator
+  {
+    accu::math::sum<int> accu;
+    world::k1::fill_2_from_1_faces(imak1, accu);
+    mln_assertion(ref == imak1);
+  }
+
+  // Overload with function
+  {
+    sum_t f;
+    world::k1::fill_2_from_1_faces(imak1, f);
+    mln_assertion(ref == imak1);
+  }
+
+}
diff --git a/milena/tests/world/k1/immerse_and_duplicate_2_to_0_1_faces.cc b/milena/tests/world/k1/immerse_and_duplicate_2_to_0_1_faces.cc
new file mode 100644
index 0000000..f03f905
--- /dev/null
+++ b/milena/tests/world/k1/immerse_and_duplicate_2_to_0_1_faces.cc
@@ -0,0 +1,55 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/world/k1/immerse_and_duplicate_2_to_0_1_faces.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+
+int main()
+{
+  using namespace mln;
+
+  int ref_vals[5][5] = {
+    {1, 1, 1, 2, 2 },
+    {1, 1, 1, 2, 2 },
+    {1, 1, 1, 2, 2 },
+    {3, 3, 3, 4, 4 },
+    {3, 3, 3, 4, 4 },
+  };
+  image2d<int> ref = make::image(ref_vals, point2d(-1, -1));
+
+  int vals[2][2] = {
+    {1, 2 },
+    {3, 4 }
+  };
+  image2d<int> ima = make::image(vals);
+
+  image2d<int> immersed = world::k1::immerse_and_duplicate_2_to_0_1_faces(ima);
+
+  mln_assertion(ref == immersed);
+}
diff --git a/milena/tests/world/k1/immerse_and_duplicate_2_to_1_faces.cc b/milena/tests/world/k1/immerse_and_duplicate_2_to_1_faces.cc
new file mode 100644
index 0000000..cbcb68d
--- /dev/null
+++ b/milena/tests/world/k1/immerse_and_duplicate_2_to_1_faces.cc
@@ -0,0 +1,55 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/world/k1/immerse_and_duplicate_2_to_1_faces.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+
+int main()
+{
+  using namespace mln;
+
+  int ref_vals[5][5] = {
+    {0, 1, 0, 2, 0 },
+    {1, 1, 1, 2, 2 },
+    {0, 1, 0, 2, 0 },
+    {3, 3, 3, 4, 4 },
+    {0, 3, 0, 4, 0 },
+  };
+  image2d<int> ref = make::image(ref_vals, point2d(-1, -1));
+
+  int vals[2][2] = {
+    {1, 2 },
+    {3, 4 }
+  };
+  image2d<int> ima = make::image(vals);
+
+  image2d<int> immersed = world::k1::immerse_and_duplicate_2_to_1_faces(ima);
+
+  mln_assertion(ref == immersed);
+}
diff --git a/milena/tests/world/k1/un_immerse.cc b/milena/tests/world/k1/un_immerse.cc
new file mode 100644
index 0000000..47e06e4
--- /dev/null
+++ b/milena/tests/world/k1/un_immerse.cc
@@ -0,0 +1,54 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/world/k1/un_immerse.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+
+int main()
+{
+  using namespace mln;
+
+  int refvals[2][2] = {
+    {3, 3},
+    {3, 3}
+  };
+  image2d<int> ref = make::image(refvals);
+
+  int vals[5][5] = {
+    {1, 2, 1, 2, 1 },
+    {2, 3, 2, 3, 2 },
+    {1, 2, 1, 2, 1 },
+    {2, 3, 2, 3, 2 },
+    {1, 2, 1, 2, 1 }
+  };
+  image2d<int> imak1 = make::image(vals, point2d(-1, -1));
+
+  image2d<int> imak0 = world::k1::un_immerse(imak1);
+  mln_assertion(imak0 == ref);
+}
-- 
1.7.2.5
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    27 Sep '12
                    
                        This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch apps-camera-process has been updated
       via  a86f5797524c4b6330245ce951c4ad6e4e599f00 (commit)
      from  7a4d07ddeeeb760fafbb1881f6375f36914f0f3f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
a86f579 Make apps/camera-process/process detect large, white objects.
-----------------------------------------------------------------------
Summary of changes:
 milena/ChangeLog                         |    9 +++
 milena/apps/camera-process/camprocess.cc |    4 +
 milena/apps/camera-process/process.cc    |  105 ++++++++++++++++++++++--------
 3 files changed, 90 insertions(+), 28 deletions(-)
hooks/post-receive
-- 
Olena, a generic and efficient image processing platform
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            olena-2.0-55-ga86f579 Make	apps/camera-process/process detect large, white objects.
                        
                        
by Roland Levillain 27 Sep '12
                    by Roland Levillain 27 Sep '12
27 Sep '12
                    
                        	* apps/camera-process/process.cc (process): Here.
	(min_rgb_comp): New functor.
	* apps/camera-process/camprocess.cc: Set the size of the captured
	image to 640x480 pixels.
---
 milena/ChangeLog                         |    9 +++
 milena/apps/camera-process/camprocess.cc |    4 +
 milena/apps/camera-process/process.cc    |  105 ++++++++++++++++++++++--------
 3 files changed, 90 insertions(+), 28 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 77113b3..14b8ce1 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-27  Roland Levillain  <roland(a)lrde.epita.fr>
+
+	Make apps/camera-process/process detect large, white objects.
+
+	* apps/camera-process/process.cc (process): Here.
+	(min_rgb_comp): New functor.
+	* apps/camera-process/camprocess.cc: Set the size of the captured
+	image to 640x480 pixels.
+
 2012-09-25  Roland Levillain  <roland(a)lrde.epita.fr>
 
 	New app: camera stream processing (using OpenCV for capture).
diff --git a/milena/apps/camera-process/camprocess.cc b/milena/apps/camera-process/camprocess.cc
index 2a10fa6..f815d72 100644
--- a/milena/apps/camera-process/camprocess.cc
+++ b/milena/apps/camera-process/camprocess.cc
@@ -51,6 +51,10 @@ int main()
       exit(1);
     }
 
+  // Set the size of the captured image.
+  cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 640);
+  cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 480);
+
   // Create a GUI window.
   cvNamedWindow("Window", CV_WINDOW_AUTOSIZE);
 
diff --git a/milena/apps/camera-process/process.cc b/milena/apps/camera-process/process.cc
index 8cf2446..d76405f 100644
--- a/milena/apps/camera-process/process.cc
+++ b/milena/apps/camera-process/process.cc
@@ -26,13 +26,43 @@
 #include <mln/core/image/image2d.hh>
 #include <mln/opt/at.hh>
 
+#include <mln/core/image/vmorph/fun_image.hh>
+#include <mln/core/image/dmorph/image_if.hh>
+
 #include <mln/value/int_u8.hh>
 #include <mln/value/rgb8.hh>
-#include <mln/fun/v2v/rgb_to_int_u.hh>
+#include <mln/literal/colors.hh>
+#include <mln/literal/black.hh>
+#include <mln/literal/white.hh>
+
+#include <mln/math/min.hh>
+
+#include <mln/pw/all.hh>
+
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/core/alias/window2d.hh>
+
+#include <mln/morpho/dilation.hh>
+#include <mln/morpho/gradient.hh>
+#include <mln/morpho/opening/area.hh>
 
 #include "process.hh"
 
 
+// FIXME: Move this into the library.
+/// Functor returning the minimal component of an mln::value::rgb<n> value.
+template <unsigned n>
+struct min_rgb_comp : mln::Function_v2v< min_rgb_comp<n> >
+{
+  typedef mln::value::int_u<n> result;
+
+  result operator()(const mln::value::rgb<n>& c) const
+  {
+    return mln::math::min(mln::math::min(c.red(), c.green()), c.blue());
+  }
+};
+
+
 /* FIXME: Hide OpenCV-Milena conversion operations; or better, wrap
    the `Iplimage' data structure in a Milena image so that it can be
    processed directly.  */
@@ -40,32 +70,51 @@
 void process(IplImage* cv_ima)
 {
   using namespace mln;
+  using mln::value::int_u8;
+  using mln::value::rgb8;
+
+  char* data = cv_ima->imageData;
+  int height = cv_ima->height;
+  int width = cv_ima->width;
+  int widthstep = cv_ima->widthStep;
+  int nchannels = cv_ima->nChannels;
+
+  // Convert `cv_ima' into a Milena image.
+  image2d<rgb8> mln_ima(height, width);
+  for (int row = 0; row < height; ++row)
+    for (int col = 0; col < width; ++col)
+      for (int chan = 0; chan < nchannels; ++chan)
+	opt::at(mln_ima, row, col).comp(chan) =
+	  (unsigned char) data[row * widthstep + col * nchannels + chan];
+
+  // Detect white objects having a minimal area.
+  image2d<bool> bin;
+  initialize(bin, mln_ima);
+  data::fill(bin, false);
+  int_u8 threshold = 160;
+  data::fill((bin | (pw::value(min_rgb_comp<8>() << mln_ima)
+		     >= pw::cst(threshold))).rw(),
+	     true);
+  // For a lack of a better characterization.
+  unsigned area = 15000;
+  image2d<bool> objects = morpho::opening::area(bin, c4(), area);
+  // Find contours.
+  image2d<bool> outline = morpho::gradient_external(objects, win_c4p());
+  // Enlarge them.
+  image2d<bool> contours = morpho::dilation(outline, win_c4p());
+
+  // Alter the original OpenCV image `cv_ima'.
+  for (int row = 0; row < height; ++row)
+    for (int col = 0; col < width; ++col)
+	if (char(opt::at(contours, row, col)))
+	  {
+	    /* Paint the pixel in red.
 
-  // Convert `cv_ima' into a Milena image...
-  image2d<value::rgb8> mln_ima(cv_ima->height, cv_ima->width);
-  for (int row = 0; row < cv_ima->height; ++row)
-    for (int col = 0; col < cv_ima->width; ++col)
-      for (int chan = 0; chan < cv_ima->nChannels; ++chan)
-	{
-	  opt::at(mln_ima, row, col).comp(chan) =
-	    (unsigned char) cv_ima->imageData[row * cv_ima->widthStep
-					     + col * cv_ima->nChannels
-					     + chan];
-	}
-
-  // ...do something with it...
-  mln_piter_(image2d<value::rgb8>) p(mln_ima.domain());
-  for_all(p)
-    convert::from_to(fun::v2v::rgb_to_int_u<8>()(mln_ima(p)), mln_ima(p));
-
-  // ...and paste `mln_ima' back into the OpenCV image `cv_ima'.
-  for (int row = 0; row < cv_ima->height; ++row)
-    for (int col = 0; col < cv_ima->width; ++col)
-      for (int chan = 0; chan < cv_ima->nChannels; ++chan)
-	{
-	  cv_ima->imageData[row * cv_ima->widthStep
-			   + col * cv_ima->nChannels
-			   + chan] =
-	    (char) opt::at(mln_ima, row, col).comp(chan);
-	}
+	       In the initial test environment, the frame was encoded
+	       as a BGR image.  */
+	    int pos = row * widthstep + col * nchannels;
+	    data[pos + 0] = mln_min(int_u8);  // Channel 0: Blue.
+	    data[pos + 1] = mln_min(int_u8);  // Channel 1: Green.
+	    data[pos + 2] = mln_max(int_u8);  // Channel 2: Red.
+	  }
 }
-- 
1.7.2.5
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch exp/khalimsky has been created
        at  f669bdcced156e0cbf9307a77515860911ad17bd (commit)
- Log -----------------------------------------------------------------
f669bdc configure.ac: Configure milena/tests/world/k1/Makefile.am.
cb1593c Initial commit of tools to work in K1.
-----------------------------------------------------------------------
hooks/post-receive
-- 
Olena, a generic and efficient image processing platform
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            olena-2.0-27-gf669bdc configure.ac: Configure	milena/tests/world/k1/Makefile.am.
                        
                        
by Guillaume Lazzara 27 Sep '12
                    by Guillaume Lazzara 27 Sep '12
27 Sep '12
                    
                        ---
 ChangeLog    |    4 ++++
 configure.ac |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6f2cfc5..fb3a269 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-09-27  Guillaume Lazzara  <z(a)lrde.epita.fr>
+
+	* configure.ac: Configure milena/tests/world/k1/Makefile.am.
+
 2011-11-16  Guillaume Lazzara  <z(a)lrde.epita.fr>
 
 	* m4/oln-with-lib.m4: Lookup for multiple AND single libraries
diff --git a/configure.ac b/configure.ac
index a53bcf8..631bc89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -535,6 +535,7 @@ AC_CONFIG_FILES([
       milena/tests/world/binary_2d/Makefile
       milena/tests/world/inter_pixel/Makefile
         milena/tests/world/inter_pixel/dim2/Makefile
+      milena/tests/world/k1/Makefile
 ])
 
 dnl<<lrde
-- 
1.7.2.5
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    27 Sep '12
                    
                        	* milena/mln/world/k1/display_enlarged.hh,
	* milena/mln/world/k1/immerse.hh,
	* milena/mln/world/k1/internal/face_dim.hh,
	* milena/mln/world/k1/is_0_face.hh,
	* milena/mln/world/k1/is_0_or_1_face.hh,
	* milena/mln/world/k1/is_1_face.hh,
	* milena/mln/world/k1/is_1_face_horizontal.hh,
	* milena/mln/world/k1/is_1_face_vertical.hh,
	* milena/mln/world/k1/is_2_face.hh,
	* milena/mln/world/k1/is_primary_face.hh,
	* milena/mln/world/k1/un_immerse.hh: New.
	* milena/tests/world/k1/Makefile.am,
	* milena/tests/world/k1/display_enlarged.cc,
	* milena/tests/world/k1/immerse.cc,
	* milena/tests/world/k1/is_0_face.cc,
	* milena/tests/world/k1/is_0_or_1_face.cc,
	* milena/tests/world/k1/is_1_face.cc,
	* milena/tests/world/k1/is_1_face_horizontal.cc,
	* milena/tests/world/k1/is_1_face_vertical.cc,
	* milena/tests/world/k1/is_2_face.cc,
	* milena/tests/world/k1/is_primary_face.cc: New tests.
	* milena/tests/world/Makefile.am: Add Subdir.
	* milena/mln/make/image.hh: Add overloads.
---
 milena/ChangeLog                              |   31 +++++
 milena/mln/make/image.hh                      |   59 ++++++++--
 milena/mln/world/k1/display_enlarged.hh       |  154 +++++++++++++++++++++++++
 milena/mln/world/k1/immerse.hh                |  122 +++++++++++++++++++
 milena/mln/world/k1/internal/face_dim.hh      |   75 ++++++++++++
 milena/mln/world/k1/is_0_face.hh              |   70 +++++++++++
 milena/mln/world/k1/is_0_or_1_face.hh         |   71 +++++++++++
 milena/mln/world/k1/is_1_face.hh              |   70 +++++++++++
 milena/mln/world/k1/is_1_face_horizontal.hh   |   70 +++++++++++
 milena/mln/world/k1/is_1_face_vertical.hh     |   70 +++++++++++
 milena/mln/world/k1/is_2_face.hh              |   70 +++++++++++
 milena/mln/world/k1/is_primary_face.hh        |   70 +++++++++++
 milena/mln/world/k1/un_immerse.hh             |   21 ++++
 milena/tests/world/Makefile.am                |    6 +-
 milena/tests/world/k1/Makefile.am             |   42 +++++++
 milena/tests/world/k1/display_enlarged.cc     |   98 ++++++++++++++++
 milena/tests/world/k1/immerse.cc              |   53 +++++++++
 milena/tests/world/k1/is_0_face.cc            |   40 +++++++
 milena/tests/world/k1/is_0_or_1_face.cc       |   40 +++++++
 milena/tests/world/k1/is_1_face.cc            |   39 ++++++
 milena/tests/world/k1/is_1_face_horizontal.cc |   41 +++++++
 milena/tests/world/k1/is_1_face_vertical.cc   |   41 +++++++
 milena/tests/world/k1/is_2_face.cc            |   39 ++++++
 milena/tests/world/k1/is_primary_face.cc      |   39 ++++++
 24 files changed, 1418 insertions(+), 13 deletions(-)
 create mode 100644 milena/mln/world/k1/display_enlarged.hh
 create mode 100644 milena/mln/world/k1/immerse.hh
 create mode 100644 milena/mln/world/k1/internal/face_dim.hh
 create mode 100644 milena/mln/world/k1/is_0_face.hh
 create mode 100644 milena/mln/world/k1/is_0_or_1_face.hh
 create mode 100644 milena/mln/world/k1/is_1_face.hh
 create mode 100644 milena/mln/world/k1/is_1_face_horizontal.hh
 create mode 100644 milena/mln/world/k1/is_1_face_vertical.hh
 create mode 100644 milena/mln/world/k1/is_2_face.hh
 create mode 100644 milena/mln/world/k1/is_primary_face.hh
 create mode 100644 milena/mln/world/k1/un_immerse.hh
 create mode 100644 milena/tests/world/k1/Makefile.am
 create mode 100644 milena/tests/world/k1/display_enlarged.cc
 create mode 100644 milena/tests/world/k1/immerse.cc
 create mode 100644 milena/tests/world/k1/is_0_face.cc
 create mode 100644 milena/tests/world/k1/is_0_or_1_face.cc
 create mode 100644 milena/tests/world/k1/is_1_face.cc
 create mode 100644 milena/tests/world/k1/is_1_face_horizontal.cc
 create mode 100644 milena/tests/world/k1/is_1_face_vertical.cc
 create mode 100644 milena/tests/world/k1/is_2_face.cc
 create mode 100644 milena/tests/world/k1/is_primary_face.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index b977679..cec8c97 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,34 @@
+2012-09-27  Guillaume Lazzara  <z(a)lrde.epita.fr>
+
+	Initial commit of tools to work in K1.
+
+	* milena/mln/world/k1/display_enlarged.hh,
+	* milena/mln/world/k1/immerse.hh,
+	* milena/mln/world/k1/internal/face_dim.hh,
+	* milena/mln/world/k1/is_0_face.hh,
+	* milena/mln/world/k1/is_0_or_1_face.hh,
+	* milena/mln/world/k1/is_1_face.hh,
+	* milena/mln/world/k1/is_1_face_horizontal.hh,
+	* milena/mln/world/k1/is_1_face_vertical.hh,
+	* milena/mln/world/k1/is_2_face.hh,
+	* milena/mln/world/k1/is_primary_face.hh,
+	* milena/mln/world/k1/un_immerse.hh: New.
+
+	* milena/tests/world/k1/Makefile.am,
+	* milena/tests/world/k1/display_enlarged.cc,
+	* milena/tests/world/k1/immerse.cc,
+	* milena/tests/world/k1/is_0_face.cc,
+	* milena/tests/world/k1/is_0_or_1_face.cc,
+	* milena/tests/world/k1/is_1_face.cc,
+	* milena/tests/world/k1/is_1_face_horizontal.cc,
+	* milena/tests/world/k1/is_1_face_vertical.cc,
+	* milena/tests/world/k1/is_2_face.cc,
+	* milena/tests/world/k1/is_primary_face.cc: New tests.
+
+	* milena/tests/world/Makefile.am: Add Subdir.
+
+	* milena/mln/make/image.hh: Add overloads.
+
 2011-11-29  Guillaume Lazzara  <z(a)lrde.epita.fr>
 
 	Fix the initialization of all global constants (ticket #43)
diff --git a/milena/mln/make/image.hh b/milena/mln/make/image.hh
index ef80c57..5208293 100644
--- a/milena/mln/make/image.hh
+++ b/milena/mln/make/image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 EPITA Research and
 // Development Laboratory (LRDE)
 //
 // This file is part of Olena.
@@ -37,6 +37,9 @@
 # include <mln/core/image/image1d.hh>
 # include <mln/core/image/image2d.hh>
 # include <mln/core/image/image3d.hh>
+# include <mln/make/box1d.hh>
+# include <mln/make/box2d.hh>
+# include <mln/make/box3d.hh>
 # include <mln/opt/at.hh>
 
 
@@ -54,8 +57,11 @@ namespace mln
     /// \return A 1D image.
     ///
     template <typename V, unsigned L>
-    mln::image1d<V> image(V (&values)[L]);
+    mln::image1d<V> image(V (&values)[L], const point1d& pmin);
 
+    /// \overload pmin = (0)
+    template <typename V, unsigned L>
+    mln::image1d<V> image(V (&values)[L]);
 
     /// Create an image2d from an 2D array of values.
     ///
@@ -64,6 +70,10 @@ namespace mln
     /// \return A 2D image.
     ///
     template <typename V, unsigned R, unsigned C>
+    mln::image2d<V> image(V (&values)[R][C], const point2d& pmin);
+
+    /// \overload pmin = (0,0)
+    template <typename V, unsigned R, unsigned C>
     mln::image2d<V> image(V (&values)[R][C]);
 
 
@@ -74,6 +84,10 @@ namespace mln
     /// \return A 3D image.
     ///
     template <typename V, unsigned S, unsigned R, unsigned C>
+    mln::image3d<V> image(V (&values)[S][R][C], const point3d& pmin);
+
+    /// \overload pmin = (0,0,0)
+    template <typename V, unsigned S, unsigned R, unsigned C>
     mln::image3d<V> image(V (&values)[S][R][C]);
 
 
@@ -82,37 +96,53 @@ namespace mln
 
     template <typename V, unsigned L>
     mln::image1d<V>
-    image(V (&values)[L])
+    image(V (&values)[L], const point1d& pmin)
     {
       mlc_bool(L != 0)::check();
-      mln::image1d<V> tmp(L);
+      mln::image1d<V> tmp(make::box1d(pmin.ind(), pmin.ind() + L - 1));
       const def::coord ninds = static_cast<def::coord>(L);
       for (def::coord ind = 0; ind < ninds; ++ind)
-	tmp(point1d(ind)) = values[ind];
+	tmp(point1d(pmin.ind() + ind)) = values[ind];
       return tmp;
     }
 
+    template <typename V, unsigned L>
+    mln::image1d<V>
+    image(V (&values)[L])
+    {
+      return image(values, point1d(0));
+    }
+
     template <typename V, unsigned R, unsigned C>
     mln::image2d<V>
-    image(V (&values)[R][C])
+    image(V (&values)[R][C], const point2d& pmin)
     {
       mlc_bool(R != 0 && C != 0)::check();
-      mln::image2d<V> tmp(R, C);
+      mln::image2d<V> tmp(make::box2d(pmin.row(), pmin.col(),
+				      pmin.row() + R - 1, pmin.col() + C - 1));
       const def::coord
 	nrows = static_cast<def::coord>(R),
 	ncols = static_cast<def::coord>(C);
       for (def::coord row = 0; row < nrows; ++row)
 	for (def::coord col = 0; col < ncols; ++col)
-	  opt::at(tmp, row, col) = values[row][col];
+	  opt::at(tmp, pmin.row() + row, pmin.col() + col) = values[row][col];
       return tmp;
     }
 
+    template <typename V, unsigned R, unsigned C>
+    mln::image2d<V>
+    image(V (&values)[R][C])
+    {
+      return image(values, point2d(0, 0));
+    }
+
     template <typename V, unsigned S, unsigned R, unsigned C>
     mln::image3d<V>
-    image(V (&values)[S][R][C])
+    image(V (&values)[S][R][C], const point3d& pmin)
     {
       mlc_bool(S != 0 && R != 0 && C != 0)::check();
-      mln::image3d<V> tmp(S, R, C);
+      mln::image3d<V> tmp(make::box3d(pmin.sli(), pmin.row(), pmin.col(),
+				      pmin.sli() + S - 1, pmin.row() + R - 1, pmin.col() + C - 1));
       const def::coord
 	nslis = static_cast<def::coord>(S),
 	nrows = static_cast<def::coord>(R),
@@ -120,10 +150,17 @@ namespace mln
       for (def::coord sli = 0; sli < nslis; ++sli)
 	for (def::coord row = 0; row < nrows; ++row)
 	  for (def::coord col = 0; col < ncols; ++col)
-	    opt::at(tmp, sli, row, col) = values[sli][row][col];
+	    opt::at(tmp, pmin.sli() + sli, pmin.row() + row, pmin.col() + col) = values[sli][row][col];
       return tmp;
     }
 
+    template <typename V, unsigned S, unsigned R, unsigned C>
+    mln::image3d<V>
+    image(V (&values)[S][R][C])
+    {
+      return image(values, point3d(0, 0, 0));
+    }
+
 # endif // ! MLN_INCLUDE_ONLY
 
   } // end of namespace mln::make
diff --git a/milena/mln/world/k1/display_enlarged.hh b/milena/mln/world/k1/display_enlarged.hh
new file mode 100644
index 0000000..f3610c1
--- /dev/null
+++ b/milena/mln/world/k1/display_enlarged.hh
@@ -0,0 +1,154 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Create a new image where 2 faces are enlarged for better
+/// visualization.
+
+#ifndef MLN_WORLD_K1_DISPLAY_ENLARGED_HH
+# define MLN_WORLD_K1_DISPLAY_ENLARGED_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_0_face.hh>
+# include <mln/world/k1/is_1_face_vertical.hh>
+# include <mln/world/k1/is_1_face_horizontal.hh>
+# include <mln/world/k1/is_2_face.hh>
+# include <mln/geom/all.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Create a new image where 2 faces are enlarged for better
+	visualization.
+
+	Exemple with zoom = 3:
+	\verbatim
+	. - . - .                . - - - . - - - .
+	| o | o |                | o o o | o o o |
+	. - . - .      ->        | o o o | o o o |
+	| o | o |                | o o o | o o o |
+	. - . - .                . - - - . - - - .
+	                         | o o o | o o o |
+	                         | o o o | o o o |
+	                         | o o o | o o o |
+				 . - - - . - - - .
+	\endverbatim
+
+	\param[in] ima_k1 A 2D image immersed in K1.
+	\param[in] zoom The number of times 2 faces must be duplicated
+	(must be odd).
+
+
+	This function is useful for debugging to distinguish 2 faces
+	from others.
+
+      */
+      template <typename I>
+      mln_concrete(I)
+      display_enlarged(const Image<I>& ima_k1, unsigned zoom);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      template <typename I>
+      mln_concrete(I)
+      display_enlarged(const Image<I>& ima_k1_, unsigned zoom_)
+      {
+	trace::entering("mln::world::k1::display_enlarged");
+
+	mln_precondition(exact(ima_k1_).is_valid());
+	mln_assertion(zoom_ % 2);
+
+	const I& ima_k1 = exact(ima_k1_);
+	int shift = zoom_ - 1;
+
+	// No zoom: return original image.
+	if (zoom_ == 1)
+	  return ima_k1;
+
+	mln_concrete(I) output(make::box2d(ima_k1.domain().pmin().row() * shift,
+					   ima_k1.domain().pmin().col() * shift,
+					   ima_k1.domain().pmax().row() * shift,
+					   ima_k1.domain().pmax().col() * shift));
+
+	const mln::def::coord
+	  min_row = geom::min_row(ima_k1),
+	  max_row = geom::max_row(ima_k1),
+	  min_col = geom::min_col(ima_k1),
+	  max_col = geom::max_col(ima_k1);
+
+	for (mln::def::coord row = min_row; row <= max_row; ++row)
+	{
+	  for (mln::def::coord col = min_col; col <= max_col; ++col)
+	  {
+	    if (is_0_face(point2d(row, col)))
+	    {
+	      output.at_(row * shift, col * shift) = ima_k1.at_(row, col);
+	    }
+	    else if (is_1_face_vertical(point2d(row, col)))
+	    {
+	      for (mln::def::coord j = -(shift - 1); j <  (shift + 3); ++j)
+	    	output.at_(row * shift + j, col * shift) = ima_k1.at_(row, col);
+	    }
+	    else if (is_1_face_horizontal(point2d(row, col)))
+	    {
+	      for (mln::def::coord j = -(shift - 1); j <  (shift + 3); ++j)
+	    	output.at_(row * shift, col * shift  + j) = ima_k1.at_(row, col);
+	    }
+	    else if (is_2_face(point2d(row, col)))
+	    {
+	      for (mln::def::coord i = -(shift - 1); i <  (shift + 3); ++i)
+	    	for (mln::def::coord j = -(shift - 1); j <  (shift + 3); ++j)
+	    	  output.at_(row * shift + i, col * shift  + j) = ima_k1.at_(row, col);
+	    }
+	  }
+	}
+
+	trace::exiting("mln::world::k1::display_enlarged");
+	return output;
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_DISPLAY_ENLARGED_HH
+
diff --git a/milena/mln/world/k1/immerse.hh b/milena/mln/world/k1/immerse.hh
new file mode 100644
index 0000000..928012b
--- /dev/null
+++ b/milena/mln/world/k1/immerse.hh
@@ -0,0 +1,122 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Immerse a 2D image into K1.
+
+#ifndef MLN_WORLD_K1_IMMERSE_HH
+# define MLN_WORLD_K1_IMMERSE_HH
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/box.hh>
+# include <mln/core/alias/point2d.hh>
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /*! \brief Immerse a 2D image into K1.
+
+	\verbatim
+
+	           -1 0 1 2 3
+	 0 1     -1 . - . - .
+       0 o o      0 | o | o |
+       1 o o  ->  1 . - . - .
+	          2 | o | o |
+	 	  3 . - . - .
+
+	\endverbatim
+
+       */
+      template <typename I>
+      mln_concrete(I) immerse(const Image<I>& ima);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+      namespace internal
+      {
+
+	/// \brief Return the equivalent domain in K1 from a domain in
+	/// K0.
+	template <typename B>
+	inline
+	B domain_from_K0(const Box<B>& b_)
+	{
+	  mln_precondition(exact(b_).is_valid());
+	  const B& b = exact(b_);
+
+	  mln_deduce(B, site, delta) one;
+	  one.set_all(1);
+	  return B(2 * b.pmin() - one, 2 * b.pmax() + one);
+	}
+
+	inline
+	point2d
+	immerse_point(const point2d& p)
+	{
+	  point2d tmp(2 * p.row(), 2 * p.col());
+	  return tmp;
+	}
+
+      } // end of namespace mln::world::k1::internal
+
+
+
+      // Facade
+
+      template <typename I>
+      mln_concrete(I) immerse(const Image<I>& ima_)
+      {
+	trace::entering("mln::world::k1::immerse");
+	mln_precondition(exact(ima_).is_valid());
+	const I& ima = exact(ima_);
+
+	mln_concrete(I) output(internal::domain_from_K0(ima.domain()));
+
+	mln_piter(I) p(ima.domain());
+	for_all(p)
+	  output(internal::immerse_point(p)) = ima(p);
+
+	trace::exiting("mln::world::k1::immerse");
+	return output;
+      }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IMMERSE_HH
diff --git a/milena/mln/world/k1/internal/face_dim.hh b/milena/mln/world/k1/internal/face_dim.hh
new file mode 100644
index 0000000..b933e86
--- /dev/null
+++ b/milena/mln/world/k1/internal/face_dim.hh
@@ -0,0 +1,75 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Returns the dimension of site in K1.
+
+#ifndef MLN_WORLD_K1_FACE_DIM_HH
+# define MLN_WORLD_K1_FACE_DIM_HH
+
+# include <mln/core/alias/point2d.hh>
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      namespace internal
+      {
+
+	/// \brief Returns the dimension of site in K1.
+	unsigned face_dim(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+	// Facade
+
+	inline
+	unsigned face_dim(const point2d& p)
+	{
+	  return (p[0] % 2 == 0) + (p[1] % 2 == 0);
+	}
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+      } // end of namespace mln::work::k1::internal
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_FACE_DIM_HH
+
+
diff --git a/milena/mln/world/k1/is_0_face.hh b/milena/mln/world/k1/is_0_face.hh
new file mode 100644
index 0000000..c9d9b0e
--- /dev/null
+++ b/milena/mln/world/k1/is_0_face.hh
@@ -0,0 +1,70 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Check if site is a 0 face.
+
+#ifndef MLN_WORLD_K1_IS_0_FACE_HH
+# define MLN_WORLD_K1_IS_0_FACE_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/internal/face_dim.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /// \brief Check if site is a 0 face
+      bool is_0_face(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      inline
+      bool is_0_face(const point2d& p)
+      {
+	return internal::face_dim(p) == 0;
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IS_0_FACE_HH
diff --git a/milena/mln/world/k1/is_0_or_1_face.hh b/milena/mln/world/k1/is_0_or_1_face.hh
new file mode 100644
index 0000000..6f3f47a
--- /dev/null
+++ b/milena/mln/world/k1/is_0_or_1_face.hh
@@ -0,0 +1,71 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Check if site is a 1 face.
+
+#ifndef MLN_WORLD_K1_IS_0_OR_1_FACE_HH
+# define MLN_WORLD_K1_IS_0_OR_1_FACE_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/internal/face_dim.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /// \brief Check if site is a 1 face
+      bool is_0_or_1_face(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      inline
+      bool is_0_or_1_face(const point2d& p)
+      {
+	unsigned dim = internal::face_dim(p);
+	return dim == 0 || dim == 1;
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IS_0_OR_1_FACE_HH
diff --git a/milena/mln/world/k1/is_1_face.hh b/milena/mln/world/k1/is_1_face.hh
new file mode 100644
index 0000000..aafa442
--- /dev/null
+++ b/milena/mln/world/k1/is_1_face.hh
@@ -0,0 +1,70 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Check if site is a 1 face.
+
+#ifndef MLN_WORLD_K1_IS_1_FACE_HH
+# define MLN_WORLD_K1_IS_1_FACE_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/internal/face_dim.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /// \brief Check if site is a 1 face
+      bool is_1_face(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      inline
+      bool is_1_face(const point2d& p)
+      {
+	return internal::face_dim(p) == 1;
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IS_1_FACE_HH
diff --git a/milena/mln/world/k1/is_1_face_horizontal.hh b/milena/mln/world/k1/is_1_face_horizontal.hh
new file mode 100644
index 0000000..ff90b0c
--- /dev/null
+++ b/milena/mln/world/k1/is_1_face_horizontal.hh
@@ -0,0 +1,70 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Check if site is a 1 face.
+
+#ifndef MLN_WORLD_K1_IS_1_FACE_HORIZONTAL_HH
+# define MLN_WORLD_K1_IS_1_FACE_HORIZONTAL_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_1_face.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /// \brief Check if site is a 1 face
+      bool is_1_face_horizontal(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      inline
+      bool is_1_face_horizontal(const point2d& p)
+      {
+	return is_1_face(p) && p[1] % 2 == 0;
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IS_1_FACE_HORIZONTAL_HH
diff --git a/milena/mln/world/k1/is_1_face_vertical.hh b/milena/mln/world/k1/is_1_face_vertical.hh
new file mode 100644
index 0000000..f10067d
--- /dev/null
+++ b/milena/mln/world/k1/is_1_face_vertical.hh
@@ -0,0 +1,70 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Check if site is a 1 face.
+
+#ifndef MLN_WORLD_K1_IS_1_FACE_VERTICAL_HH
+# define MLN_WORLD_K1_IS_1_FACE_VERTICAL_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_1_face.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /// \brief Check if site is a 1 face
+      bool is_1_face_vertical(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      inline
+      bool is_1_face_vertical(const point2d& p)
+      {
+	return is_1_face(p) && p[0] % 2 == 0;
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IS_1_FACE_VERTICAL_HH
diff --git a/milena/mln/world/k1/is_2_face.hh b/milena/mln/world/k1/is_2_face.hh
new file mode 100644
index 0000000..b3c8c98
--- /dev/null
+++ b/milena/mln/world/k1/is_2_face.hh
@@ -0,0 +1,70 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Check if site is a 2 face.
+
+#ifndef MLN_WORLD_K1_IS_2_FACE_HH
+# define MLN_WORLD_K1_IS_2_FACE_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/internal/face_dim.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /// \brief Check if site is a 2 face
+      bool is_2_face(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      inline
+      bool is_2_face(const point2d& p)
+      {
+	return internal::face_dim(p) == 2;
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IS_2_FACE_HH
diff --git a/milena/mln/world/k1/is_primary_face.hh b/milena/mln/world/k1/is_primary_face.hh
new file mode 100644
index 0000000..572d25c
--- /dev/null
+++ b/milena/mln/world/k1/is_primary_face.hh
@@ -0,0 +1,70 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+/// \brief Check if site is a primary face.
+
+#ifndef MLN_WORLD_K1_IS_PRIMARY_FACE_HH
+# define MLN_WORLD_K1_IS_PRIMARY_FACE_HH
+
+# include <mln/core/alias/point2d.hh>
+# include <mln/world/k1/is_2_face.hh>
+
+
+namespace mln
+{
+
+  namespace world
+  {
+
+    namespace k1
+    {
+
+      /// \brief Check if site is a primary face
+      bool is_primary_face(const point2d& p);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+      // Facade
+
+      inline
+      bool is_primary_face(const point2d& p)
+      {
+	return is_2_face(p);
+      }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::world::k1
+
+  } // end of namespace mln::world
+
+} // end of namespace mln
+
+#endif // ! MLN_WORLD_K1_IS_PRIMARY_FACE_HH
diff --git a/milena/mln/world/k1/un_immerse.hh b/milena/mln/world/k1/un_immerse.hh
new file mode 100644
index 0000000..7978be9
--- /dev/null
+++ b/milena/mln/world/k1/un_immerse.hh
@@ -0,0 +1,21 @@
+
+
+  inline
+  point2d
+  un_immerse(const point2d& p)
+  {
+    point2d tmp(p.row() / 2, p.col() / 2);
+    return tmp;
+  }
+
+  struct is_2_face_t : Function_v2b< is_2_face_t >
+  {
+    typedef bool result;
+    inline bool operator()(const point2d& p) const { return FIXME; } // p.row() % 2 && p.col() % 2
+  } is_2_face;
+
+  struct is_not_2_face_t : Function_v2b< is_not_2_face_t >
+  {
+    typedef bool result;
+    inline bool operator()(const point2d& p) const { return FIXME; } // ! (p.row() % 2 && p.col() % 2)
+  } is_not_2_face;
diff --git a/milena/tests/world/Makefile.am b/milena/tests/world/Makefile.am
index 3bae089..494271c 100644
--- a/milena/tests/world/Makefile.am
+++ b/milena/tests/world/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2009, 2012 EPITA Research and Development Laboratory
+# (LRDE).
 #
 # This file is part of Olena.
 #
@@ -18,4 +19,5 @@ include $(top_srcdir)/milena/tests/tests.mk
 
 SUBDIRS =					\
   binary_2d 					\
-  inter_pixel
+  inter_pixel					\
+  k1
diff --git a/milena/tests/world/k1/Makefile.am b/milena/tests/world/k1/Makefile.am
new file mode 100644
index 0000000..daa0d94
--- /dev/null
+++ b/milena/tests/world/k1/Makefile.am
@@ -0,0 +1,42 @@
+# Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+
+include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS =				\
+  display_enlarged				\
+  immerse					\
+  immerse_and_duplicate_2_to_1_faces		\
+  is_0_face					\
+  is_0_or_1_face				\
+  is_1_face					\
+  is_1_face_vertical				\
+  is_1_face_horizontal				\
+  is_2_face					\
+  is_primary_face
+
+display_enlarged_SOURCES = display_enlarged.cc
+immerse_SOURCES = immerse.cc
+immerse_and_duplicate_2_to_1_faces_SOURCES = immerse_and_duplicate_2_to_1_faces.cc
+is_0_face_SOURCES = is_0_face.cc
+is_0_or_1_face_SOURCES = is_0_or_1_face.cc
+is_1_face_SOURCES = is_1_face.cc
+is_1_face_vertical_SOURCES = is_1_face_vertical.cc
+is_1_face_horizontal_SOURCES = is_1_face_horizontal.cc
+is_2_face_SOURCES = is_2_face.cc
+is_primary_face_SOURCES = is_primary_face.cc
+
+TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/world/k1/display_enlarged.cc b/milena/tests/world/k1/display_enlarged.cc
new file mode 100644
index 0000000..3365fbe
--- /dev/null
+++ b/milena/tests/world/k1/display_enlarged.cc
@@ -0,0 +1,98 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/world/k1/display_enlarged.hh>
+#include <mln/world/k1/immerse.hh>
+#include <mln/make/box2d.hh>
+#include <mln/data/compare.hh>
+
+#include <mln/debug/println.hh>
+
+int main()
+{
+  using namespace mln;
+
+  int vals[5][5] = {
+    {1, 2, 1, 2, 1 },
+    {2, 3, 2, 3, 2 },
+    {1, 2, 1, 2, 1 },
+    {2, 3, 2, 3, 2 },
+    {1, 2, 1, 2, 1 }
+  };
+
+  int vals3[9][9] = {
+    {1, 2, 2, 2, 1, 2, 2, 2, 1},
+    {2, 3, 3, 3, 2, 3, 3, 3, 2},
+    {2, 3, 3, 3, 2, 3, 3, 3, 2},
+    {2, 3, 3, 3, 2, 3, 3, 3, 2},
+    {1, 2, 2, 2, 1, 2, 2, 2, 1},
+    {2, 3, 3, 3, 2, 3, 3, 3, 2},
+    {2, 3, 3, 3, 2, 3, 3, 3, 2},
+    {2, 3, 3, 3, 2, 3, 3, 3, 2},
+    {1, 2, 2, 2, 1, 2, 2, 2, 1}
+  };
+
+  int vals5[17][17] = {
+    {1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2},
+    {1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1}
+  };
+
+  image2d<int> ima = make::image(vals, point2d(-1, -1));
+
+  {
+    image2d<int> enlarged = world::k1::display_enlarged(ima, 1);
+    mln_assertion(ima == enlarged);
+  }
+
+  {
+    image2d<int> ref3 = make::image(vals3, point2d(-2, -2));
+    image2d<int> enlarged = world::k1::display_enlarged(ima, 3);
+    mln_assertion(ref3 == enlarged);
+  }
+
+  {
+    image2d<int> ref5 = make::image(vals5, point2d(-4, -4));
+    image2d<int> enlarged = world::k1::display_enlarged(ima, 5);
+    mln_assertion(ref5 == enlarged);
+  }
+}
diff --git a/milena/tests/world/k1/immerse.cc b/milena/tests/world/k1/immerse.cc
new file mode 100644
index 0000000..8a17056
--- /dev/null
+++ b/milena/tests/world/k1/immerse.cc
@@ -0,0 +1,53 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/world/k1/immerse.hh>
+#include <mln/make/box2d.hh>
+
+int main()
+{
+  using namespace mln;
+
+
+  int vals[2][2] = {
+    {1, 2 },
+    {3, 4 }
+  };
+  image2d<int> ima = make::image(vals);
+
+  image2d<int> immersed = world::k1::immerse(ima);
+
+  // Check domain
+  mln_assertion(immersed.domain() == make::box2d(-1, -1, 3, 3));
+
+  // Check values
+  mln_assertion(immersed(point2d(0, 0)) == 1);
+  mln_assertion(immersed(point2d(2, 0)) == 3);
+  mln_assertion(immersed(point2d(0, 2)) == 2);
+  mln_assertion(immersed(point2d(2, 2)) == 4);
+}
diff --git a/milena/tests/world/k1/is_0_face.cc b/milena/tests/world/k1/is_0_face.cc
new file mode 100644
index 0000000..6033af6
--- /dev/null
+++ b/milena/tests/world/k1/is_0_face.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/k1/is_0_face.hh>
+
+int main()
+{
+  using namespace mln;
+
+  mln_assertion(world::k1::is_0_face(point2d(-1, -1)));
+  mln_assertion(!world::k1::is_0_face(point2d(-1, 0)));
+  mln_assertion(!world::k1::is_0_face(point2d(0, -1)));
+  mln_assertion(!world::k1::is_0_face(point2d(0, 0)));
+  mln_assertion(world::k1::is_0_face(point2d(1, 1)));
+}
diff --git a/milena/tests/world/k1/is_0_or_1_face.cc b/milena/tests/world/k1/is_0_or_1_face.cc
new file mode 100644
index 0000000..f977566
--- /dev/null
+++ b/milena/tests/world/k1/is_0_or_1_face.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/k1/is_0_or_1_face.hh>
+
+int main()
+{
+  using namespace mln;
+
+  mln_assertion(world::k1::is_0_or_1_face(point2d(-1, -1)));
+  mln_assertion(world::k1::is_0_or_1_face(point2d(-1, 0)));
+  mln_assertion(world::k1::is_0_or_1_face(point2d(0, -1)));
+  mln_assertion(!world::k1::is_0_or_1_face(point2d(0, 0)));
+  mln_assertion(world::k1::is_0_or_1_face(point2d(1, 1)));
+}
diff --git a/milena/tests/world/k1/is_1_face.cc b/milena/tests/world/k1/is_1_face.cc
new file mode 100644
index 0000000..bd50f84
--- /dev/null
+++ b/milena/tests/world/k1/is_1_face.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/k1/is_1_face.hh>
+
+int main()
+{
+  using namespace mln;
+
+  mln_assertion(!world::k1::is_1_face(point2d(-1, -1)));
+  mln_assertion(world::k1::is_1_face(point2d(-1, 0)));
+  mln_assertion(world::k1::is_1_face(point2d(0, -1)));
+  mln_assertion(!world::k1::is_1_face(point2d(0, 0)));
+}
diff --git a/milena/tests/world/k1/is_1_face_horizontal.cc b/milena/tests/world/k1/is_1_face_horizontal.cc
new file mode 100644
index 0000000..4f6e406
--- /dev/null
+++ b/milena/tests/world/k1/is_1_face_horizontal.cc
@@ -0,0 +1,41 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/k1/is_1_face_horizontal.hh>
+
+int main()
+{
+  using namespace mln;
+
+  mln_assertion(!world::k1::is_1_face_horizontal(point2d(-1, -1)));
+  mln_assertion(world::k1::is_1_face_horizontal(point2d(-1, 0)));
+  mln_assertion(world::k1::is_1_face_horizontal(point2d(1, 0)));
+  mln_assertion(!world::k1::is_1_face_horizontal(point2d(0, -1)));
+  mln_assertion(!world::k1::is_1_face_horizontal(point2d(0, 1)));
+  mln_assertion(!world::k1::is_1_face_horizontal(point2d(0, 0)));
+}
diff --git a/milena/tests/world/k1/is_1_face_vertical.cc b/milena/tests/world/k1/is_1_face_vertical.cc
new file mode 100644
index 0000000..e204f97
--- /dev/null
+++ b/milena/tests/world/k1/is_1_face_vertical.cc
@@ -0,0 +1,41 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/k1/is_1_face_vertical.hh>
+
+int main()
+{
+  using namespace mln;
+
+  mln_assertion(!world::k1::is_1_face_vertical(point2d(-1, -1)));
+  mln_assertion(!world::k1::is_1_face_vertical(point2d(-1, 0)));
+  mln_assertion(!world::k1::is_1_face_vertical(point2d(1, 0)));
+  mln_assertion(world::k1::is_1_face_vertical(point2d(0, -1)));
+  mln_assertion(world::k1::is_1_face_vertical(point2d(0, 1)));
+  mln_assertion(!world::k1::is_1_face_vertical(point2d(0, 0)));
+}
diff --git a/milena/tests/world/k1/is_2_face.cc b/milena/tests/world/k1/is_2_face.cc
new file mode 100644
index 0000000..912567d
--- /dev/null
+++ b/milena/tests/world/k1/is_2_face.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/k1/is_2_face.hh>
+
+int main()
+{
+  using namespace mln;
+
+  mln_assertion(!world::k1::is_2_face(point2d(-1, -1)));
+  mln_assertion(!world::k1::is_2_face(point2d(-1, 0)));
+  mln_assertion(!world::k1::is_2_face(point2d(0, -1)));
+  mln_assertion(world::k1::is_2_face(point2d(0, 0)));
+}
diff --git a/milena/tests/world/k1/is_primary_face.cc b/milena/tests/world/k1/is_primary_face.cc
new file mode 100644
index 0000000..32eb871
--- /dev/null
+++ b/milena/tests/world/k1/is_primary_face.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License.  This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/k1/is_primary_face.hh>
+
+int main()
+{
+  using namespace mln;
+
+  mln_assertion(!world::k1::is_primary_face(point2d(-1, -1)));
+  mln_assertion(!world::k1::is_primary_face(point2d(-1, 0)));
+  mln_assertion(!world::k1::is_primary_face(point2d(0, -1)));
+  mln_assertion(world::k1::is_primary_face(point2d(0, 0)));
+}
-- 
1.7.2.5
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            olena-2.0-79-g4b68faa scribo/src/content_in_doc.cc:	Add more debug images.
                        
                        
by Guillaume Lazzara 26 Sep '12
                    by Guillaume Lazzara 26 Sep '12
26 Sep '12
                    
                        ---
 scribo/ChangeLog             |    4 ++++
 scribo/src/content_in_doc.cc |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 669d782..afb1147 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,7 @@
+2012-09-26  Guillaume Lazzara  <z(a)lrde.epita.fr>
+
+	* scribo/src/content_in_doc.cc: Add more debug images.
+
 2012-09-14  Guillaume Lazzara  <z(a)lrde.epita.fr>
 
 	* scribo/debug/logger.hh: Fix attributes initialization order.
diff --git a/scribo/src/content_in_doc.cc b/scribo/src/content_in_doc.cc
index 4d3c50e..0228f30 100644
--- a/scribo/src/content_in_doc.cc
+++ b/scribo/src/content_in_doc.cc
@@ -46,6 +46,7 @@
 #include <scribo/preprocessing/crop.hh>
 
 #include <scribo/io/xml/save.hh>
+#include <scribo/io/img/save.hh>
 
 #include <scribo/debug/option_parser.hh>
 
@@ -181,5 +182,8 @@ int main(int argc, char* argv[])
   else if (options.opt_value("xml-format") == "full")
     scribo::io::xml::save(doc, options.arg("out.xml"), scribo::io::xml::Full);
 
+  if (scribo::debug::logger().is_enabled())
+    scribo::io::img::save(doc, mln::debug::filename("regions.png"), scribo::io::img::DebugWoImage);
+
   trace::exiting("main");
 }
-- 
1.7.2.5
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0