---
milena/ChangeLog | 4 +
milena/mln/world/kn/debug/println.hh | 142 ++++++++++++++++++++++++++++++++++
2 files changed, 146 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/world/kn/debug/println.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index d1fd20e..32f1991 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,9 @@
2012-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * mln/world/kn/debug/println.hh: New.
+
+2012-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add test for world::kn::border::compute_1_faces.
* tests/world/kn/border/Makefile.am: New target.
diff --git a/milena/mln/world/kn/debug/println.hh b/milena/mln/world/kn/debug/println.hh
new file mode 100644
index 0000000..c603722
--- /dev/null
+++ b/milena/mln/world/kn/debug/println.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 Display a Kn 2D image.
+
+#ifndef MLN_WORLD_KN_DEBUG_PRINTLN_HH
+# define MLN_WORLD_KN_DEBUG_PRINTLN_HH
+
+# include <mln/core/concept/image.hh>
+# include <mln/geom/min_row.hh>
+# include <mln/geom/max_row.hh>
+# include <mln/geom/min_col.hh>
+# include <mln/geom/max_col.hh>
+# include <mln/world/kn/face_dim.hh>
+
+namespace mln
+{
+
+ namespace world
+ {
+
+ namespace kn
+ {
+
+ namespace debug
+ {
+
+
+ /// \brief Display a Kn 2D image.
+ template <typename I>
+ void println(const std::string& msg, const Image<I>& ima,
+ std::ostream& ostr = std::cout);
+
+
+ // \overload
+ template <typename I>
+ void println(const Image<I>& ima,
+ std::ostream& ostr = std::cout);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I>
+ void println(const std::string& msg,
+ const Image<I>& ima_,
+ std::ostream& ostr = std::cout)
+ {
+ trace::entering("mln::world::kn::debug::println");
+ mln_precondition(exact(ima_).is_valid());
+ mln_precondition(I::site::dim == 2);
+
+ const I& ima = exact(ima_);
+
+ if (msg != "")
+ std::cout << msg << std::endl;
+ def::coord
+ min_row = geom::min_row(ima), max_row = geom::max_row(ima),
+ min_col = geom::min_col(ima), max_col = geom::max_col(ima);
+
+ // FIXME: not generic.
+ mln_site(I) p;
+ def::coord& row = p.row();
+ def::coord& col = p.col();
+
+ char bdr = '#';
+
+ for (col = min_col; col <= max_col + 2; ++col)
+ std::cout << bdr << ' ';
+ std::cout << std::endl;
+
+ for (row = min_row; row <= max_row; ++row)
+ {
+ std::cout << bdr;
+ for (col = min_col; col <= max_col; ++col)
+ if (ima(p))
+ switch (face_dim(p))
+ {
+ case 0:
+ ostr << " +";
+ break;
+ case 1:
+ ostr << (is_1_face_horizontal(p) ? " -" : " |");
+ break;
+ case 2:
+ // ostr << " O";
+ ostr << (k2::is_primary_2_face(p) ? " O" : " x");
+ break;
+ }
+ else
+ ostr << " ";
+ std::cout << ' ' << bdr << std::endl;
+ }
+ for (col = min_col; col <= max_col + 2; ++col)
+ std::cout << bdr << ' ';
+ std::cout << std::endl
+ << std::endl;
+
+ trace::exiting("mln::world::kn::debug::println");
+ };
+
+ template <typename I>
+ void println(const Image<I>& ima,
+ std::ostream& ostr = std::cout)
+ {
+ println("", ima, ostr);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // mln::world::kn::debug
+
+ } // mln::world::kn
+
+ } // mln::world
+
+} // mln
+
+#endif // ! MLN_WORLD_KN_DEBUG_PRINTLN_HH
--
1.7.2.5
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 5ee0431581d8905678c4823763e8c929f9cbe1d2 (commit)
via 1900032a893ee9b05c63d3f0bf4a2708dd71f80a (commit)
via e9f27f7cb1ea8838b14cb139485867936c1a8d9b (commit)
from 79013f593d29d76f1cedd81e2b82b592456bb16e (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 -----------------------------------------------------------------
5ee0431 mln/world/kn/fill_0_from_1_faces.hh: Add an overload with functions.
1900032 Cleanup code.
e9f27f7 Add kn::border::compute_1_faces.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 27 ++++++
milena/mln/world/k1/fill_0_from_1_faces.hh | 6 +-
milena/mln/world/k1/fill_1_from_2_faces.hh | 3 +
.../{duplicate_2_faces.hh => compute_1_faces.hh} | 85 ++++++++------------
milena/mln/world/kn/border/duplicate_2_faces.hh | 2 +-
milena/mln/world/kn/fill_0_from_1_faces.hh | 25 ++++++-
milena/mln/world/kn/fill_0_from_2_faces.hh | 7 +-
milena/mln/world/kn/fill_1_from_2_faces.hh | 3 +
milena/mln/world/kn/fill_1_from_aux_2_faces.hh | 3 +
milena/mln/world/kn/fill_2_from_1_faces.hh | 7 +-
10 files changed, 103 insertions(+), 65 deletions(-)
copy milena/mln/world/kn/border/{duplicate_2_faces.hh => compute_1_faces.hh} (57%)
hooks/post-receive
--
Olena, a generic and efficient image processing platform