* new-header: New.
* Makefile.am (EXTRA_DIST): Add new-header.
---
milena/ChangeLog | 7 ++
milena/Makefile.am | 3 +
milena/new-header | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 165 insertions(+), 0 deletions(-)
create mode 100755 milena/new-header
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c1289de..fb6f94c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-28 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Add a script to generate a Milena header file.
+
+ * new-header: New.
+ * Makefile.am (EXTRA_DIST): Add new-header.
+
2012-09-25 Roland Levillain <roland(a)lrde.epita.fr>
Fix file names in apps/morphers/recorder-bft.
diff --git a/milena/Makefile.am b/milena/Makefile.am
index 99f5268..7492f16 100644
--- a/milena/Makefile.am
+++ b/milena/Makefile.am
@@ -111,3 +111,6 @@ EXTRA_DIST += \
tests/img/test_rgb8.tif \
tests/img/test_bw.tif \
tests/img/test_gl.tif
+
+# Header file generator.
+EXTRA_DIST += new-header
diff --git a/milena/new-header b/milena/new-header
new file mode 100755
index 0000000..296095c
--- /dev/null
+++ b/milena/new-header
@@ -0,0 +1,155 @@
+#! /bin/sh
+
+me=$(basename $0)
+
+stderr ()
+{
+ for i
+ do
+ echo >&2 "$me: $i"
+ done
+}
+
+fatal ()
+{
+ stderr "$@"
+ exit 1
+}
+
+usage ()
+{
+ cat <<EOF
+Usage: $me: FILENAME
+
+with
+ FILENAME path to filename, e.g. "mln/foo/bar.hh"
+EOF
+}
+
+
+process()
+{
+ year=$(date +%Y)
+ guard=$(echo "$1" | tr "[:lower:].-/" "[:upper:]_")
+ function=$(basename "$filename" .hh)
+
+ # Almost fully qualified name (`mln' is dropped if it is the
+ # outermost namespace).
+ qual_name=$(echo "$filename" \
+ | sed 's,^mln/,,' \
+ | sed 's,\.hh$,,' \
+ | sed 's,/,::,g')
+
+ dirs=$(dirname "$filename" | tr '/' ' ')
+
+ # Newline.
+ nl="
+"
+ # Indentation.
+ indent=""
+ # Namespace opening and closing statements.
+ ns_opening=""
+ ns_closing=""
+ for dir in $dirs; do
+ ns_opening="${ns_opening}${indent}$nl"
+ ns_opening="${ns_opening}${indent}namespace $dir$nl"
+ ns_opening="${ns_opening}${indent}{$nl"
+ ns_closing="${indent}} // end of namespace $dir$nl${ns_closing}"
+ ns_closing="${indent}$nl${ns_closing}"
+ indent="${indent} "
+ done
+
+#\\} // end of namespace mln
+
+ # Perl is used when the substitution pattern contains several lines;
+ # in these cases, escape `@' as it is a special meaning in Perl
+ # (array sigil).
+ sed -e "s/@YEAR@/$year/" \
+ -e "s/@GUARD@/$guard/" \
+ -e "s/@FUNCTION@/$function/" \
+ -e "s/@QUAL_NAME@/$qual_name/" \
+ | sed "/@BEGIN_INDENT@/,/@END_INDENT@/s/^\([^#]\)/$indent\\1/" \
+ | sed -e "/@BEGIN_INDENT@/d" \
+ -e "/@END_INDENT@/d" \
+ | perl -p -e "s,\\@NAMESPACE_OPENING\\@,$ns_opening,;" \
+ -e "s,\\@NAMESPACE_CLOSING\\@,$ns_closing,"
+}
+
+
+if test $# -ne 1; then
+ usage
+ exit 1
+fi
+
+filename=$1
+prefix=$(dirname "$filename")
+
+mkdir -p "$prefix" || fatal "cannot create directory \`$prefix'"
+
+process "$filename" >"$filename" <<EOF
+// Copyright (C) @YEAR@ 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.
+
+#ifndef @GUARD@
+# define @GUARD@
+
+/// \file
+/// \brief FIXME: Enter short file description here.
+
+// FIXME: Adjust headers inclusions.
+# include <mln/core/concept/image.hh>
+# include <mln/core/routine/duplicate.hh>
+
+@NAMESPACE_OPENING@
+@BEGIN_INDENT@
+/// FIXME: Document this function.
+template <typename I>
+mln_concrete(I)
+@FUNCTION@(const Image<I>& input);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+template <typename I>
+inline
+mln_concrete(I)
+@FUNCTION@(const Image<I>& input)
+{
+ trace::entering("@QUAL_NAME@");
+
+ // FIXME: Replace this dummy statement with actual code.
+ mln_concrete(I) output = duplicate(input);
+ // ...
+
+ trace::exiting("@QUAL_NAME@");
+ return output;
+}
+
+# endif // ! MLN_INCLUDE_ONLY
+
+@END_INDENT@
+@NAMESPACE_CLOSING@
+#endif // ! @GUARD@
+EOF
--
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 unstable/scribo has been updated
via 39c49007646f0a4b5ca021af14ee039220865935 (commit)
via 4b68faa4d9d1d5895d02886babfa882daacfff34 (commit)
via 100a5de1c32ce7239ed7516e695f73039d34c197 (commit)
from a0009d29906b8d09acfec883cb0525a744af261c (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 -----------------------------------------------------------------
39c4900 mln/debug/draw_graph.hh: Add a new overload and fix comments.
4b68faa scribo/src/content_in_doc.cc: Add more debug images.
100a5de scribo/debug/logger.hh: Fix attributes initialization order.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 4 ++
milena/mln/debug/draw_graph.hh | 66 +++++++++++++++++++++++++++++-----------
scribo/ChangeLog | 8 +++++
scribo/scribo/debug/logger.hh | 4 +-
scribo/src/content_in_doc.cc | 4 ++
5 files changed, 66 insertions(+), 20 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
---
milena/ChangeLog | 4 ++
milena/mln/debug/draw_graph.hh | 66 +++++++++++++++++++++++++++++-----------
2 files changed, 52 insertions(+), 18 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c8f5f24..fdc8bd7 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,7 @@
+2012-09-28 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/debug/draw_graph.hh: Add a new overload and fix comments.
+
2012-05-11 Guillaume Lazzara <z(a)lrde.epita.fr>
* mln/core/alias/neighb3d.hh: Fix invalid c8_3d neighborhood.
diff --git a/milena/mln/debug/draw_graph.hh b/milena/mln/debug/draw_graph.hh
index 1bcbde6..0bab6f3 100644
--- a/milena/mln/debug/draw_graph.hh
+++ b/milena/mln/debug/draw_graph.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011, 2012 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -48,10 +48,11 @@ namespace mln
namespace debug
{
- /// Draw an image \p ima from a mln::p_vertices \p pv, with
- /// value \p vcolor for vertices, value \p ecolor for edges and 0 for
- /// the background.
- /*
+ /// \brief Draw an image \p ima from a mln::p_vertices \p pv.
+ /*!
+ * Value \p vcolor for vertices, value \p ecolor for edges
+ * and 0 for the background.
+ *
* \param[in,out] ima The image to be drawn.
* \param[in] pv The p_vertices which contains vertices positions.
* \param[in] vcolor The value to assign to pixels which contains
@@ -65,26 +66,41 @@ namespace mln
mln_value(I) vcolor, mln_value(I) ecolor);
- /// Draw an image \p ima from a mln::p_vertices \p pv. Colors for vertices
- /// are defined through \p vcolor_f_. Colors for edges are defined though
- /// \p ecolor_f_.
- /*
+ /// \brief Draw an image \p ima from a mln::p_vertices \p pv.
+ /*!
+ * Colors for vertices are defined through \p vcolor_f_. Colors
+ * for edges are defined though \p ecolor_f_.
+ * Vertices are drawn using a box of width \vwidth.
+ *
* \param[in,out] ima The image to be drawn.
* \param[in] pv The p_vertices which contains vertices positions.
- * \param[in] vcolor_f_ A function returning a color value for vertices.
- * \param[in] ecolor_f_ A function returning a color value for edges.
+ * \param[in] vcolor_f A function returning a color value for vertices.
+ * \param[in] ecolor_f A function returning a color value for edges.
+ * \param[in] vwidth
*
*/
template <typename I, typename G, typename F, typename V, typename E>
void
draw_graph(Image<I>& ima,
const p_vertices<G, F>& pv,
+ const Function<V>& vcolor_f, const Function<E>& ecolor_f,
+ unsigned vwidth);
+
+
+ /// \overload
+ template <typename I, typename G, typename F, typename V, typename E>
+ inline
+ void
+ draw_graph(Image<I>& ima_,
+ const p_vertices<G, F>& pv,
const Function<V>& vcolor_f_, const Function<E>& ecolor_f_);
- /// Draw an image \p ima from a mln::p_vertices \p pv. Colors for vertices
- /// are defined through \p vcolor_f_. Colors for edges are defined though
- /// \p ecolor_f_.
- /*
+ /// \brief Draw an image \p ima from a mln::p_vertices \p pv.
+ /*!
+ * Colors for vertices
+ * are defined through \p vcolor_f_. Colors for edges are defined though
+ * \p ecolor_f_.
+ *
* \param[in,out] ima The image to be drawn.
* \param[in] pv The p_vertices which contains vertices positions.
* \param[in] vcolor_f_ A function returning a color value for vertices.
@@ -172,7 +188,8 @@ namespace mln
void
draw_graph(Image<I>& ima_,
const p_vertices<G, F>& pv,
- const Function<V>& vcolor_f_, const Function<E>& ecolor_f_)
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_,
+ unsigned vwidth)
{
trace::entering("debug::draw_graph");
@@ -191,11 +208,13 @@ namespace mln
draw::line(ima, pv(ei.v1()), pv(ei.v2()), ecolor_f(ei.id()));
// Draw vertices.
+ unsigned vhalf_width = vwidth / 2;
mln_piter(pv_t) p(pv);
for_all(p)
if (ima.has(p) && p.id() != 0u)
{
- box2d box(p + dpoint2d(-5, -5), p + dpoint2d(+5, +5));
+ box2d box(p + dpoint2d(-vhalf_width, -vhalf_width),
+ p + dpoint2d(+vhalf_width, +vhalf_width));
box.crop_wrt(ima.domain());
draw::box_plain(ima, box, vcolor_f(p.id()));
}
@@ -204,6 +223,17 @@ namespace mln
}
+ template <typename I, typename G, typename F, typename V, typename E>
+ inline
+ void
+ draw_graph(Image<I>& ima,
+ const p_vertices<G, F>& pv,
+ const Function<V>& vcolor_f, const Function<E>& ecolor_f)
+ {
+ draw_graph(ima, pv, vcolor_f, ecolor_f, 5);
+ }
+
+
// FIXME: Refactor + be more restrictive on the function type.
template <typename I, typename G, typename F, typename V, typename E>
inline
--
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 papers/lazzara.12.ijdar has been updated
via c671343e8aba129d47b890f655175d3f3c07a769 (commit)
from f7985a1b13b6492cf8bbbb80ac88fdb3da625005 (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 -----------------------------------------------------------------
c671343 src/binarization/sauvola_ms.cc: Use global timer instead of local one.
-----------------------------------------------------------------------
Summary of changes:
scribo/ChangeLog | 5 +++++
scribo/src/binarization/sauvola_ms.cc | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
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 sandbox-theo-topology has been created
at cc5acd676636c87f53d9f9b41dd4f31e0d7718d8 (commit)
- Log -----------------------------------------------------------------
cc5acd6 Update sandbox.
479e023 Populate gorely sandbox-theo-topology.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
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
---
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