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
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Improve hexagonal images. Fixme : doesn't work properly now.
* mln/debug/println.hh: Println for hexa images.
* mln/core/box2d_h.hh: Box with hexa points.
* mln/core/hexa.hh: Hexa image class declaration.
* tests/hexa.cc: Hexa test
* tests/image2d_h.cc: hexagonal image2d test.
* mln/core/hexa_piter.hh: Hexagonal iterator.
* mln/core/image2d_h.hh: Shortcut to hexa< image2d<V> >
---
mln/core/box2d_h.hh | 11 +--
mln/core/hexa.hh | 55 ++++++++++++------
mln/core/hexa_piter.hh | 147 +++++++++++++++++++++++++++++++++++++++++++++++++
mln/core/image2d_h.hh | 86 ++++++++++++++++++++++++++++
mln/debug/println.hh | 41 +++++++++++++
tests/hexa.cc | 8 +-
tests/image2d_h.cc | 65 +++++++++++++++++++++
7 files changed, 386 insertions(+), 27 deletions(-)
Index: trunk/milena/tests/image2d_h.cc
===================================================================
--- trunk/milena/tests/image2d_h.cc (revision 0)
+++ trunk/milena/tests/image2d_h.cc (revision 1286)
@@ -0,0 +1,65 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 tests/hexa.cc
+ *
+ * \brief Tests on mln::hexa
+ */
+
+#include <mln/core/image2d_h.hh>
+
+#include <mln/value/int_u16.hh>
+#include <mln/trait/image/print.hh>
+#include <mln/debug/iota.hh>
+#include <mln/debug/println.hh>
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u16;
+
+ image2d_h<int_u16> h(2,7);
+
+ debug::iota(h);
+
+ debug::println(h);
+
+// image2d<int_u16> h(2,7);
+// debug::println(h);
+
+ trait::image::print(h, std::cout);
+
+
+ // FIXME : to put into debug::println
+ image2d_h<int_u16>::fwd_piter p(h.domain());
+
+// for_all(p)
+// {
+// std::cout << p << "->" << std::endl;
+// }
+}
Index: trunk/milena/tests/hexa.cc
===================================================================
--- trunk/milena/tests/hexa.cc (revision 1285)
+++ trunk/milena/tests/hexa.cc (revision 1286)
@@ -35,6 +35,7 @@
#include <mln/value/int_u8.hh>
#include <mln/trait/image/print.hh>
+#include <mln/debug/iota.hh>
int main()
@@ -46,14 +47,15 @@
I ima(3,3);
hexa<I> h(ima);
-
+ debug::iota(ima);
trait::image::print(h, std::cout);
// FIXME : to put into debug::println
- I::fwd_piter p(ima.domain());
+ hexa<I>::fwd_piter p(h.domain());
+
for_all(p)
{
- ;
+ std::cout << p << "->" << h(p) << std::endl;
}
}
Index: trunk/milena/mln/debug/println.hh
===================================================================
--- trunk/milena/mln/debug/println.hh (revision 1285)
+++ trunk/milena/mln/debug/println.hh (revision 1286)
@@ -56,8 +56,11 @@
// generic version
template <typename S, typename I>
- void println(const S&, const Image<I>& input_)
+ void println(const S& b, const Image<I>& input_)
{
+ void* tes = exact(input_);
+ void* a = b;
+
const I& input = exact(input_);
mln_piter(I) p(input.domain());
for_all(p)
@@ -92,6 +95,42 @@
# endif // MLN_CORE_BOX2D_HH
+# ifdef MLN_CORE_IMAGE2D_H_HH
+
+ // Hexa version
+ template <typename I>
+ void println(const box2d_h& b, const hexa<I>& input)
+ {
+ typename hexa<I>::fwd_piter p(input.domain());
+
+ int c = 1;
+ int r = 1;
+ int row_len = (b.max_col() - b.min_col()) / 2;
+
+ for_all(p)
+ {
+ //if (input.has(p))
+ //std::cout << p << " ";
+ std::cout << format(input(p)) << " ";
+ //else
+ // std::cout << " ";
+
+ if (c >= row_len)
+ {
+ std::cout << std::endl;
+ if (r % 2)
+ std::cout << " ";
+ c = 0;
+ r++;
+ }
+ c++;
+ }
+ std::cout << std::endl;
+ }
+
+# endif // MLN_CORE_IMAGE2D_H_HH
+
+
# ifdef MLN_CORE_BOX3D_HH
template <typename I>
Index: trunk/milena/mln/core/hexa.hh
===================================================================
--- trunk/milena/mln/core/hexa.hh (revision 1285)
+++ trunk/milena/mln/core/hexa.hh (revision 1286)
@@ -37,6 +37,8 @@
# include <mln/core/internal/image_domain_morpher.hh>
# include <mln/core/point2d_h.hh>
+# include <mln/core/box2d_h.hh>
+# include <mln/core/hexa_piter.hh>
namespace mln
@@ -51,9 +53,10 @@
template <typename I>
struct data_< hexa<I> >
{
- data_(I& ima);
+ data_(I& ima, box2d_h b);
I ima_;
+ mln::box2d_h b_;
};
} // end of namespace mln::internal
@@ -92,22 +95,24 @@
* which handles hexagonal grid.
*
* Ex :
+ * 1 3 5 7 9 11
+ * 0 2 4 6 8 10
* -------------------
- * XX| | | | | | |XX
+ * 0 XX| | | | | | |XX
* ---------------------
- * XX| | | | | | |XX
+ * 2 XX| | | | | | |XX
* ---------------------
- * XX| | | | | | |XX
+ * 4 XX| | | | | | |XX
* ---------------------
- * XX| | | | | | |XX
+ * 6 XX| | | | | | |XX
* ---------------------
- * XX| | | | | | |XX
+ * 8 XX| | | | | | |XX
* -------------------
*
*
*/
template <typename I>
- struct hexa : public internal::image_domain_morpher_< I, mln_pset(I), hexa<I> >
+ struct hexa : public internal::image_domain_morpher_< I, box2d_h, hexa<I> >
{
/// Skeleton.
typedef hexa< tag::image_<I> > skeleton;
@@ -116,7 +121,7 @@
typedef mln_value(I) value;
/// Lvalue associated type.
- typedef mln_value(I) lvalue;
+ typedef mln_lvalue(I) lvalue;
/// Return type of read-only access.
typedef mln_rvalue(I) rvalue;
@@ -124,6 +129,15 @@
/// Point site type
typedef point2d_h psite;
+ /// FIXME : should it be in box2d_h?
+ /// Forward Point_Iterator associated type.
+ typedef hexa_fwd_piter_<box2d> fwd_piter;
+
+ /// FIXME : should it be in box2d_h?
+ /// Backward Point_Iterator associated type.
+ /// typedef hexa_fwd_piter_<box2d> bkd_piter;
+
+
/// Constructor without argument.
hexa();
@@ -134,7 +148,7 @@
void init_(I& ima);
/// Give the definition domain.
- const mln_pset(I)& domain() const;
+ const box2d_h& domain() const;
/// Test if \p p belongs to the image domain.
bool has(const psite& p) const;
@@ -144,7 +158,7 @@
rvalue operator()(const point2d_h& p) const;
/// Read-write access of pixel value at hexa point site \p p.
- value operator()(const point2d_h& p);
+ lvalue operator()(const point2d_h& p);
};
template <typename I, typename J>
@@ -171,8 +185,9 @@
{
template <typename I>
- data_< hexa<I> >::data_(I& ima)
- : ima_(ima)
+ data_< hexa<I> >::data_(I& ima, box2d_h b)
+ : ima_(ima),
+ b_(b)
{
}
@@ -184,11 +199,13 @@
hexa<I>::init_(I& ima)
{
mln_precondition(! this->has_data());
- this->data_ = new internal::data_< hexa<I> >(ima);
+ box2d b_in = ima.bbox();
+ box2d_h b = make::box2d_h(b_in.pmin()[0], b_in.pmin()[1] * 2 - 1,
+ b_in.pmax()[0], b_in.pmax()[1] * 2 - 1);
+ this->data_ = new internal::data_< hexa<I> >(ima, b);
}
-
template <typename I>
hexa<I>::hexa()
{
@@ -205,27 +222,31 @@
typename hexa<I>::rvalue
hexa<I>::operator()(const point2d_h& p) const
{
+ mln_precondition(this->has_data());
return this->data_->ima_(make::point2d(p[0] / 2, p[1] / 2));
}
template <typename I>
- typename hexa<I>::value
+ typename hexa<I>::lvalue
hexa<I>::operator()(const point2d_h& p)
{
+ mln_precondition(this->has_data());
return this->data_->ima_(make::point2d(p[0] / 2, p[1] / 2));
}
template <typename I>
- const mln_pset(I)&
+ const box2d_h&
hexa<I>::domain() const
{
- return this->data_->ima_.domain();
+ mln_precondition(this->has_data());
+ return this->data_->b_;
}
template <typename I>
bool
hexa<I>::has(const psite& p) const
{
+ mln_precondition(this->has_data());
return this->data_->ima_.has(make::point2d(p[0] / 2, p[1] / 2));
}
Index: trunk/milena/mln/core/hexa_piter.hh
===================================================================
--- trunk/milena/mln/core/hexa_piter.hh (revision 0)
+++ trunk/milena/mln/core/hexa_piter.hh (revision 1286)
@@ -0,0 +1,147 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_HEXA_PITER_HH
+# define MLN_CORE_HEXA_PITER_HH
+
+/*! \file mln/core/hexa_piter.hh
+ *
+ * \brief Definition of iterators on points of pset_ifes.
+ */
+
+# include <mln/core/internal/piter_adaptor.hh>
+
+# include <mln/core/box2d.hh>
+# include <mln/core/inplace.hh>
+
+namespace mln
+{
+
+ /*! \brief A generic forward iterator on points of subsets.
+ *
+ * Parameter \c S is a point set type; parameter F is a function
+ * from point to Boolean.
+ *
+ * \see mln::hexa
+ */
+ template <typename S>
+ class hexa_fwd_piter_
+ : public internal::piter_adaptor_< mln_fwd_piter(S),
+ hexa_fwd_piter_<S> >
+ {
+ typedef mln_fwd_piter(S) adaptee_;
+ typedef hexa_fwd_piter_<S> self_;
+ typedef internal::piter_adaptor_<adaptee_, self_> super_;
+
+ public:
+
+ /// Constructor from a subset of points.
+ hexa_fwd_piter_(const box2d& subset);
+ hexa_fwd_piter_(const box2d_h& subset);
+
+ /// Dtor
+ ~hexa_fwd_piter_();
+
+ /// Start an iteration.
+ void start();
+
+ /// Go to the next point.
+ void next_();
+
+ operator point2d_h() const;
+ private:
+
+ point2d_h p_;
+ };
+
+
+ // FIXME:
+ template <typename S>
+ class hexa_bkd_piter_
+ :
+ public mln::internal::fixme
+ {};
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // hexa_fwd_piter_<I>
+
+ template <typename S>
+ hexa_fwd_piter_<S>::hexa_fwd_piter_(const box2d& b)
+ : super_(adaptee_(b))
+ {
+ }
+
+ template <typename S>
+ hexa_fwd_piter_<S>::hexa_fwd_piter_(const box2d_h& b)
+ : super_(adaptee_(*new box2d(make::box2d(b.pmin()[0] / 2, b.pmin()[1] / 2,
+ b.pmax()[0] / 2 + 1, b.pmax()[1] / 2 + 1))))
+ {
+ }
+
+ template <typename S>
+ hexa_fwd_piter_<S>::~hexa_fwd_piter_()
+ {
+ }
+
+ template <typename S>
+ void
+ hexa_fwd_piter_<S>::start()
+ {
+ this->piter_.start();
+ p_[0] = this->piter_[0];
+ p_[1] = this->piter_[1];
+ }
+
+ template <typename S>
+ void
+ hexa_fwd_piter_<S>::next_()
+ {
+ this->piter_.next();
+ p_[0] = this->piter_[0] * 2;
+ p_[1] = this->piter_[1] * 2 + this->piter_[0] % 2;
+ std::cout << "next :" << p_ << std::endl;
+ }
+
+ template <typename S>
+ hexa_fwd_piter_<S>::operator point2d_h() const
+ {
+ return p_;
+ }
+
+ // FIXME: hexa_bkd_piter_<S>
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_HEXA_PITER_HH
Index: trunk/milena/mln/core/box2d_h.hh
===================================================================
--- trunk/milena/mln/core/box2d_h.hh (revision 1285)
+++ trunk/milena/mln/core/box2d_h.hh (revision 1286)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_BOX2D_HH
-# define MLN_CORE_BOX2D_HH
+#ifndef MLN_CORE_BOX2D_H_HH
+# define MLN_CORE_BOX2D_H_HH
/*! \file mln/core/box2d.hh
*
@@ -35,19 +35,18 @@
*/
# include <mln/core/box.hh>
+# include <mln/core/box2d.hh>
# include <mln/core/point2d_h.hh>
namespace mln
{
- /*! \brief Type alias for a box defined on the 2D square grid with
- * integer coordinates.
+ /*! \brief FIXME
*
- * \see mln::win::rectangle2d.
*/
- typedef box_<point2d_h> box2d_h;
+ typedef box_<point2d_h> box2d_h;
} // end of namespace mln
Index: trunk/milena/mln/core/image2d_h.hh
===================================================================
--- trunk/milena/mln/core/image2d_h.hh (revision 0)
+++ trunk/milena/mln/core/image2d_h.hh (revision 1286)
@@ -0,0 +1,86 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_IMAGE2D_H_HH
+# define MLN_CORE_IMAGE2D_H_HH
+
+/*! \file mln/core/hexa_piter.hh
+ *
+ * \brief Definition of iterators on points of pset_ifes.
+ */
+
+# include <mln/core/image2d.hh>
+# include <mln/core/hexa.hh>
+
+# include <mln/border/thickness.hh>
+
+
+# include <mln/debug/println.hh>
+
+namespace mln
+{
+ template <typename V>
+ struct image2d_h
+ : public hexa< image2d<V> >
+ {
+ //typedef hexa< image2d<V> > super_;
+
+ /// Point site type
+ typedef point2d_h psite;
+
+ /// Constructor with the numbers of rows and columns
+ /// border thickness.
+ image2d_h(int nrows, int ncols, unsigned bdr = border::thickness);
+
+ //using super_::init_;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename V>
+ image2d_h<V>::image2d_h(int nrows, int ncols, unsigned bdr)
+ {
+ std::cout << "Image2d_h Ctor " << nrows << " "
+ << ncols / 2 + 1 << std::endl;
+
+ mln_assertion(ncols % 2 == 1);
+ image2d<V> ima(nrows,
+ ncols / 2 + 1,
+ bdr);
+
+ debug::println(ima);
+
+ this->init_(ima);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_IMAGE2D_H_HH
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add translate image in sandbox.
* translate_image.cc: New test for translate image.
* translate_image.hh: New image : translate image.
* color_sub.cc: Update.
---
color_sub.cc | 14 ----
translate_image.cc | 42 ++++++++++++
translate_image.hh | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 220 insertions(+), 12 deletions(-)
Index: trunk/milena/sandbox/duhamel/translate_image.hh
===================================================================
--- trunk/milena/sandbox/duhamel/translate_image.hh (revision 0)
+++ trunk/milena/sandbox/duhamel/translate_image.hh (revision 1285)
@@ -0,0 +1,176 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_TRANSLATE_IMAGE_HH
+# define MLN_CORE_TRANSLATE_IMAGE_HH
+
+/*! \file mln/core/translate_image.hh
+ *
+ * \brief Definition of an image class FIXME
+ */
+
+# include <cmath>
+
+# include <mln/core/internal/image_identity.hh>
+# include <mln/core/box2d.hh>
+
+
+namespace mln
+{
+
+ // Fwd decl.
+ template <typename I> struct translate_image;
+
+ namespace internal
+ {
+
+ template <typename I>
+ struct data_< translate_image<I> >
+ {
+ data_(I& ima, const mln_dpoint(I) dp);
+
+ I ima_;
+ box2d bb_;
+ const mln_dpoint(I) dp_;
+ };
+
+ } // end of namespace mln::internal
+
+
+ /*! \brief FIXME
+ *
+ */
+ template <typename I>
+ struct translate_image : public mln::internal::image_identity_< I, mln_pset(I), translate_image<I> >
+ {
+
+ typedef mln::internal::image_morpher_< I, mln_pset(I), translate_image<I> > super_;
+
+ /// Return type of read-write access.
+ typedef typename internal::morpher_lvalue_<I>::ret lvalue;
+
+
+ /// Skeleton.
+ typedef translate_image< tag::image_<I> > skeleton;
+
+ /// Test if a pixel value is accessible at \p p.
+ using super_::has_data;
+
+ /// Constructors.
+ translate_image(I& ima, const mln_dpoint(I) dp);
+ translate_image();
+
+ /// FIXME: Doc!
+ const box2d& domain() const;
+
+ /// Test if a pixel value is accessible at \p p.
+ bool owns_(const mln_psite(I)& ) const;
+
+ /// Read-only access of pixel value at point site \p p.
+ mln_rvalue(I) operator()(const mln_psite(I)& p) const;
+
+ /// Read and "write if possible" access of pixel value at point site \p p.
+ lvalue operator()(const mln_psite(I)& p);
+ };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+ // internal::data_< translate_image<I,S> >
+
+ template <typename I>
+ data_< translate_image<I> >::data_(I& ima, const mln_dpoint(I) dp)
+ : ima_ (ima),
+ dp_ (dp)
+ {
+ point2d start = ima.bbox ().pmin () + dp;
+ point2d end = ima.bbox ().pmax () + dp;
+ int x1 = start[0];
+ int y1 = start[1];
+ int x2 = end[0];
+ int y2 = end[1];
+
+ bb_ = make::box2d (x1, y1, x2, y2);
+ }
+
+ } // end of namespace mln::internal
+
+ template <typename I>
+ translate_image<I>::translate_image(I& ima, const mln_dpoint(I) dp)
+ {
+ mln_precondition(ima.has_data());
+ this->data_ = new internal::data_< translate_image<I> >(ima, dp);
+ }
+
+ template <typename I>
+ translate_image<I>::translate_image()
+ {
+ }
+
+ template <typename I>
+ bool translate_image<I>::owns_(const mln_psite(I)& p) const
+ {
+ mln_point(I) np = p - this->data_->dp_;
+ return this->data_->ima_.owns_(np);
+ }
+
+ template <typename I>
+ mln_rvalue(I)
+ translate_image<I>::operator()(const mln_psite(I)& p) const
+ {
+ mln_assertion(this->owns_(p));
+ mln_point(I) np = p - this->data_->dp_;
+ return this->data_->ima_(np);
+ }
+
+
+ template <typename I>
+ typename translate_image<I>::lvalue
+ translate_image<I>::operator()(const mln_psite(I)& p)
+ {
+ mln_assertion(this->owns_(p));
+ mln_point(I) np = p - this->data_->dp_;
+ return this->data_->ima_(np);
+ }
+
+ template <typename I>
+ const box2d&
+ translate_image<I>::domain() const
+ {
+ return this->data_->bb_;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_TRANSLATE_IMAGE_HH
Index: trunk/milena/sandbox/duhamel/color_sub.cc
===================================================================
--- trunk/milena/sandbox/duhamel/color_sub.cc (revision 1284)
+++ trunk/milena/sandbox/duhamel/color_sub.cc (revision 1285)
@@ -37,24 +37,14 @@
#include <mln/value/rgb8.hh>
#include <mln/level/fill.hh>
#include <mln/debug/println.hh>
-
#include <mln/core/image2d_b.hh>
-#include <mln/core/point2d.hh>
#include <mln/debug/println.hh>
-#include <mln/util/graph.hh>
#include <mln/io/ppm/save.hh>
-#include <mln/fun/p2b/chess.hh>
-
#include <mln/core/image_if_value.hh>
-#include <mln/debug/iota.hh>
-
-
-#include <mln/core/image2d_b.hh>
#include <mln/core/sub_image.hh>
#include <mln/core/image_if_value.hh>
#include <mln/core/inplace.hh>
-#include <mln/level/fill.hh>
# include <mln/debug/println.hh>
# include <mln/core/w_window2d_int.hh>
# include <mln/core/w_window2d_float.hh>
@@ -64,7 +54,7 @@
# include <mln/geom/chamfer.hh>
# include <mln/io/pbm/load.hh>
-#include "color_sub.hh"
+# include <mln/display/color_pretty.hh>
int main()
{
@@ -74,7 +64,7 @@
image2d_b<bool> input = io::pbm::load("../../img/toto.pbm");
const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 0> ();
image2d_b<unsigned> tmp = geom::chamfer(input, w_win, max);
- image2d_b<value::rgb8> out = color(inplace (tmp | 4));
+ image2d_b<value::rgb8> out = display::color_pretty(inplace (tmp | 4));
io::ppm::save(out, "out.ppm");
std::cout << "out.ppm generate" << std::endl;
}
Index: trunk/milena/sandbox/duhamel/translate_image.cc
===================================================================
--- trunk/milena/sandbox/duhamel/translate_image.cc (revision 0)
+++ trunk/milena/sandbox/duhamel/translate_image.cc (revision 1285)
@@ -0,0 +1,42 @@
+#include <mln/core/image2d.hh>
+#include <mln/value/int_u8.hh>
+#include <mln/debug/iota.hh>
+#include <mln/level/fill.hh>
+#include <mln/level/paste.hh>
+#include <mln/border/fill.hh>
+#include <mln/debug/println_with_border.hh>
+#include <mln/debug/println.hh>
+#include "translate_image.hh"
+
+int main ()
+{
+ using namespace mln;
+
+ typedef image2d<value::int_u8> I;
+
+ I ima (4, 2, 1);
+ debug::iota (ima);
+ translate_image<I> tmp (ima, make::point2d (0,2) - make::point2d (0,0));
+ std::cout << "orginal image domain : "
+ << ima.domain ()
+ << std::endl
+ << "translated image domain : "
+ << tmp.domain ()
+ << std::endl;
+
+ std::cout << "original image :"
+ << std::endl;
+ debug::println (ima);
+ std::cout << std::endl;
+ std::cout << "translated image :"
+ << std::endl;
+ debug::println (tmp);
+// std::cout << std::endl;
+// I out (4,4);
+// level::paste(ima, out);
+// level::paste(tmp, out);
+// std::cout << "pasted image :"
+// << std::endl;
+// debug::println (out);
+// std::cout << std::endl;
+}
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Add composed transformation. (Does not work !).
* mln/fun/x2x/bijective_tr.hh: Bijective transformation.
* mln/fun/x2x/composed.hh: Composed tranformation.
* mln/fun/x2x/rotation.hh: Update.
* mln/fun/x2x/translation.hh: Update.
---
bijective_tr.hh | 68 +++++++++++++++++++++++
composed.hh | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rotation.hh | 4 -
translation.hh | 4 -
4 files changed, 233 insertions(+), 4 deletions(-)
Index: trunk/milena/mln/fun/x2x/composed.hh
===================================================================
--- trunk/milena/mln/fun/x2x/composed.hh (revision 0)
+++ trunk/milena/mln/fun/x2x/composed.hh (revision 1284)
@@ -0,0 +1,161 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_FUN_X2X_COMPOSED_HH
+# define MLN_FUN_X2X_COMPOSED_HH
+
+/*! \file mln/fun/x2x/composed.hh
+ *
+ * \brief FIXME.
+ */
+
+# include <mln/core/concept/function.hh>
+# include <mln/metal/vec.hh>
+# include <mln/metal/mat.hh>
+
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace x2x
+ {
+
+ // Fwd decl.
+ template <typename L, typename M>
+ struct composed;
+
+ namespace internal
+ {
+
+ template <unsigned n, typename L, unsigned m, typename M, typename E>
+ struct helper_;
+
+ template <unsigned n, typename L, typename M, typename E>
+ struct helper_<n, Function_x2x<L>, n, Function_x2x<M> > : Function_x2x<E>
+ {
+ enum {dim = n};
+ };
+
+ template <unsigned n, typename L, typename M, typename E>
+ struct helper_<n, bijective_tr<L>, n, bijective_tr<M> > : bijective_tr<E>
+ {
+ enum {dim = n};
+ typedef composed<M::invert,L::invert> invert;
+
+ invert inv() const;
+ };
+ }
+
+ // FIXME: Doc!
+
+ template <typename L, typename M>
+ struct composed : public internal::helper_< L::dim, L, M::dim, M, composed<L,M> >
+ {
+
+ typedef internal::helper_< L::dim, L, M::dim, M, composed<L,M> > Super
+
+ enum {dim = Super::dim};
+
+ typedef metal::vec<n,C> result;
+
+ composed();
+ composed(const L& tr_l, const M& tr_m);
+
+ result operator()(const metal::vec<n,C>& v) const;
+
+ void set_first(const L& tr_l);
+ void set_second(const M& tr_m);
+
+ protected:
+
+ L tr1_;
+ M tr2_;
+ metal::mat<n + 1,n + 1,C> m_;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename L, typename M>
+ composed<L,M>::composed()
+ {
+ t_ = make::vec<n,C>(0);
+ m_ = metal::mat<n+1,n+1,C>::Id;
+ }
+
+ template <typename L, typename M>
+ composed<L,M>::composed(const L& tr_l, const M& tr_m)
+ :tr1_(tr_l),
+ tr2_(tr_m)
+ {
+ m_ = metal::mat<n+1,n+1,C>::Id;
+ m_ = tr1_ * tr2_;
+ }
+
+ template <typename L, typename M>
+ composed<L,M>::result
+ composed<L,M>::operator()(const metal::vec<n,C>& v) const
+ {
+ return m_(v);
+ }
+
+ template <typename L, typename M>
+ composed<L,M>::invert
+ composed<L,M>::inv() const
+ {
+ typename composed::invert res(tr2_.inv(), tr1_.inv());
+
+ return res;
+ }
+
+ template <typename L, typename M>
+ void
+ composed<L,M>::set_first(const L& tr_l)
+ {
+ tr1_ = tr_l;
+ }
+
+ template <typename L, typename M>
+ void
+ composed<L,M>::set_second(const M& tr_m)
+ {
+ tr2_ = tr_m;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::fun::x2x
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+
+#endif // ! MLN_FUN_X2X_COMPOSED_HH
Index: trunk/milena/mln/fun/x2x/bijective_tr.hh
===================================================================
--- trunk/milena/mln/fun/x2x/bijective_tr.hh (revision 0)
+++ trunk/milena/mln/fun/x2x/bijective_tr.hh (revision 1284)
@@ -0,0 +1,68 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_FUN_X2X_BIJECTIVE_TR_HH
+# define MLN_FUN_X2X_BIJECTIVE_TR_HH
+
+/*! \file mln/fun/x2x/bijective_tr.hh
+ *
+ * \brief FIXME.
+ */
+
+# include <mln/core/concept/function.hh>
+# include <mln/metal/vec.hh>
+# include <mln/metal/mat.hh>
+
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace x2x
+ {
+
+ // FIXME: Doc!
+
+ template <typename E>
+ struct bijective_tr : public Function_x2x< E >
+ {
+ typedef E::result result;
+ typedef E::invert invert;
+
+ invert inv() const;
+ };
+
+ } // end of namespace mln::fun::x2x
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+
+#endif // ! MLN_FUN_X2X_BIJECTIVE_TR_HH
Index: trunk/milena/mln/fun/x2x/translation.hh
===================================================================
--- trunk/milena/mln/fun/x2x/translation.hh (revision 1283)
+++ trunk/milena/mln/fun/x2x/translation.hh (revision 1284)
@@ -33,7 +33,7 @@
* \brief FIXME.
*/
-# include <mln/core/concept/function.hh>
+# include <mln/fun/x2x/bijective_tr.hh>
# include <mln/metal/vec.hh>
# include <mln/metal/mat.hh>
@@ -50,7 +50,7 @@
// FIXME: Doc!
template <unsigned n, typename C>
- struct translation : public Function_x2x< translation<n,C> >
+ struct translation : public bijective_tr< translation<n,C> >
{
enum {dim = n};
Index: trunk/milena/mln/fun/x2x/rotation.hh
===================================================================
--- trunk/milena/mln/fun/x2x/rotation.hh (revision 1283)
+++ trunk/milena/mln/fun/x2x/rotation.hh (revision 1284)
@@ -33,7 +33,7 @@
* \brief FIXME.
*/
-# include <mln/core/concept/function.hh>
+# include <mln/fun/x2x/bijective_tr.hh>
# include <mln/metal/vec.hh>
# include <mln/metal/mat.hh>
# include <cmath>
@@ -51,7 +51,7 @@
// FIXME: Doc!
template <unsigned n, typename C>
- struct rotation : public Function_x2x< rotation<n,C> >
+ struct rotation : public bijective_tr< rotation<n,C> >
{
enum {dim = n};
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Refactoring : move mln/core/win to mln/win.
* mln/core/win/backdiag2d.hh,
* mln/core/win/cube3d.hh,
* mln/core/win/diag2d.hh,
* mln/core/win/disk2d.hh,
* mln/core/win/hline2d.hh,
* mln/core/win/line.hh,
* mln/core/win/octagon2d.hh,
* mln/core/win/rectangle2d.hh,
* mln/core/win/segment1d.hh,
* mln/core/win/vline2d.hh,
* mln/core/win: Rename as ...
* mln/win/backdiag2d.hh,
* mln/win/cube3d.hh,
* mln/win/diag2d.hh,
* mln/win/disk2d.hh,
* mln/win/hline2d.hh,
* mln/win/line.hh,
* mln/win/octagon2d.hh,
* mln/win/rectangle2d.hh,
* mln/win/segment1d.hh,
* mln/win/vline2d.hh,
* mln/win: ...this.
* mln/level/approx/median.hh,
* sandbox/nivault/dyn_line.hh,
* sandbox/nivault/median.hh,
* sandbox/nivault/tests/pouet.cc,
* tests/convert_to_vec_p.cc,
* tests/dpoints_pixter.cc,
* tests/io_pgm16.cc,
* tests/io_ppm16.cc,
* tests/io_ppm23.cc,
* tests/level_approx_median.cc,
* tests/level_median.cc,
* tests/level_median_fast.cc,
* tests/level_median_hline2d.cc,
* tests/level_naive_median.cc,
* tests/local_convolve.cc,
* tests/main.cc,
* tests/morpho_contrast.cc,
* tests/morpho_dilation.cc,
* tests/morpho_dilation_max_h.cc,
* tests/morpho_erosion.cc,
* tests/morpho_erosion_min_h.cc,
* tests/morpho_gradient.cc,
* tests/morpho_hit_or_miss.cc,
* tests/morpho_laplacian.cc,
* tests/morpho_thinning.cc,
* tests/value_float01.cc,
* tests/w_window1d_int.cc,
* tests/w_window2d_int.cc,
* tests/w_window3d_int.cc,
* tests/win_backdiag2d.cc,
* tests/win_diag2d.cc,
* tests/win_disk2d.cc,
* tests/win_hline2d.cc,
* tests/win_octagon2d.cc,
* tests/win_rectangle2d.cc: Update according to the refactoring.
---
mln/level/approx/median.hh | 14 +-
mln/win/backdiag2d.hh | 185 +++++++++++++++++++++++++++++++++++
mln/win/cube3d.hh | 193 ++++++++++++++++++++++++++++++++++++
mln/win/diag2d.hh | 185 +++++++++++++++++++++++++++++++++++
mln/win/disk2d.hh | 179 ++++++++++++++++++++++++++++++++++
mln/win/hline2d.hh | 63 ++++++++++++
mln/win/line.hh | 183 ++++++++++++++++++++++++++++++++++
mln/win/octagon2d.hh | 215 +++++++++++++++++++++++++++++++++++++++++
mln/win/rectangle2d.hh | 198 +++++++++++++++++++++++++++++++++++++
mln/win/segment1d.hh | 181 ++++++++++++++++++++++++++++++++++
mln/win/vline2d.hh | 65 ++++++++++++
sandbox/nivault/dyn_line.hh | 2
sandbox/nivault/median.hh | 4
sandbox/nivault/tests/pouet.cc | 4
tests/convert_to_vec_p.cc | 4
tests/dpoints_pixter.cc | 2
tests/io_pgm16.cc | 2
tests/io_ppm16.cc | 2
tests/io_ppm23.cc | 2
tests/level_approx_median.cc | 4
tests/level_median.cc | 2
tests/level_median_fast.cc | 2
tests/level_median_hline2d.cc | 2
tests/level_naive_median.cc | 2
tests/local_convolve.cc | 2
tests/main.cc | 2
tests/morpho_contrast.cc | 2
tests/morpho_dilation.cc | 8 -
tests/morpho_dilation_max_h.cc | 2
tests/morpho_erosion.cc | 8 -
tests/morpho_erosion_min_h.cc | 2
tests/morpho_gradient.cc | 2
tests/morpho_hit_or_miss.cc | 2
tests/morpho_laplacian.cc | 2
tests/morpho_thinning.cc | 2
tests/value_float01.cc | 2
tests/w_window1d_int.cc | 2
tests/w_window2d_int.cc | 2
tests/w_window3d_int.cc | 2
tests/win_backdiag2d.cc | 2
tests/win_diag2d.cc | 2
tests/win_disk2d.cc | 2
tests/win_hline2d.cc | 2
tests/win_octagon2d.cc | 2
tests/win_rectangle2d.cc | 2
45 files changed, 1698 insertions(+), 51 deletions(-)
Index: trunk/milena/tests/win_hline2d.cc
===================================================================
--- trunk/milena/tests/win_hline2d.cc (revision 1282)
+++ trunk/milena/tests/win_hline2d.cc (revision 1283)
@@ -30,7 +30,7 @@
* \brief Tests on mln::win::diag2d.
*/
-#include <mln/core/win/hline2d.hh>
+#include <mln/win/hline2d.hh>
#include <mln/convert/to_image.hh>
Index: trunk/milena/tests/morpho_dilation_max_h.cc
===================================================================
--- trunk/milena/tests/morpho_dilation_max_h.cc (revision 1282)
+++ trunk/milena/tests/morpho_dilation_max_h.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/core/window2d.hh>
#include <mln/io/pgm/load.hh>
Index: trunk/milena/tests/level_naive_median.cc
===================================================================
--- trunk/milena/tests/level_naive_median.cc (revision 1282)
+++ trunk/milena/tests/level_naive_median.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/io_ppm23.cc
===================================================================
--- trunk/milena/tests/io_ppm23.cc (revision 1282)
+++ trunk/milena/tests/io_ppm23.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/value/rgb8.hh>
Index: trunk/milena/tests/level_median_hline2d.cc
===================================================================
--- trunk/milena/tests/level_median_hline2d.cc (revision 1282)
+++ trunk/milena/tests/level_median_hline2d.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/morpho_erosion.cc
===================================================================
--- trunk/milena/tests/morpho_erosion.cc (revision 1282)
+++ trunk/milena/tests/morpho_erosion.cc (revision 1283)
@@ -31,10 +31,10 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
-#include <mln/core/win/octagon2d.hh>
-#include <mln/core/win/diag2d.hh>
-#include <mln/core/win/backdiag2d.hh>
+#include <mln/win/rectangle2d.hh>
+#include <mln/win/octagon2d.hh>
+#include <mln/win/diag2d.hh>
+#include <mln/win/backdiag2d.hh>
#include <mln/core/window2d.hh>
#include <mln/io/pgm/load.hh>
Index: trunk/milena/tests/morpho_hit_or_miss.cc
===================================================================
--- trunk/milena/tests/morpho_hit_or_miss.cc (revision 1282)
+++ trunk/milena/tests/morpho_hit_or_miss.cc (revision 1283)
@@ -33,7 +33,7 @@
#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/core/window2d.hh>
#include <mln/geom/shift.hh>
#include <mln/set/diff.hh>
Index: trunk/milena/tests/morpho_erosion_min_h.cc
===================================================================
--- trunk/milena/tests/morpho_erosion_min_h.cc (revision 1282)
+++ trunk/milena/tests/morpho_erosion_min_h.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/core/window2d.hh>
#include <mln/io/pgm/load.hh>
Index: trunk/milena/tests/convert_to_vec_p.cc
===================================================================
--- trunk/milena/tests/convert_to_vec_p.cc (revision 1282)
+++ trunk/milena/tests/convert_to_vec_p.cc (revision 1283)
@@ -34,8 +34,8 @@
#include <mln/core/point2d.hh>
#include <mln/core/vec_p.hh>
-#include <mln/core/win/segment1d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/segment1d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/convert/to_vec_p.hh>
Index: trunk/milena/tests/level_median.cc
===================================================================
--- trunk/milena/tests/level_median.cc (revision 1282)
+++ trunk/milena/tests/level_median.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/win_diag2d.cc
===================================================================
--- trunk/milena/tests/win_diag2d.cc (revision 1282)
+++ trunk/milena/tests/win_diag2d.cc (revision 1283)
@@ -30,7 +30,7 @@
* \brief Tests on mln::win::diag2d.
*/
-#include <mln/core/win/diag2d.hh>
+#include <mln/win/diag2d.hh>
#include <mln/convert/to_image.hh>
Index: trunk/milena/tests/dpoints_pixter.cc
===================================================================
--- trunk/milena/tests/dpoints_pixter.cc (revision 1282)
+++ trunk/milena/tests/dpoints_pixter.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/make/pixel.hh>
Index: trunk/milena/tests/morpho_gradient.cc
===================================================================
--- trunk/milena/tests/morpho_gradient.cc (revision 1282)
+++ trunk/milena/tests/morpho_gradient.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/w_window1d_int.cc
===================================================================
--- trunk/milena/tests/w_window1d_int.cc (revision 1282)
+++ trunk/milena/tests/w_window1d_int.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/w_window1d_int.hh>
-#include <mln/core/win/segment1d.hh>
+#include <mln/win/segment1d.hh>
#include <mln/convert/to_image.hh>
#include <mln/convert/to_w_window.hh>
Index: trunk/milena/tests/w_window2d_int.cc
===================================================================
--- trunk/milena/tests/w_window2d_int.cc (revision 1282)
+++ trunk/milena/tests/w_window2d_int.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/w_window2d_int.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/convert/to_image.hh>
#include <mln/convert/to_w_window.hh>
Index: trunk/milena/tests/win_disk2d.cc
===================================================================
--- trunk/milena/tests/win_disk2d.cc (revision 1282)
+++ trunk/milena/tests/win_disk2d.cc (revision 1283)
@@ -30,7 +30,7 @@
* \brief Tests on mln::win::diag2d.
*/
-#include <mln/core/win/disk2d.hh>
+#include <mln/win/disk2d.hh>
#include <mln/convert/to_image.hh>
Index: trunk/milena/tests/w_window3d_int.cc
===================================================================
--- trunk/milena/tests/w_window3d_int.cc (revision 1282)
+++ trunk/milena/tests/w_window3d_int.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/w_window3d_int.hh>
-#include <mln/core/win/cube3d.hh>
+#include <mln/win/cube3d.hh>
#include <mln/convert/to_image.hh>
#include <mln/convert/to_w_window.hh>
Index: trunk/milena/tests/main.cc
===================================================================
--- trunk/milena/tests/main.cc (revision 1282)
+++ trunk/milena/tests/main.cc (revision 1283)
@@ -32,7 +32,7 @@
#include <mln/debug/println.hh>
#include <mln/core/window2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/core/neighb2d.hh>
Index: trunk/milena/tests/win_octagon2d.cc
===================================================================
--- trunk/milena/tests/win_octagon2d.cc (revision 1282)
+++ trunk/milena/tests/win_octagon2d.cc (revision 1283)
@@ -30,7 +30,7 @@
* \brief Tests on mln::win::octagon2d.
*/
-#include <mln/core/win/octagon2d.hh>
+#include <mln/win/octagon2d.hh>
#include <mln/convert/to_image.hh>
Index: trunk/milena/tests/morpho_thinning.cc
===================================================================
--- trunk/milena/tests/morpho_thinning.cc (revision 1282)
+++ trunk/milena/tests/morpho_thinning.cc (revision 1283)
@@ -33,7 +33,7 @@
#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/core/window2d.hh>
#include <mln/io/pgm/load.hh>
Index: trunk/milena/tests/morpho_laplacian.cc
===================================================================
--- trunk/milena/tests/morpho_laplacian.cc (revision 1282)
+++ trunk/milena/tests/morpho_laplacian.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/io_ppm16.cc
===================================================================
--- trunk/milena/tests/io_ppm16.cc (revision 1282)
+++ trunk/milena/tests/io_ppm16.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/value/rgb8.hh>
#include <mln/value/rgb16.hh>
Index: trunk/milena/tests/level_median_fast.cc
===================================================================
--- trunk/milena/tests/level_median_fast.cc (revision 1282)
+++ trunk/milena/tests/level_median_fast.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/local_convolve.cc
===================================================================
--- trunk/milena/tests/local_convolve.cc (revision 1282)
+++ trunk/milena/tests/local_convolve.cc (revision 1283)
@@ -34,7 +34,7 @@
#include <mln/value/int_u8.hh>
#include <mln/core/w_window2d_int.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/core/pixel.hh>
#include <mln/debug/iota.hh>
Index: trunk/milena/tests/level_approx_median.cc
===================================================================
--- trunk/milena/tests/level_approx_median.cc (revision 1282)
+++ trunk/milena/tests/level_approx_median.cc (revision 1283)
@@ -31,8 +31,8 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
-#include <mln/core/win/octagon2d.hh>
+#include <mln/win/rectangle2d.hh>
+#include <mln/win/octagon2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/value_float01.cc
===================================================================
--- trunk/milena/tests/value_float01.cc (revision 1282)
+++ trunk/milena/tests/value_float01.cc (revision 1283)
@@ -39,7 +39,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/level/median.hh>
#include <mln/level/compare.hh>
Index: trunk/milena/tests/win_rectangle2d.cc
===================================================================
--- trunk/milena/tests/win_rectangle2d.cc (revision 1282)
+++ trunk/milena/tests/win_rectangle2d.cc (revision 1283)
@@ -30,7 +30,7 @@
* \brief Tests on mln::win::rectangle2d.
*/
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/geom/sym.hh>
Index: trunk/milena/tests/morpho_contrast.cc
===================================================================
--- trunk/milena/tests/morpho_contrast.cc (revision 1282)
+++ trunk/milena/tests/morpho_contrast.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/tests/io_pgm16.cc
===================================================================
--- trunk/milena/tests/io_pgm16.cc (revision 1282)
+++ trunk/milena/tests/io_pgm16.cc (revision 1283)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
+#include <mln/win/rectangle2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_u16.hh>
Index: trunk/milena/tests/morpho_dilation.cc
===================================================================
--- trunk/milena/tests/morpho_dilation.cc (revision 1282)
+++ trunk/milena/tests/morpho_dilation.cc (revision 1283)
@@ -31,10 +31,10 @@
*/
#include <mln/core/image2d.hh>
-#include <mln/core/win/rectangle2d.hh>
-#include <mln/core/win/octagon2d.hh>
-#include <mln/core/win/diag2d.hh>
-#include <mln/core/win/backdiag2d.hh>
+#include <mln/win/rectangle2d.hh>
+#include <mln/win/octagon2d.hh>
+#include <mln/win/diag2d.hh>
+#include <mln/win/backdiag2d.hh>
#include <mln/core/window2d.hh>
#include <mln/io/pgm/load.hh>
Index: trunk/milena/tests/win_backdiag2d.cc
===================================================================
--- trunk/milena/tests/win_backdiag2d.cc (revision 1282)
+++ trunk/milena/tests/win_backdiag2d.cc (revision 1283)
@@ -30,7 +30,7 @@
* \brief Tests on mln::win::backdiag2d.
*/
-#include <mln/core/win/backdiag2d.hh>
+#include <mln/win/backdiag2d.hh>
#include <mln/convert/to_image.hh>
Index: trunk/milena/mln/level/approx/median.hh
===================================================================
--- trunk/milena/mln/level/approx/median.hh (revision 1282)
+++ trunk/milena/mln/level/approx/median.hh (revision 1283)
@@ -34,13 +34,13 @@
*/
# include <mln/level/median.hh>
-# include <mln/core/win/rectangle2d.hh>
-# include <mln/core/win/disk2d.hh>
-# include <mln/core/win/octagon2d.hh>
-# include <mln/core/win/hline2d.hh>
-# include <mln/core/win/vline2d.hh>
-# include <mln/core/win/diag2d.hh>
-# include <mln/core/win/backdiag2d.hh>
+# include <mln/win/rectangle2d.hh>
+# include <mln/win/disk2d.hh>
+# include <mln/win/octagon2d.hh>
+# include <mln/win/hline2d.hh>
+# include <mln/win/vline2d.hh>
+# include <mln/win/diag2d.hh>
+# include <mln/win/backdiag2d.hh>
#include <time.h>
Index: trunk/milena/mln/win/vline2d.hh
===================================================================
--- trunk/milena/mln/win/vline2d.hh (revision 0)
+++ trunk/milena/mln/win/vline2d.hh (revision 1283)
@@ -0,0 +1,65 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_VLINE2D_HH
+# define MLN_CORE_WIN_VLINE2D_HH
+
+/*! \file mln/win/vline2d.hh
+ *
+ * \brief Definition of the mln::win::vline2d window.
+ */
+
+# include <mln/win/line.hh>
+# include <mln/core/grids.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Vertical line window defined on the 2D square grid.
+ *
+ * An vline2d is centered and symmetrical; so its width is 1 and
+ * its height (length) is odd.
+ *
+ * For instance: \n
+ * o \n
+ * x \n
+ * o \n
+ * is defined with length = 3.
+ */
+ typedef line<grid::square, 0, int> vline2d;
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_VLINE2D_HH
Index: trunk/milena/mln/win/hline2d.hh
===================================================================
--- trunk/milena/mln/win/hline2d.hh (revision 0)
+++ trunk/milena/mln/win/hline2d.hh (revision 1283)
@@ -0,0 +1,63 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_HLINE2D_HH
+# define MLN_CORE_WIN_HLINE2D_HH
+
+/*! \file mln/win/hline2d.hh
+ *
+ * \brief Definition of the mln::win::hline2d window.
+ */
+
+# include <mln/win/line.hh>
+# include <mln/core/grids.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Horizontal line window defined on the 2D square grid.
+ *
+ * An hline2d is centered and symmetrical; so its height is 1 and
+ * its width (length) is odd.
+ *
+ * For instance: \n
+ * o o x o o \n
+ * is defined with length = 5.
+ */
+ typedef line<grid::square, 1, int> hline2d;
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_HLINE2D_HH
Index: trunk/milena/mln/win/cube3d.hh
===================================================================
--- trunk/milena/mln/win/cube3d.hh (revision 0)
+++ trunk/milena/mln/win/cube3d.hh (revision 1283)
@@ -0,0 +1,193 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_CUBE3D_HH
+# define MLN_CORE_WIN_CUBE3D_HH
+
+/*! \file mln/win/cube3d.hh
+ *
+ * \brief Definition of the mln::win::cube3d window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint3d.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Cube window defined on the 3D grid.
+ *
+ * An cube3d is centered and symmetrical; so
+ * its height (length) is odd.
+ *
+ * For instance: \n
+ * o o o \n
+ * o o o \n
+ * o o o \n
+
+ * o o o \n
+ * o x o \n
+ * o o o \n
+
+ * o o o \n
+ * o o o \n
+ * o o o \n
+ * is defined with length = 3.
+ */
+ struct cube3d : public Window< cube3d >,
+ public internal::dpoints_base_< dpoint3d, cube3d >
+ {
+ /// Point associated type.
+ typedef point3d point;
+
+ /// Dpoint associated type.
+ typedef dpoint3d dpoint;
+
+ /*! \brief Point_Iterator type to browse a cube such as: "for each row
+ * (increasing), for each column (increasing)."
+ */
+ typedef dpoints_fwd_piter<dpoint3d> fwd_qiter;
+
+ /*! \brief Point_Iterator type to browse a cube such as: "for each row
+ * (decreasing), for each column (decreasing)."
+ */
+ typedef dpoints_bkd_piter<dpoint3d> bkd_qiter;
+
+ /*! \brief Same as fwd_qiter.
+ */
+ typedef fwd_qiter qiter;
+
+ /*! \brief Constructor.
+ *
+ * \param[in] length Length, thus height, of the cube3d.
+ *
+ * \pre \p length is odd.
+ */
+ cube3d(unsigned length);
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the cube length, that is, its height.
+ */
+ unsigned length() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ cube3d& sym();
+
+ protected:
+ unsigned length_;
+ };
+
+
+ /*! \brief Print a cube3d window \p win into the output
+ * stream \p ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win A cube3d window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::cube3d
+ */
+ std::ostream& operator<<(std::ostream& ostr, const cube3d& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ cube3d::cube3d(unsigned length)
+ : length_(length)
+ {
+ mln_precondition(length % 2 == 1);
+ const int dind = length / 2;
+ for (int sli = - dind; sli <= dind; ++sli)
+ for (int row = - dind; row <= dind; ++row)
+ for (int col = - dind; col <= dind; ++col)
+ insert(make::dpoint3d(sli, row, col));
+ }
+
+ bool cube3d::is_centered() const
+ {
+ return true;
+ }
+
+ bool cube3d::is_symmetric() const
+ {
+ return true;
+ }
+
+ unsigned cube3d::length() const
+ {
+ return length_;
+ }
+
+ unsigned cube3d::delta() const
+ {
+ return length_ / 2;
+ }
+
+ cube3d& cube3d::sym()
+ {
+ return *this;
+ }
+
+ std::ostream& operator<<(std::ostream& ostr, const cube3d& win)
+ {
+ ostr << "[cube3d: length=" << win.length() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_CUBE3D_HH
Index: trunk/milena/mln/win/segment1d.hh
===================================================================
--- trunk/milena/mln/win/segment1d.hh (revision 0)
+++ trunk/milena/mln/win/segment1d.hh (revision 1283)
@@ -0,0 +1,181 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_SEGMENT1D_HH
+# define MLN_CORE_WIN_SEGMENT1D_HH
+
+/*! \file mln/win/segment1d.hh
+ *
+ * \brief Definition of the mln::win::segment1d window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint1d.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Segment window defined on the 1D grid.
+ *
+ * An segment1d is centered and symmetrical; so
+ * its height (length) is odd.
+ *
+ * For instance: \n
+ * o x o \n
+ * is defined with length = 3.
+ */
+ struct segment1d : public Window< segment1d >,
+ public internal::dpoints_base_< dpoint1d, segment1d >
+ {
+ /// Point associated type.
+ typedef point1d point;
+
+ /// Dpoint associated type.
+ typedef dpoint1d dpoint;
+
+ /*! \brief Point_Iterator type to browse a segment such as: "for each row
+ * (increasing), for each column (increasing)."
+ */
+ typedef dpoints_fwd_piter<dpoint1d> fwd_qiter;
+
+ /*! \brief Point_Iterator type to browse a segment such as: "for each row
+ * (decreasing), for each column (decreasing)."
+ */
+ typedef dpoints_bkd_piter<dpoint1d> bkd_qiter;
+
+ /*! \brief Same as fwd_qiter.
+ */
+ typedef fwd_qiter qiter;
+
+ /*! \brief Constructor.
+ *
+ * \param[in] length Length, thus height, of the segment1d.
+ *
+ * \pre \p length is odd.
+ */
+ segment1d(unsigned length);
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the segment length, that is, its height.
+ */
+ unsigned length() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ segment1d& sym();
+
+ protected:
+ unsigned length_;
+ };
+
+
+ /*! \brief Print a segment1D window \p win into the output
+ * stream \p ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win A segment1D window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::segment1d
+ */
+ std::ostream& operator<<(std::ostream& ostr, const segment1d& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ segment1d::segment1d(unsigned length)
+ : length_(length)
+ {
+ mln_precondition(length % 2 == 1);
+ const int dind = length / 2;
+ for (int ind = - dind; ind <= dind; ++ind)
+ insert(make::dpoint1d(ind));
+ }
+
+ bool segment1d::is_centered() const
+ {
+ return true;
+ }
+
+ bool segment1d::is_symmetric() const
+ {
+ return true;
+ }
+
+ unsigned segment1d::length() const
+ {
+ return length_;
+ }
+
+ unsigned segment1d::delta() const
+ {
+ return length_ / 2;
+ }
+
+ segment1d& segment1d::sym()
+ {
+ return *this;
+ }
+
+ std::ostream& operator<<(std::ostream& ostr, const segment1d& win)
+ {
+ ostr << "[segment1d: length=" << win.length() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_SEGMENT1D_HH
Index: trunk/milena/mln/win/line.hh
===================================================================
--- trunk/milena/mln/win/line.hh (revision 0)
+++ trunk/milena/mln/win/line.hh (revision 1283)
@@ -0,0 +1,183 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_LINE_HH
+# define MLN_CORE_WIN_LINE_HH
+
+/*! \file mln/win/line.hh
+ *
+ * \brief Definition of the mln::win::line window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ template <typename M, unsigned i, typename C>
+ struct line : public Window< line<M,i,C> >,
+ public internal::dpoints_base_<dpoint_<M, C>, point_<M, C> >
+ {
+ /// Point associated type.
+ typedef point_<M, int> point;
+
+ /// Dpoint associated type.
+ typedef dpoint_<M, int> dpoint;
+
+ /// Point_Iterator type to browse a line forward
+ typedef dpoints_fwd_piter<dpoint> fwd_qiter;
+
+ /// Point_Iterator type to browse a line backward
+ typedef dpoints_bkd_piter<dpoint> bkd_qiter;
+
+ /// Same as fwd_qiter
+ typedef fwd_qiter qiter;
+
+ /*! \brief Constructor.
+ *
+ * \param[in] length Length of the line.
+ *
+ * \pre \p length is odd.
+ */
+ line(unsigned length);
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the hline length, that is, its width.
+ */
+ unsigned length() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ line<M,i,C>& sym();
+
+ protected:
+ unsigned length_;
+ };
+
+
+ /*! \brief Print an line window \p win into the output
+ * stream \p ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win An line window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::line
+ */
+ template <typename M, unsigned i, typename C>
+ std::ostream& operator<<(std::ostream& ostr, const line<M,i,C>& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename M, unsigned i, typename C>
+ line<M,i,C>::line(unsigned length)
+ : length_(length)
+ {
+ mln_precondition(i < M::dim);
+ mln_precondition(length % 2 == 1);
+ const int dc = length / 2;
+ for (int c = - dc; c <= dc; ++c)
+ {
+ dpoint n;
+ n.set_all(0);
+ n[i] = c;
+ this->insert(n);
+ }
+ }
+
+ template <typename M, unsigned i, typename C>
+ bool line<M,i,C>::is_centered() const
+ {
+ return true;
+ }
+
+ template <typename M, unsigned i, typename C>
+ bool line<M,i,C>::is_symmetric() const
+ {
+ return true;
+ }
+
+ template <typename M, unsigned i, typename C>
+ unsigned line<M,i,C>::length() const
+ {
+ return length_;
+ }
+
+ template <typename M, unsigned i, typename C>
+ unsigned line<M,i,C>::delta() const
+ {
+ return length_ / 2;
+ }
+
+ template <typename M, unsigned i, typename C>
+ line<M,i,C>& line<M,i,C>::sym()
+ {
+ return *this;
+ }
+
+ template <typename M, unsigned i, typename C>
+ std::ostream& operator<<(std::ostream& ostr, const line<M,i,C>& win)
+ {
+ ostr << "[line: length=" << win.length() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_LINE_HH
Index: trunk/milena/mln/win/rectangle2d.hh
===================================================================
--- trunk/milena/mln/win/rectangle2d.hh (revision 0)
+++ trunk/milena/mln/win/rectangle2d.hh (revision 1283)
@@ -0,0 +1,198 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_RECTANGLE2D_HH
+# define MLN_CORE_WIN_RECTANGLE2D_HH
+
+/*! \file mln/win/rectangle2d.hh
+ *
+ * \brief Definition of the mln::win::rectangle2d window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint2d.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Rectangular window defined on the 2D square grid.
+ *
+ * A rectangle2d is a 2D window with rectangular shape. It is
+ * centered and symmetrical.
+ *
+ * For instance: \n
+ * o o o o o \n
+ * o o x o o \n
+ * o o o o o \n
+ * is defined with height = 3 and width = 5.
+ */
+ struct rectangle2d : public Window< rectangle2d >,
+ public internal::dpoints_base_< dpoint2d, rectangle2d >
+ {
+ /// Point associated type.
+ typedef point2d point;
+
+ /// Dpoint associated type.
+ typedef dpoint2d dpoint;
+
+ /*! \brief Point_Iterator type to browse a rectangle such as: "for each row
+ * (increasing), for each column (increasing)."
+ */
+ typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
+
+ /*! \brief Point_Iterator type to browse a rectangle such as: "for each row
+ * (decreasing), for each column (decreasing)."
+ */
+ typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
+
+
+ /*! \brief Constructor.
+ *
+ * \param[in] height sic
+ * \param[in] width sic
+ *
+ * \pre Height and width are odd.
+ */
+ rectangle2d(unsigned height, unsigned width);
+
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the rectangle height.
+ */
+ unsigned height() const;
+
+ /*! \brief Give the rectangle width.
+ */
+ unsigned width() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ rectangle2d& sym();
+
+ protected:
+ unsigned height_, width_;
+ };
+
+
+ /*! \brief Print a rectangle window \p win into the output stream \p
+ * ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win A rectangle window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::rectangle2d
+ */
+ std::ostream& operator<<(std::ostream& ostr, const rectangle2d& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ rectangle2d::rectangle2d(unsigned height, unsigned width)
+ : height_(height),
+ width_(width)
+ {
+ mln_precondition(height % 2 == 1 && width % 2 == 1);
+ const int drow = height / 2, dcol = width / 2;
+ for (int row = - drow; row <= drow; ++row)
+ for (int col = - dcol; col <= dcol; ++col)
+ insert(make::dpoint2d(row, col));
+ }
+
+ bool rectangle2d::is_centered() const
+ {
+ return true;
+ }
+
+ bool rectangle2d::is_symmetric() const
+ {
+ return true;
+ }
+
+ unsigned rectangle2d::height() const
+ {
+ return height_;
+ }
+
+ unsigned rectangle2d::width() const
+ {
+ return width_;
+ }
+
+ unsigned rectangle2d::delta() const
+ {
+ return width_ > height_ ? width_ / 2 : height_ / 2;
+ }
+
+ rectangle2d& rectangle2d::sym()
+ {
+ return *this;
+ }
+
+ std::ostream& operator<<(std::ostream& ostr, const rectangle2d& win)
+ {
+ ostr << "[rectangle2d: width=" << win.width() << ", height=" << win.height() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+// when rectangle2d is involved, one surely also wants:
+# include <mln/win/hline2d.hh>
+# include <mln/win/vline2d.hh>
+
+
+#endif // ! MLN_CORE_WIN_RECTANGLE2D_HH
Index: trunk/milena/mln/win/diag2d.hh
===================================================================
--- trunk/milena/mln/win/diag2d.hh (revision 0)
+++ trunk/milena/mln/win/diag2d.hh (revision 1283)
@@ -0,0 +1,185 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_DIAG2D_HH
+# define MLN_CORE_WIN_DIAG2D_HH
+
+/*! \file mln/win/diag2d.hh
+ *
+ * \brief Definition of the mln::win::diag2d window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint2d.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Diagonal line window defined on the 2D square grid.
+ *
+ * An diag2d is centered and symmetrical.
+ * its width (length) is odd.
+ *
+ * For instance: \n
+ * o \n
+ * o \n
+ * x \n
+ * o \n
+ * o \n
+ * is defined with length = 5.
+ */
+ struct diag2d : public Window< diag2d >,
+ public internal::dpoints_base_< dpoint2d, diag2d >
+ {
+ /// Point associated type.
+ typedef point2d point;
+
+ /// Dpoint associated type.
+ typedef dpoint2d dpoint;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (increasing), for each column (increasing)."
+ */
+ typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (decreasing), for each column (decreasing)."
+ */
+ typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
+
+ /*! \brief Same as fwd_qiter.
+ */
+ typedef fwd_qiter qiter;
+
+ /*! \brief Constructor.
+ *
+ * \param[in] length Length, thus width, of the diagonal line.
+ *
+ * \pre \p length is odd.
+ */
+ diag2d(unsigned length);
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the diagonal length, that is, its width.
+ */
+ unsigned length() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ diag2d& sym();
+
+ protected:
+ unsigned length_;
+ };
+
+
+ /*! \brief Print an diagonal line window \p win into the output
+ * stream \p ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win A diagonal line window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::diag2d
+ */
+ std::ostream& operator<<(std::ostream& ostr, const diag2d& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ diag2d::diag2d(unsigned length)
+ : length_(length)
+ {
+ mln_precondition(length % 2 == 1);
+ const int dcol = length / 2;
+ for (int col = - dcol; col <= dcol; ++col)
+ insert(make::dpoint2d(-col, col));
+ }
+
+ bool diag2d::is_centered() const
+ {
+ return true;
+ }
+
+ bool diag2d::is_symmetric() const
+ {
+ return true;
+ }
+
+ unsigned diag2d::length() const
+ {
+ return length_;
+ }
+
+ unsigned diag2d::delta() const
+ {
+ return length_ / 2;
+ }
+
+ diag2d& diag2d::sym()
+ {
+ return *this;
+ }
+
+ std::ostream& operator<<(std::ostream& ostr, const diag2d& win)
+ {
+ ostr << "[diag 2d: length=" << win.length() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_DIAG2D_HH
Index: trunk/milena/mln/win/backdiag2d.hh
===================================================================
--- trunk/milena/mln/win/backdiag2d.hh (revision 0)
+++ trunk/milena/mln/win/backdiag2d.hh (revision 1283)
@@ -0,0 +1,185 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_BACKDIAG2D_HH
+# define MLN_CORE_WIN_BACKDIAG2D_HH
+
+/*! \file mln/win/backdiag2d.hh
+ *
+ * \brief Definition of the mln::win::backdiag2d window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint2d.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Diagonal line window defined on the 2D square grid.
+ *
+ * An backdiag2d is centered and symmetrical.
+ * its width (length) is odd.
+ *
+ * For instance: \n
+ * o \n
+ * o \n
+ * x \n
+ * o \n
+ * o \n
+ * is defined with length = 5.
+ */
+ struct backdiag2d : public Window< backdiag2d >,
+ public internal::dpoints_base_< dpoint2d, backdiag2d >
+ {
+ /// Point associated type.
+ typedef point2d point;
+
+ /// Dpoint associated type.
+ typedef dpoint2d dpoint;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (increasing), for each column (increasing)."
+ */
+ typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (decreasing), for each column (decreasing)."
+ */
+ typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
+
+ /*! \brief Same as fwd_qiter.
+ */
+ typedef fwd_qiter qiter;
+
+ /*! \brief Constructor.
+ *
+ * \param[in] length Length, thus width, of the diagonal line.
+ *
+ * \pre \p length is odd.
+ */
+ backdiag2d(unsigned length);
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the diagonal length, that is, its width.
+ */
+ unsigned length() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ backdiag2d& sym();
+
+ protected:
+ unsigned length_;
+ };
+
+
+ /*! \brief Print an diagonal line window \p win into the output
+ * stream \p ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win A diagonal line window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::backdiag2d
+ */
+ std::ostream& operator<<(std::ostream& ostr, const backdiag2d& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ backdiag2d::backdiag2d(unsigned length)
+ : length_(length)
+ {
+ mln_precondition(length % 2 == 1);
+ const int dcol = length / 2;
+ for (int col = - dcol; col <= dcol; ++col)
+ insert(make::dpoint2d(col, col));
+ }
+
+ bool backdiag2d::is_centered() const
+ {
+ return true;
+ }
+
+ bool backdiag2d::is_symmetric() const
+ {
+ return true;
+ }
+
+ unsigned backdiag2d::length() const
+ {
+ return length_;
+ }
+
+ unsigned backdiag2d::delta() const
+ {
+ return length_ / 2;
+ }
+
+ backdiag2d& backdiag2d::sym()
+ {
+ return *this;
+ }
+
+ std::ostream& operator<<(std::ostream& ostr, const backdiag2d& win)
+ {
+ ostr << "[diag 2d: length=" << win.length() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_BACKDIAG2D_HH
Index: trunk/milena/mln/win/octagon2d.hh
===================================================================
--- trunk/milena/mln/win/octagon2d.hh (revision 0)
+++ trunk/milena/mln/win/octagon2d.hh (revision 1283)
@@ -0,0 +1,215 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_OCTAGON2D_HH
+# define MLN_CORE_WIN_OCTAGON2D_HH
+
+/*! \file mln/win/octagon2d.hh
+ *
+ * \brief Definition of the mln::win::octagon2d window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint2d.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Octagon window defined on the 2D square grid.
+ *
+ * An octagon2d is centered and symmetrical.
+ * The length l of the octagon is such as l = 6*x + 1
+ * where 0 <= x.
+ *
+ * For instance: \n
+ * o o o \n
+ * o o o o o \n
+ * o o o o o o o \n
+ * o o o x o o o \n
+ * o o o o o o o \n
+ * o o o o o \n
+ * o o o \n
+ * is defined with length = 7 (x = 0).
+ */
+ struct octagon2d : public Window< octagon2d >,
+ public internal::dpoints_base_< dpoint2d, octagon2d >
+ {
+ /// Point associated type.
+ typedef point2d point;
+
+ /// Dpoint associated type.
+ typedef dpoint2d dpoint;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (increasing), for each column (increasing)."
+ */
+ typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (decreasing), for each column (decreasing)."
+ */
+ typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
+
+ /*! \brief Same as fwd_qiter.
+ */
+ typedef fwd_qiter qiter;
+
+ /*! \brief Constructor.
+ *
+ * \param[in] lenght Length, of the octagon.
+ *
+ * \pre \p length is such as length = 6*x + 1 where x >= 0.
+ */
+ octagon2d(unsigned length);
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the octagon length, that is, its width.
+ */
+ unsigned length() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ octagon2d& sym();
+
+ protected:
+ unsigned length_;
+ };
+
+
+ /*! \brief Print an octagon window \p win into the output
+ * stream \p ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win An octagon window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::octagon2d
+ */
+ std::ostream& operator<<(std::ostream& ostr, const octagon2d& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ octagon2d::octagon2d(unsigned length)
+ : length_(length)
+ {
+ mln_precondition(length % 6 == 1);
+ const int y = length / 6;
+ const int x = y * 2;
+ const int z = y + x;
+ insert(dpoint2d::zero);
+ for (int a = 1; a <= x; ++a)
+ for (int b = 0; b <= x; ++b)
+ {
+ insert(make::dpoint2d(a, b));
+ insert(make::dpoint2d(-b, a));
+ insert(make::dpoint2d(b, -a));
+ insert(make::dpoint2d(-a, -b));
+ }
+ for (int a = x + 1; a <= z; ++a)
+ for (int b = -2 * x + a; b <= 2 * x - a; ++b)
+ {
+ insert(make::dpoint2d(a, b));
+ insert(make::dpoint2d(a, -b));
+ insert(make::dpoint2d(-a, b));
+ insert(make::dpoint2d(-a, -b));
+ insert(make::dpoint2d(b, a));
+ insert(make::dpoint2d(b, -a));
+ insert(make::dpoint2d(-b, a));
+ insert(make::dpoint2d(-b, -a));
+ }
+ }
+
+ bool octagon2d::is_centered() const
+ {
+ return true;
+ }
+
+ bool octagon2d::is_symmetric() const
+ {
+ return true;
+ }
+
+ unsigned octagon2d::length() const
+ {
+ return length_;
+ }
+
+ unsigned octagon2d::delta() const
+ {
+ return length_ / 2;
+ }
+
+ octagon2d& octagon2d::sym()
+ {
+ return *this;
+ }
+
+ std::ostream& operator<<(std::ostream& ostr, const octagon2d& win)
+ {
+ ostr << "[octagon2d: length=" << win.length() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+// when rectangle2d is involved, one surely also wants:
+# include <mln/win/hline2d.hh>
+# include <mln/win/vline2d.hh>
+# include <mln/win/diag2d.hh>
+# include <mln/win/backdiag2d.hh>
+
+#endif // ! MLN_CORE_WIN_OCTAGON2D_HH
Index: trunk/milena/mln/win/disk2d.hh
===================================================================
--- trunk/milena/mln/win/disk2d.hh (revision 0)
+++ trunk/milena/mln/win/disk2d.hh (revision 1283)
@@ -0,0 +1,179 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_CORE_WIN_DISK2D_HH
+# define MLN_CORE_WIN_DISK2D_HH
+
+/*! \file mln/win/disk2d.hh
+ *
+ * \brief Definition of the mln::win::disk2d window.
+ */
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/dpoint2d.hh>
+# include <mln/core/dpoints_piter.hh>
+
+
+namespace mln
+{
+
+ namespace win
+ {
+
+ /*! \brief Disk window defined on the 2D square grid.
+ *
+ * An disk2d is centered and symmetrical.
+ *
+ */
+ struct disk2d : public Window< disk2d >,
+ public internal::dpoints_base_< dpoint2d, disk2d >
+ {
+ /// Point associated type.
+ typedef point2d point;
+
+ /// Dpoint associated type.
+ typedef dpoint2d dpoint;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (increasing), for each column (increasing)."
+ */
+ typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
+
+ /*! \brief Point_Iterator type to browse a hline such as: "for each row
+ * (decreasing), for each column (decreasing)."
+ */
+ typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
+
+ /*! \brief Same as fwd_qiter.
+ */
+ typedef fwd_qiter qiter;
+
+ /*! \brief Constructor.
+ *
+ * \param[in] length Length, thus diameter.
+ *
+ */
+ disk2d(unsigned length);
+
+ /*! \brief Test if the window is centered.
+ *
+ * \return True.
+ */
+ bool is_centered() const;
+
+ /*! \brief Test if the window is symmetric.
+ *
+ * \return true.
+ */
+ bool is_symmetric() const;
+
+ /*! \brief Give the disk length, that is, its width.
+ */
+ unsigned length() const;
+
+ /*! \brief Give the maximum coordinate gap between the window
+ * center and a window point.
+ */
+ unsigned delta() const;
+
+ /// Apply a central symmetry to the target window.
+ disk2d& sym();
+
+ protected:
+ unsigned length_;
+ };
+
+
+ /*! \brief Print an disk window \p win into the output
+ * stream \p ostr.
+ *
+ * \param[in,out] ostr An output stream.
+ * \param[in] win A disk window.
+ *
+ * \return The modified output stream \p ostr.
+ *
+ * \relates mln::win::disk2d
+ */
+ std::ostream& operator<<(std::ostream& ostr, const disk2d& win);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ disk2d::disk2d(unsigned length)
+ : length_(length)
+ {
+ mln_precondition(length % 2 == 1);
+ const int r = length / 2;
+ const int r2 = r * r;
+ for (int a = -r; a <= r; ++a)
+ for (int b = -r; b <= r; ++b)
+ if (a * a + b * b <= r2)
+ insert(make::dpoint2d(a, b));
+ }
+
+ bool disk2d::is_centered() const
+ {
+ return true;
+ }
+
+ bool disk2d::is_symmetric() const
+ {
+ return true;
+ }
+
+ unsigned disk2d::length() const
+ {
+ return length_;
+ }
+
+ unsigned disk2d::delta() const
+ {
+ return length_ / 2;
+ }
+
+ disk2d& disk2d::sym()
+ {
+ return *this;
+ }
+
+ std::ostream& operator<<(std::ostream& ostr, const disk2d& win)
+ {
+ ostr << "[disk2d: length=" << win.length() << ']';
+ return ostr;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::win
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_CORE_WIN_DISK2D_HH
Index: trunk/milena/sandbox/nivault/dyn_line.hh
===================================================================
--- trunk/milena/sandbox/nivault/dyn_line.hh (revision 1282)
+++ trunk/milena/sandbox/nivault/dyn_line.hh (revision 1283)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_WIN_DYN_LINE_HH
# define MLN_CORE_WIN_DYN_LINE_HH
-/*! \file mln/core/win/dyn_line.hh
+/*! \file mln/win/dyn_line.hh
*
* \brief Definition of the mln::win::dyn_line window.
*/
Index: trunk/milena/sandbox/nivault/tests/pouet.cc
===================================================================
--- trunk/milena/sandbox/nivault/tests/pouet.cc (revision 1282)
+++ trunk/milena/sandbox/nivault/tests/pouet.cc (revision 1283)
@@ -1,7 +1,7 @@
#include <mln/morpho/includes.hh>
-#include <mln/core/win/dyn_line.hh>
-#include <mln/core/win/hline2d.hh>
+#include <mln/win/dyn_line.hh>
+#include <mln/win/hline2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
Index: trunk/milena/sandbox/nivault/median.hh
===================================================================
--- trunk/milena/sandbox/nivault/median.hh (revision 1282)
+++ trunk/milena/sandbox/nivault/median.hh (revision 1283)
@@ -37,8 +37,8 @@
# include <mln/geom/size2d.hh>
# include <mln/core/window2d.hh>
-# include <mln/core/win/hline2d.hh>
-# include <mln/core/win/vline2d.hh>
+# include <mln/win/hline2d.hh>
+# include <mln/win/vline2d.hh>
# include <mln/core/t_image.hh>
# include <mln/core/dpoint.hh>
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Cleaner version for display::show.
* show.hh: Fix.
---
show.hh | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: trunk/milena/mln/display/show.hh
===================================================================
--- trunk/milena/mln/display/show.hh (revision 1281)
+++ trunk/milena/mln/display/show.hh (revision 1282)
@@ -70,15 +70,12 @@
// std::string path_tmp = tempnam (0, "ppm");
/// Use of mkstemp instead tempmap.
- char *tmp = (char*)malloc (7 * sizeof (char));
- for (int i = 0; i < 6; ++i)
- tmp[i] = 'X';
- tmp[6] = 0;
+ char *tmp = (char*)malloc (12 * sizeof (char));
+ strcpy(tmp, "/tmp/XXXXXX");
if (mkstemp(tmp) == -1)
return;
+ std::string path_tmp = tmp;
- std::string t = tmp;
- std::string path_tmp = "/tmp/" + t;
io::ppm::save(out, path_tmp);
std::string s = cmd + " " + path_tmp;
system (s.c_str ());
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Fix erosion.spe and add comments.
* mln/core/win/octagon2d.hh: Include hline2d, vline2d and diags...
* mln/morpho/erosion.spe.hh: Document dispatch.
---
core/win/octagon2d.hh | 6 ++++++
morpho/erosion.spe.hh | 50 +++++++++++++++++++++++++++-----------------------
2 files changed, 33 insertions(+), 23 deletions(-)
Index: trunk/milena/mln/core/win/octagon2d.hh
===================================================================
--- trunk/milena/mln/core/win/octagon2d.hh (revision 1280)
+++ trunk/milena/mln/core/win/octagon2d.hh (revision 1281)
@@ -206,4 +206,10 @@
+// when rectangle2d is involved, one surely also wants:
+# include <mln/core/win/hline2d.hh>
+# include <mln/core/win/vline2d.hh>
+# include <mln/core/win/diag.hh>
+# include <mln/core/win/backdiag.hh>
+
#endif // ! MLN_CORE_WIN_OCTAGON2D_HH
Index: trunk/milena/mln/morpho/erosion.spe.hh
===================================================================
--- trunk/milena/mln/morpho/erosion.spe.hh (revision 1280)
+++ trunk/milena/mln/morpho/erosion.spe.hh (revision 1281)
@@ -31,6 +31,33 @@
/*! \file mln/morpho/erosion.spe.hh
*
* \brief Specialization for mln::morpho::erosion.
+ *
+ * Dispatch of erosion(input, win, output):
+ *
+ * If win = rectangle
+ * -> particular case
+ * Else If win = octagon
+ * -> particular case
+ * Else
+ * (If win is quite agglomerated (disjonction)
+ * -> using incremental algorithm
+ * Else
+ * -> using conventional algorithm)
+ * If input value kind = logical
+ * -> If image is Fast
+ * -> particular case on sets
+ * Else
+ * -> general case on sets
+ * Else
+ * If input value are high quantified
+ * -> using conventional accumulator
+ * Else
+ * -> using histogram based accumulator
+ * If image is Fast
+ * -> particular case on functions
+ * Else
+ * -> general case on functions
+ *
*/
# ifndef MLN_INCLUDE_ONLY
@@ -109,36 +136,28 @@
void erosion_set_wrt_fast(trait::image::speed::any, const I& input,
const W& win, O& output)
{
- trace::entering("morpho::impl::erosion_set_wrt_fast");
generic::erosion_on_set(input, win, output);
- trace::exiting("morpho::impl::erosion_set_wrt_fast");
}
template <typename I, typename W, typename O>
void erosion_set_wrt_fast(trait::image::speed::fastest, const I& input,
const W& win, O& output)
{
- trace::entering("morpho::impl::erosion_set_wrt_fast");
impl::erosion_on_set_fast(input, win, output);
- trace::exiting("morpho::impl::erosion_set_wrt_fast");
}
template <typename I, typename W, typename O, typename A>
void erosion_fun_wrt_fast(trait::image::speed::any, const I& input,
const W& win, O& output, A& min)
{
- trace::entering("morpho::impl::erosion_fun_wrt_fast");
generic::erosion_on_function(input, win, output, min);
- trace::exiting("morpho::impl::erosion_fun_wrt_fast");
}
template <typename I, typename W, typename O, typename A>
void erosion_fun_wrt_fast(trait::image::speed::fastest, const I& input,
const W& win, O& output, A& min)
{
- trace::entering("morpho::impl::erosion_fun_wrt_fast");
impl::erosion_on_function_fast(input, win, output, min);
- trace::exiting("morpho::impl::erosion_fun_wrt_fast");
}
// ^
@@ -153,22 +172,18 @@
void erosion_wrt_data(trait::image::quant::high, const I& input,
const W& win, O& output)
{
- trace::entering("morpho::impl::erosion_wrt_data");
accu::min_<mln_value(I)> min;
impl::erosion_fun_wrt_fast(mln_trait_image_speed(I)(), input,
win, output, min);
- trace::exiting("morpho::impl::erosion_wrt_data");
}
template <typename I, typename W, typename O>
void erosion_wrt_data(trait::image::quant::low, const I& input,
const W& win, O& output)
{
- trace::entering("morpho::impl::erosion_wrt_data");
accu::min_h<mln_vset(I)> min;
impl::erosion_fun_wrt_fast(mln_trait_image_speed(I)(), input,
win, output, min);
- trace::exiting("morpho::impl::erosion_wrt_data");
}
// ^
@@ -182,8 +197,6 @@
template <typename I, typename W, typename O>
void erosion_wrt_value(const I& input, const W& win, O& output)
{
- trace::entering("morpho::impl::erosion_wrt_value");
-
if (mlc_is(mln_trait_image_kind(I), trait::image::kind::logic)::value)
impl::erosion_set_wrt_fast(mln_trait_image_speed(I)(), input,
win, output);
@@ -194,7 +207,6 @@
win, output);
// |
// `--> call stage 4: dispatch w.r.t. the data quantification
- trace::exiting("morpho::impl::erosion_wrt_value");
}
// ^
@@ -210,12 +222,10 @@
template <typename I, typename W, typename O>
void erosion_wrt_mor(const I& input, const W& win, O& output)
{
- trace::entering("morpho::impl::erosion_wrt_mor");
// FIXME : Choose the right algorithm between :
impl::erosion_wrt_value(input, win, output);
// and :
// impl::erosion_incr_wrt_value(input, win, output);
- trace::exiting("morpho::impl::erosion_wrt_mor");
}
// ^
@@ -231,7 +241,6 @@
template <typename I, typename W, typename O>
void erosion_wrt_win(const Image<I>& input_, const W& win_, Image<O>& output_)
{
- trace::entering("morpho::impl::erosion_wrt_win");
const I& input = exact(input_);
const W& win = exact(win_);
O& output = exact(output_);
@@ -239,7 +248,6 @@
impl::erosion_wrt_mor(input, win, output);
// |
// `--> call stage 2: dispatch w.r.t. the data quantification
- trace::exiting("morpho::impl::erosion_wrt_win");
}
# ifdef MLN_CORE_WIN_RECTANGLE2D_HH
@@ -256,8 +264,6 @@
# ifdef MLN_CORE_WIN_OCTAGON2D_HH
-# ifdef MLN_CORE_WIN_DIAG2D_HH
-# ifdef MLN_CORE_WIN_BACKDIAG2D_HH
template <typename I, typename O>
void erosion_wrt_win(const Image<I>& input, const win::octagon2d& win, Image<O>& output)
@@ -272,8 +278,6 @@
morpho::erosion(temp1, win::backdiag2d(len), output);
}
-# endif // MLN_CORE_WIN_BACKDIAG2D_HH
-# endif // MLN_CORE_WIN_DIAG2D_HH
# endif // MLN_CORE_WIN_OCTAGON2D_HH
// ^
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Fix warning in display::show.
* show.hh: Fix.
---
show.hh | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
Index: trunk/milena/mln/display/show.hh
===================================================================
--- trunk/milena/mln/display/show.hh (revision 1279)
+++ trunk/milena/mln/display/show.hh (revision 1280)
@@ -66,11 +66,21 @@
const I& input = exact (input_);
image2d<value::rgb8> out = display::color_pretty(input);
- std::string tmp = tempnam (0, "ppm");
- // Save output image from color in out.ppm.
- io::ppm::save(out, tmp);
+// /// Save output image from color in temporary file.
+// std::string path_tmp = tempnam (0, "ppm");
- std::string s = cmd + " " + tmp;
+ /// Use of mkstemp instead tempmap.
+ char *tmp = (char*)malloc (7 * sizeof (char));
+ for (int i = 0; i < 6; ++i)
+ tmp[i] = 'X';
+ tmp[6] = 0;
+ if (mkstemp(tmp) == -1)
+ return;
+
+ std::string t = tmp;
+ std::string path_tmp = "/tmp/" + t;
+ io::ppm::save(out, path_tmp);
+ std::string s = cmd + " " + path_tmp;
system (s.c_str ());
}
1
0
09 Oct '07
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add display::show for visualize temporary image.
* show.hh: Compile with warning by tempnam function.
---
show.hh | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
Index: trunk/milena/mln/display/show.hh
===================================================================
--- trunk/milena/mln/display/show.hh (revision 0)
+++ trunk/milena/mln/display/show.hh (revision 1279)
@@ -0,0 +1,94 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 MLN_DISPLAY_SHOW_HH
+# define MLN_DISPLAY_SHOW_HH
+
+/*! \file mln/display/show.hh
+ *
+ * \brief Create a pretty image, which display its content
+ * with red value for non-defined point site.
+ */
+
+# include <mln/trait/image_from_mesh.hh>
+# include <mln/core/image_if_value.hh>
+# include <mln/core/image2d.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/level/fill.hh>
+# include <mln/level/paste.hh>
+# include <mln/display/color_pretty.hh>
+# include <mln/io/ppm/save.hh>
+# include <mln/core/image2d.hh>
+
+namespace mln
+{
+
+ namespace display
+ {
+
+ template <typename I>
+ void
+ show(const Image<I>& input_, std::string cmd = "xv");
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ template <typename I>
+ void
+ show(const Image<I>& input_, std::string cmd)
+ {
+ const I& input = exact (input_);
+ image2d<value::rgb8> out = display::color_pretty(input);
+
+ std::string tmp = tempnam (0, "ppm");
+ // Save output image from color in out.ppm.
+ io::ppm::save(out, tmp);
+
+ std::string s = cmd + " " + tmp;
+ system (s.c_str ());
+ }
+
+ } // end of namespace mln::display::impl
+
+ /// Facade.
+ template <typename I>
+ void
+ show(const Image<I>& input_, std::string cmd = "xv")
+ {
+ return impl::show(input_, cmd);
+ }
+
+# endif // !MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::display
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DISPLAY_SHOW_HH
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-09 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add test for display::show.
* show.cc: New test.
---
show.cc | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
Index: trunk/milena/tests/show.cc
===================================================================
--- trunk/milena/tests/show.cc (revision 0)
+++ trunk/milena/tests/show.cc (revision 1278)
@@ -0,0 +1,67 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 tests/sub_image.cc
+ *
+ * \brief Tests on mln::sub_image.
+ */
+
+# include <mln/core/image2d.hh>
+# include <mln/io/pbm/load.hh>
+# include <mln/make/win_chamfer.hh>
+# include <mln/geom/chamfer.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/core/sub_image.hh>
+# include <mln/core/image_if_value.hh>
+# include <mln/core/inplace.hh>
+# include <mln/core/w_window2d_int.hh>
+# include <mln/display/show.hh>
+# include <mln/io/ppm/save.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ unsigned max = 51;
+
+
+ image2d<bool> input = io::pbm::load("../img/toto.pbm");
+
+ // Create a weighted windows :
+ // 0 2 0
+ // 2 p 2
+ // 0 2 0
+ const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 0> ();
+
+ // Call chamfer for a distance image.
+ image2d<unsigned> tmp = geom::chamfer(input, w_win, max);
+
+ // Call color_pretty for sub_image.
+ for (unsigned i = 2; i < 9; i += 2)
+ display::show (inplace (tmp | i));
+}
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Get rid of the _b (with border) suffix.
* tests/histo_to_image1d_b.cc,
* tests/image3d_b.cc,
* tests/pixter3d_b.cc,
* tests/image2d_b.cc,
* tests/pixter2d_b.cc,
* tests/image1d_b.cc,
* tests/pixter1d_b.cc,
* mln/core/pixter1d_b.hh,
* mln/core/pixter3d_b.hh,
* mln/core/image2d_b.hh,
* mln/core/pixter2d_b.hh,
* mln/core/image1d_b.hh,
* mln/core/image3d_b.hh: Rename as...
* tests/pixter2d.cc,
* tests/histo_to_image1d.cc,
* tests/image2d.cc,
* tests/pixter1d.cc,
* tests/pixter3d.cc,
* tests/image1d.cc,
* tests/image3d.cc,
* mln/core/pixter1d.hh,
* mln/core/pixter2d.hh,
* mln/core/pixter3d.hh,
* mln/core/image1d.hh,
* mln/core/image2d.hh,
* mln/core/image3d.hh: ...those.
(<name>_b): Rename as...
(<name>): ...those.
* tests/window1d.cc,
* tests/image_if_value.cc,
* tests/window3d.cc,
* tests/morpho_dilation_max_h.cc,
* tests/image_if_interval.cc,
* tests/level_naive_median.cc,
* tests/core_clone.cc,
* tests/io_pgm.cc,
* tests/level_sort_points.cc,
* tests/linear_log.cc,
* tests/line2d.cc,
* tests/accu_nil.cc,
* tests/labeling_algo.cc,
* tests/histo_compute.cc,
* tests/debug_println_with_border.cc,
* tests/io_pgm19.cc,
* tests/io_ppm23.cc,
* tests/level_median_hline2d.cc,
* tests/level_transform.cc,
* tests/morpho_erosion.cc,
* tests/morpho_hit_or_miss.cc,
* tests/fun_x2x_translation.cc,
* tests/fun_x2x_rotation.cc,
* tests/core_initialize.cc,
* tests/morpho_opening_area.cc,
* tests/morpho_erosion_min_h.cc,
* tests/accu_min.cc,
* tests/labeling_level_fast.cc,
* tests/new_io_pgm.cc,
* tests/pset_if.cc,
* tests/labeling_regional_maxima.cc,
* tests/sparse_image.cc,
* tests/plain.cc,
* tests/level_memcpy_.cc,
* tests/level_median.cc,
* tests/linear_convolve.cc,
* tests/run_pset.cc,
* tests/test_positive.cc,
* tests/linear_lap.cc,
* tests/labeling_foreground.cc,
* tests/dpoints_pixter.cc,
* tests/safe_image.cc,
* tests/estim_mean.cc,
* tests/morpho_gradient.cc,
* tests/level_median_dir.cc,
* tests/convert_to_image.cc,
* tests/rle_image.cc,
* tests/interpolated.cc,
* tests/w_window1d_int.cc,
* tests/w_window2d_int.cc,
* tests/window2d.cc,
* tests/w_window3d_int.cc,
* tests/io_pbm.cc,
* tests/io_ppm.cc,
* tests/main.cc,
* tests/cast_image.cc,
* tests/linear_sobel._cc,
* tests/mesh_image.cc,
* tests/morpho_thinning.cc,
* tests/chamfer.cc,
* tests/morpho_laplacian.cc,
* tests/labeling_estimate.cc,
* tests/level_fill.cc,
* tests/pixel.cc,
* tests/io_ppm16.cc,
* tests/sub_image.cc,
* tests/debug_println.cc,
* tests/level_median_fast.cc,
* tests/local_convolve.cc,
* tests/stack.cc,
* tests/level_approx_median.cc,
* tests/io_pgm27.cc,
* tests/decorated_image.cc,
* tests/image_if.cc,
* tests/value_float01.cc,
* tests/line_convolve.cc,
* tests/level_paste.cc,
* tests/linear_gaussian.cc,
* tests/trait_images.cc,
* tests/level_assign.cc,
* tests/level_memset_.cc,
* tests/io_pgm16.cc,
* tests/morpho_contrast.cc,
* tests/pw_value.cc,
* tests/canvas_browsing_fwd.cc,
* tests/color_pretty.cc,
* tests/hexa.cc,
* tests/tr_image.cc,
* tests/morpho_dilation.cc,
* tests/trait_ch_value.cc,
* tests/line_piter.cc,
* mln/trait/image_from_mesh.hh,
* mln/trait/images.hh,
* mln/convert/to_image.hh,
* mln/display/color_pretty.hh,
* mln/io/pfm/load.hh,
* mln/io/pgm/load.hh,
* mln/io/fits/load.hh,
* mln/io/ppm/load.hh,
* mln/io/internal/pnm/load.hh,
* mln/io/pbm/load.hh: Update.
mln/convert/to_image.hh | 20 ++---
mln/core/image1d.hh | 108 ++++++++++++++++----------------
mln/core/image2d.hh | 124 ++++++++++++++++++-------------------
mln/core/image3d.hh | 108 ++++++++++++++++----------------
mln/core/pixter1d.hh | 14 ++--
mln/core/pixter2d.hh | 24 +++----
mln/core/pixter3d.hh | 14 ++--
mln/display/color_pretty.hh | 4 -
mln/io/fits/load.hh | 6 -
mln/io/internal/pnm/load.hh | 8 +-
mln/io/pbm/load.hh | 6 -
mln/io/pfm/load.hh | 6 -
mln/io/pgm/load.hh | 6 -
mln/io/ppm/load.hh | 6 -
mln/trait/image_from_mesh.hh | 12 +--
mln/trait/images.hh | 6 -
tests/accu_min.cc | 4 -
tests/accu_nil.cc | 4 -
tests/canvas_browsing_fwd.cc | 8 +-
tests/cast_image.cc | 4 -
tests/chamfer.cc | 12 +--
tests/color_pretty.cc | 8 +-
tests/convert_to_image.cc | 4 -
tests/core_clone.cc | 8 +-
tests/core_initialize.cc | 4 -
tests/debug_println.cc | 4 -
tests/debug_println_with_border.cc | 8 +-
tests/decorated_image.cc | 4 -
tests/dpoints_pixter.cc | 4 -
tests/estim_mean.cc | 4 -
tests/fun_x2x_rotation.cc | 14 ++--
tests/fun_x2x_translation.cc | 4 -
tests/hexa.cc | 4 -
tests/histo_compute.cc | 6 -
tests/histo_to_image1d.cc | 8 +-
tests/image1d.cc | 8 +-
tests/image2d.cc | 8 +-
tests/image3d.cc | 8 +-
tests/image_if.cc | 4 -
tests/image_if_interval.cc | 4 -
tests/image_if_value.cc | 4 -
tests/interpolated.cc | 10 +-
tests/io_pbm.cc | 6 -
tests/io_pgm.cc | 4 -
tests/io_pgm16.cc | 10 +-
tests/io_pgm19.cc | 10 +-
tests/io_pgm27.cc | 10 +-
tests/io_ppm.cc | 4 -
tests/io_ppm16.cc | 14 ++--
tests/io_ppm23.cc | 14 ++--
tests/labeling_algo.cc | 14 ++--
tests/labeling_estimate.cc | 4 -
tests/labeling_foreground.cc | 4 -
tests/labeling_level_fast.cc | 8 +-
tests/labeling_regional_maxima.cc | 4 -
tests/level_approx_median.cc | 4 -
tests/level_assign.cc | 4 -
tests/level_fill.cc | 8 +-
tests/level_median.cc | 4 -
tests/level_median_dir.cc | 4 -
tests/level_median_fast.cc | 6 -
tests/level_median_hline2d.cc | 4 -
tests/level_memcpy_.cc | 4 -
tests/level_memset_.cc | 4 -
tests/level_naive_median.cc | 4 -
tests/level_paste.cc | 6 -
tests/level_sort_points.cc | 4 -
tests/level_transform.cc | 4 -
tests/line2d.cc | 8 +-
tests/line_convolve.cc | 6 -
tests/line_piter.cc | 6 -
tests/linear_convolve.cc | 6 -
tests/linear_gaussian.cc | 8 +-
tests/linear_lap.cc | 6 -
tests/linear_log.cc | 8 +-
tests/linear_sobel._cc | 6 -
tests/local_convolve.cc | 6 -
tests/main.cc | 10 +-
tests/mesh_image.cc | 4 -
tests/morpho_contrast.cc | 8 +-
tests/morpho_dilation.cc | 16 ++--
tests/morpho_dilation_max_h.cc | 6 -
tests/morpho_erosion.cc | 16 ++--
tests/morpho_erosion_min_h.cc | 6 -
tests/morpho_gradient.cc | 4 -
tests/morpho_hit_or_miss.cc | 4 -
tests/morpho_laplacian.cc | 8 +-
tests/morpho_opening_area.cc | 4 -
tests/morpho_thinning.cc | 4 -
tests/new_io_pgm.cc | 4 -
tests/pixel.cc | 4 -
tests/pixter1d.cc | 8 +-
tests/pixter2d.cc | 8 +-
tests/pixter3d.cc | 8 +-
tests/plain.cc | 8 +-
tests/pset_if.cc | 2
tests/pw_value.cc | 4 -
tests/rle_image.cc | 4 -
tests/run_pset.cc | 2
tests/safe_image.cc | 4 -
tests/sparse_image.cc | 4 -
tests/stack.cc | 10 +-
tests/sub_image.cc | 4 -
tests/test_positive.cc | 4 -
tests/tr_image.cc | 16 ++--
tests/trait_ch_value.cc | 4 -
tests/trait_images.cc | 10 +-
tests/value_float01.cc | 8 +-
tests/w_window1d_int.cc | 4 -
tests/w_window2d_int.cc | 4 -
tests/w_window3d_int.cc | 4 -
tests/window1d.cc | 4 -
tests/window2d.cc | 4 -
tests/window3d.cc | 4 -
114 files changed, 545 insertions(+), 545 deletions(-)
Index: tests/window1d.cc
--- tests/window1d.cc (revision 1276)
+++ tests/window1d.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/window1d.hh>
-#include <mln/core/image1d_b.hh>
+#include <mln/core/image1d.hh>
#include <mln/convert/to_image.hh>
#include <mln/debug/println.hh>
@@ -49,7 +49,7 @@
w.insert(make::dpoint1d(-1));
w.insert(make::dpoint1d( 1));
- image1d_b<bool> ima = convert::to_image(w);
+ image1d<bool> ima = convert::to_image(w);
debug::println(ima);
mln_assertion(w.delta() = 1);
Index: tests/image_if_value.cc
--- tests/image_if_value.cc (revision 1276)
+++ tests/image_if_value.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::image_if_value.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/image_if_value.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
@@ -40,7 +40,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(3, 3);
debug::iota(ima);
debug::println(ima);
Index: tests/window3d.cc
--- tests/window3d.cc (revision 1276)
+++ tests/window3d.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/window3d.hh>
-#include <mln/core/image3d_b.hh>
+#include <mln/core/image3d.hh>
#include <mln/convert/to_image.hh>
#include <mln/debug/println.hh>
@@ -50,7 +50,7 @@
w.insert(make::dpoint3d( 1, 1, 1));
w.insert(make::dpoint3d( 0, 0, 2));
- image3d_b<bool> ima = convert::to_image(w);
+ image3d<bool> ima = convert::to_image(w);
debug::println(ima);
mln_assertion(w.delta() = 2);
Index: tests/morpho_dilation_max_h.cc
--- tests/morpho_dilation_max_h.cc (revision 1276)
+++ tests/morpho_dilation_max_h.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::erosion.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/core/window2d.hh>
@@ -52,13 +52,13 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
{
vec_p<point2d> vec = convert::to_vec_p(rec, point2d::zero);
window2d win = convert::to_window(vec);
- image2d_b<int_u8> out(lena.domain());
+ image2d<int_u8> out(lena.domain());
morpho::dilation_fast(lena, win, out);
io::pgm::save(out, "out.pgm");
}
Index: tests/image_if_interval.cc
--- tests/image_if_interval.cc (revision 1276)
+++ tests/image_if_interval.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::image_if_value.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/image_if_interval.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
@@ -40,7 +40,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(3, 3);
debug::iota(ima);
debug::println(ima);
Index: tests/level_naive_median.cc
--- tests/level_naive_median.cc (revision 1276)
+++ tests/level_naive_median.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::level::naive::median.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
@@ -49,7 +49,7 @@
win::rectangle2d rec(51, 51);
border::thickness = 52;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
Index: tests/core_clone.cc
--- tests/core_clone.cc (revision 1276)
+++ tests/core_clone.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::clone.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/debug/iota.hh>
@@ -43,7 +43,7 @@
int main()
{
using namespace mln;
- image2d_b<int> ima(3, 3, 51);
+ image2d<int> ima(3, 3, 51);
debug::iota(ima);
{
@@ -55,14 +55,14 @@
}
{
- image2d_b<int> ima_ = clone(ima);
+ image2d<int> ima_ = clone(ima);
std::cout << ima_.border() << std::endl;
ima_(make::point2d(1,1)) = 51;
debug::println(ima);
}
{
- image2d_b<int> ima_( ima );
+ image2d<int> ima_( ima );
ima_(make::point2d(1,1)) = 51;
debug::println(ima);
}
Index: tests/io_pgm.cc
--- tests/io_pgm.cc (revision 1276)
+++ tests/io_pgm.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::ppm::load.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
@@ -43,7 +43,7 @@
using value::int_u8;
{
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load<int_u8>("../img/lena.pgm");
io::pgm::save(lena, "out.pgm");
Index: tests/level_sort_points.cc
--- tests/level_sort_points.cc (revision 1276)
+++ tests/level_sort_points.cc (working copy)
@@ -32,7 +32,7 @@
#include <iterator>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
@@ -45,7 +45,7 @@
using namespace mln;
using value::int_u8;
- image2d_b<int_u8> ima(3, 3);
+ image2d<int_u8> ima(3, 3);
debug::iota(ima);
vec_p<point2d> vec;
{
Index: tests/linear_log.cc
--- tests/linear_log.cc (revision 1276)
+++ tests/linear_log.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::linear::log.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
@@ -50,9 +50,9 @@
border::thickness = 2;
- image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
- image2d_b<int> tmp(lena.domain());
+ image2d<int> tmp(lena.domain());
linear::LoG_5x5(lena, tmp);
{
int min, max;
@@ -60,7 +60,7 @@
mln_assertion(min = -929 && max = 1458);
}
- image2d_b<int_u8> out(lena.domain());
+ image2d<int_u8> out(lena.domain());
level::stretch(tmp, out);
io::pgm::save(out, "out.pgm");
{
Index: tests/line2d.cc
--- tests/line2d.cc (revision 1276)
+++ tests/line2d.cc (working copy)
@@ -32,7 +32,7 @@
#include <iterator>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/core/inplace.hh>
@@ -50,17 +50,17 @@
line2d l(b, e);
mln_assertion(l.npoints() = 10);
- image2d_b<bool> ima(10,10);
+ image2d<bool> ima(10,10);
level::fill(ima, false);
draw::line(ima, b, e, true);
- image2d_b<bool> ima2(10,10);
+ image2d<bool> ima2(10,10);
level::fill(ima2, false);
level::paste(pw::cst(true) | l, ima2);
mln_assertion(ima2 = ima);
- image2d_b<bool> ima3(10,10);
+ image2d<bool> ima3(10,10);
level::fill(ima3, false);
level::fill(inplace(ima3 | l), true);
Index: tests/accu_nil.cc
--- tests/accu_nil.cc (revision 1276)
+++ tests/accu_nil.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::accu::nil.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/accu/nil.hh>
@@ -40,7 +40,7 @@
int main()
{
using namespace mln;
- image2d_b<value::int_u8> ima(3, 3);
+ image2d<value::int_u8> ima(3, 3);
accu::nil a;
level::compute<accu::nil>(ima);
}
Index: tests/labeling_algo.cc
--- tests/labeling_algo.cc (revision 1276)
+++ tests/labeling_algo.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::labeling::foreground.
*/
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/core/sub_image.hh>
# include <mln/core/neighb2d.hh>
# include <mln/value/int_u8.hh>
@@ -50,25 +50,25 @@
using namespace mln;
using value::int_u8;
- image2d_b<bool> in = io::pbm::load("../img/toto.pbm");
+ image2d<bool> in = io::pbm::load("../img/toto.pbm");
- image2d_b<int_u8> lab(in.domain());
- image2d_b<int_u8> inte(in.domain());
- image2d_b<int_u8> out(in.domain());
+ image2d<int_u8> lab(in.domain());
+ image2d<int_u8> inte(in.domain());
+ image2d<int_u8> out(in.domain());
unsigned n;
labeling::foreground(in, c8(), lab, n);
std::cout << "number of labels = " << n << std::endl;
std::vector<int_u8> vec;
- image2d_b<int> input(in.domain());
+ image2d<int> input(in.domain());
level::fill(input, lab);
lab(make::point2d (0,0)) = 0;
inte = geom::seeds2tiling(lab, c4 ());
border::fill (inte, 0);
- image2d_b<int_u8> inte2(inte.domain());
+ image2d<int_u8> inte2(inte.domain());
level::stretch (inte, inte2);
Index: tests/histo_compute.cc
--- tests/histo_compute.cc (revision 1276)
+++ tests/histo_compute.cc (working copy)
@@ -32,7 +32,7 @@
#include <iterator>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_s.hh>
@@ -62,7 +62,7 @@
}
{
- image2d_b<int_u8> ima(3, 3);
+ image2d<int_u8> ima(3, 3);
debug::iota(ima);
ima.at(0,0) = 2;
debug::println(ima);
@@ -76,7 +76,7 @@
// {
// typedef value::int_s<5> int_s5;
-// image2d_b<int_s5> ima(3, 3);
+// image2d<int_s5> ima(3, 3);
// debug::iota(ima);
// ima.at(0,0) = 2;
// debug::println(ima);
Index: tests/debug_println_with_border.cc
--- tests/debug_println_with_border.cc (revision 1276)
+++ tests/debug_println_with_border.cc (working copy)
@@ -30,8 +30,8 @@
* \brief Test on mln::debug::println_with_border.
*/
-#include <mln/core/image2d_b.hh>
-#include <mln/core/image1d_b.hh>
+#include <mln/core/image2d.hh>
+#include <mln/core/image1d.hh>
#include <mln/level/fill.hh>
#include <mln/debug/println.hh>
#include <mln/debug/println_with_border.hh>
@@ -45,7 +45,7 @@
border::thickness = 3;
{
- image2d_b<bool> msk(3, 3);
+ image2d<bool> msk(3, 3);
msk.at(0, 0) = true;
msk.at(1, 0) = true;
msk.at(2, 0) = true;
@@ -63,7 +63,7 @@
}
{
- image1d_b<bool> msk(3);
+ image1d<bool> msk(3);
msk.at(0) = false;
msk.at(1) = true;
msk.at(2) = false;
Index: tests/io_pgm19.cc
--- tests/io_pgm19.cc (revision 1276)
+++ tests/io_pgm19.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::pbm::load.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
@@ -74,17 +74,17 @@
border::thickness = 52;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load<int_u8>("../img/lena.pgm");
- image2d_b<int_u19> out(lena.domain());
+ image2d<int_u19> out(lena.domain());
level::transform(lena, to19bits(), out);
io::pgm::save(out, "out19.pgm");
- image2d_b<int_u19>
+ image2d<int_u19>
lena2 = io::pgm::load<int_u19>("out19.pgm");
- image2d_b<int_u8> out2(lena.domain());
+ image2d<int_u8> out2(lena.domain());
level::transform(lena2, to8bits(), out2);
Index: tests/io_ppm23.cc
--- tests/io_ppm23.cc (revision 1276)
+++ tests/io_ppm23.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::pbm::load for 23bits ppm
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/value/rgb8.hh>
@@ -76,15 +76,15 @@
using namespace mln;
using value::rgb8;
- typedef image2d_b<rgb8> I;
+ typedef image2d<rgb8> I;
// load a 8bits image A
- image2d_b<rgb8>
+ image2d<rgb8>
a = io::ppm::load<rgb8>("../img/lena.ppm");
- image2d_b<rgb23> b(a.domain());
+ image2d<rgb23> b(a.domain());
- image2d_b<rgb8>::fwd_piter p(b.domain());
+ image2d<rgb8>::fwd_piter p(b.domain());
// save it as a 23bits ppm image B
to23bits f;
@@ -93,9 +93,9 @@
io::ppm::save(b, "out23.ppm");
// reload B into C
- image2d_b<rgb23>
+ image2d<rgb23>
c = io::ppm::load<rgb23>("out23.ppm");
- image2d_b<rgb8> d(a.domain());
+ image2d<rgb8> d(a.domain());
// save C as a 8bits ppm image D
Index: tests/level_median_hline2d.cc
--- tests/level_median_hline2d.cc (revision 1276)
+++ tests/level_median_hline2d.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on the hline2d version of mln::level::median.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
@@ -50,7 +50,7 @@
border::thickness = 0;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain()),
ref(lena.domain());
Index: tests/pixter2d.cc
--- tests/pixter2d.cc (revision 1276)
+++ tests/pixter2d.cc (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/pixter2d_b.cc
+/*! \file tests/pixter2d.cc
*
- * \brief Tests on mln::fwd_pixter2d_b.
+ * \brief Tests on mln::fwd_pixter2d.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
const unsigned size = 20;
@@ -86,7 +86,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(size, size);
test_fill(ima);
Index: tests/level_transform.cc
--- tests/level_transform.cc (revision 1276)
+++ tests/level_transform.cc (working copy)
@@ -32,7 +32,7 @@
#include <cmath>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/level/transform.hh>
#include <mln/debug/iota.hh>
@@ -53,7 +53,7 @@
using namespace mln;
const unsigned size = 10000;
- image2d_b<unsigned short>
+ image2d<unsigned short>
ima(size, size);
(std::cout << "iota... ").flush();
Index: tests/morpho_erosion.cc
--- tests/morpho_erosion.cc (revision 1276)
+++ tests/morpho_erosion.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::erosion.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/core/win/octagon2d.hh>
#include <mln/core/win/diag2d.hh>
@@ -60,17 +60,17 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
{
- image2d_b<int_u8> out(lena.domain());
+ image2d<int_u8> out(lena.domain());
morpho::erosion(lena, rec, out);
io::pgm::save(out, "out1.pgm");
}
{
win::octagon2d oct(31);
- image2d_b<int_u8> out(lena.domain());
+ image2d<int_u8> out(lena.domain());
morpho::erosion(lena, oct, out);
io::pgm::save(out, "out2.pgm");
}
@@ -79,19 +79,19 @@
// vec_p<point2d> vec = convert::to_vec_p(rec, point2d::zero);
// window2d win = convert::to_window(vec);
-// image2d_b<int_u8> out(lena.domain());
+// image2d<int_u8> out(lena.domain());
// level::ero(lena, win, out);
// morpho::erosion(lena, win, out);
// io::pgm::save(out, "out.pgm");
// }
// {
-// image2d_b<bool> bin(lena.domain()), out(lena.domain());
+// image2d<bool> bin(lena.domain()), out(lena.domain());
// level::fill(bin, pw::value(lena) > pw::cst(127));
// morpho::erosion(bin, rec, out);
-// image2d_b<int_u8> test(lena.domain());
-// image2d_b<int_u8>::fwd_piter p(lena.domain());
+// image2d<int_u8> test(lena.domain());
+// image2d<int_u8>::fwd_piter p(lena.domain());
// for_all(p)
// test(p) = out(p) ? 255 : 0;
// io::pgm::save(test, "test.pgm");
Index: tests/morpho_hit_or_miss.cc
--- tests/morpho_hit_or_miss.cc (revision 1276)
+++ tests/morpho_hit_or_miss.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::hit_or_miss.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/win/rectangle2d.hh>
@@ -75,7 +75,7 @@
border::thickness = 2;
- image2d_b<int_u8>
+ image2d<int_u8>
pic = io::pgm::load("../img/picasso.pgm"),
out(pic.domain());
Index: tests/fun_x2x_translation.cc
--- tests/fun_x2x_translation.cc (revision 1276)
+++ tests/fun_x2x_translation.cc (working copy)
@@ -25,9 +25,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/image2d_b.cc
+/*! \file tests/image2d.cc
*
- * \brief Tests on mln::image2d_b.
+ * \brief Tests on mln::image2d.
*/
Index: tests/fun_x2x_rotation.cc
--- tests/fun_x2x_rotation.cc (revision 1276)
+++ tests/fun_x2x_rotation.cc (working copy)
@@ -25,15 +25,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/image2d_b.cc
+/*! \file tests/image2d.cc
*
- * \brief Tests on mln::image2d_b.
+ * \brief Tests on mln::image2d.
*/
#include <iostream>
#include <mln/fun/x2x/rotation.hh>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
@@ -45,14 +45,14 @@
using namespace mln;
using value::int_u8;
- image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
- image2d_b<int_u8> out(lena.domain());
+ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> out(lena.domain());
- interpolated<image2d_b<int_u8> > inter(lena);
+ interpolated<image2d<int_u8> > inter(lena);
fun::x2x::rotation<2,float> rot1(0.1);
- image2d_b<int_u8>::fwd_piter p(out.domain());
+ image2d<int_u8>::fwd_piter p(out.domain());
for_all(p)
{
Index: tests/core_initialize.cc
--- tests/core_initialize.cc (revision 1276)
+++ tests/core_initialize.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::initialize.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/debug/println.hh>
@@ -40,7 +40,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ref( make::box2d(3,3) );
box2d b = make::box2d(2,2);
Index: tests/morpho_opening_area.cc
--- tests/morpho_opening_area.cc (revision 1276)
+++ tests/morpho_opening_area.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::opening_area.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/neighb2d.hh>
@@ -46,7 +46,7 @@
using namespace mln;
using value::int_u8;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
Index: tests/morpho_erosion_min_h.cc
--- tests/morpho_erosion_min_h.cc (revision 1276)
+++ tests/morpho_erosion_min_h.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::erosion.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/core/window2d.hh>
@@ -52,13 +52,13 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
{
vec_p<point2d> vec = convert::to_vec_p(rec, point2d::zero);
window2d win = convert::to_window(vec);
- image2d_b<int_u8> out(lena.domain());
+ image2d<int_u8> out(lena.domain());
morpho::erosion_fast(lena, win, out);
io::pgm::save(out, "out.pgm");
}
Index: tests/accu_min.cc
--- tests/accu_min.cc (revision 1276)
+++ tests/accu_min.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::accu::min.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/accu/nil.hh>
@@ -45,7 +45,7 @@
int main()
{
using namespace mln;
- image2d_b<int> ima(3, 3);
+ image2d<int> ima(3, 3);
debug::iota(ima);
mln_assertion(level::compute< accu::min >(ima) = 1);
mln_assertion(level::compute< accu::min_<int> >(ima) = 1);
Index: tests/histo_to_image1d.cc
--- tests/histo_to_image1d.cc (revision 1276)
+++ tests/histo_to_image1d.cc (working copy)
@@ -32,8 +32,8 @@
#include <iterator>
-#include <mln/core/image2d_b.hh>
-#include <mln/core/image1d_b.hh>
+#include <mln/core/image2d.hh>
+#include <mln/core/image1d.hh>
#include <mln/value/int_u8.hh>
@@ -64,14 +64,14 @@
}
{
- image2d_b<int_u8> ima(3, 3);
+ image2d<int_u8> ima(3, 3);
debug::iota(ima);
ima(make::point2d(0,1)) = 255;
debug::println(ima);
histo::data< value::set<int_u8> > h = histo::compute(ima);
std::cout << h << std::endl;
- image1d_b<std::size_t> ima2 = convert::to_image(h);
+ image1d<std::size_t> ima2 = convert::to_image(h);
debug::println(ima2);
}
}
Index: tests/labeling_level_fast.cc
--- tests/labeling_level_fast.cc (revision 1276)
+++ tests/labeling_level_fast.cc (working copy)
@@ -30,8 +30,8 @@
* \brief Test on mln::labeling::foreground.
*/
-#include <mln/core/image2d_b.hh>
-#include <mln/core/image1d_b.hh>
+#include <mln/core/image2d.hh>
+#include <mln/core/image1d.hh>
#include <mln/core/neighb2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/pw/all.hh>
@@ -49,13 +49,13 @@
unsigned border = 1;
- image2d_b<value::int_u8> i1(5, 5, border);
+ image2d<value::int_u8> i1(5, 5, border);
debug::iota(i1);
i1[10] = i1[17] = i1[18] = i1[25] = i1[26] = i1[22] = i1[29] = 2;
debug::println(i1);
unsigned n;
- image2d_b<value::int_u8> out(i1.domain(), border);
+ image2d<value::int_u8> out(i1.domain(), border);
labeling::level(i1, 2, c4(), out, n);
std::cout << "n = " << n << std::endl;
Index: tests/new_io_pgm.cc
--- tests/new_io_pgm.cc (revision 1276)
+++ tests/new_io_pgm.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::ppm::load.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_u.hh>
@@ -46,7 +46,7 @@
using value::rgb8;
{
- image2d_b< value::int_u<8> >
+ image2d< value::int_u<8> >
lena;
io::pgm::load(lena, "../img/lena.pgm");
Index: tests/pset_if.cc
--- tests/pset_if.cc (revision 1276)
+++ tests/pset_if.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::pset_if.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/pset_if.hh>
#include <mln/fun/p2b/chess.hh>
#include <mln/convert/to_image.hh>
Index: tests/labeling_regional_maxima.cc
--- tests/labeling_regional_maxima.cc (revision 1276)
+++ tests/labeling_regional_maxima.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::labeling::regional_maxima.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/neighb2d.hh>
#include <mln/value/int_u8.hh>
@@ -45,7 +45,7 @@
using namespace mln;
using value::int_u8;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
Index: tests/sparse_image.cc
--- tests/sparse_image.cc (revision 1276)
+++ tests/sparse_image.cc (working copy)
@@ -1,4 +1,4 @@
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sparse_image.hh>
#include <mln/core/sparse_encode.hh>
#include <vector>
@@ -64,7 +64,7 @@
test(sparse.domain());
test2(sparse);
- mln::image2d_b<int> ima2d (1, 5);
+ mln::image2d<int> ima2d (1, 5);
ima2d(mln::make::point2d(0, 4)) = 5;
ima2d(mln::make::point2d(0, 3)) = 2;
Index: tests/plain.cc
--- tests/plain.cc (revision 1276)
+++ tests/plain.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::plain.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/plain.hh>
#include <mln/value/int_u8.hh>
@@ -45,11 +45,11 @@
using value::int_u8;
{
- plain< image2d_b<int_u8> >
+ plain< image2d<int_u8> >
lena = io::pgm::load<int_u8>("../img/lena.pgm");
- image2d_b<int_u8> ima;
- image2d_b<int_u8> ima2;
+ image2d<int_u8> ima;
+ image2d<int_u8> ima2;
ima = lena;
Index: tests/image2d.cc
--- tests/image2d.cc (revision 1276)
+++ tests/image2d.cc (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/image2d_b.cc
+/*! \file tests/image2d.cc
*
- * \brief Tests on mln::image2d_b.
+ * \brief Tests on mln::image2d.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/geom/size2d.hh>
#include <mln/core/init.hh>
@@ -45,7 +45,7 @@
const unsigned ncols = 66;
const unsigned border = 4;
- image2d_b<int> f(nrows, ncols, border);
+ image2d<int> f(nrows, ncols, border);
mln_assertion(f.npoints() = geom::nrows(f) * geom::ncols(f));
mln_assertion(f.ncells() = (nrows + 2 * border) * (ncols + 2 * border));
Index: tests/level_memcpy_.cc
--- tests/level_memcpy_.cc (revision 1276)
+++ tests/level_memcpy_.cc (working copy)
@@ -32,7 +32,7 @@
* \todo Make this test not dummy!
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/inplace.hh>
#include <mln/debug/iota.hh>
#include <mln/level/memcpy_.hh>
@@ -42,7 +42,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(3, 3);
debug::iota(ima);
Index: tests/level_median.cc
--- tests/level_median.cc (revision 1276)
+++ tests/level_median.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::level::median.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
@@ -50,7 +50,7 @@
win::rectangle2d rect(51, 51);
border::thickness = 52;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
Index: tests/linear_convolve.cc
--- tests/linear_convolve.cc (revision 1276)
+++ tests/linear_convolve.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::linear::convolve.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
@@ -50,7 +50,7 @@
border::thickness = 2;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
@@ -61,7 +61,7 @@
.04, .04, .04, .04, .04 };
w_window2d_float w = make::w_window2d(ws);
- image2d_b<float> tmp(lena.domain());
+ image2d<float> tmp(lena.domain());
linear::convolve(lena, w, tmp);
level::transform(tmp, math::round<int_u8>(), out);
Index: tests/run_pset.cc
--- tests/run_pset.cc (revision 1276)
+++ tests/run_pset.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::internal::run_pset_ and related tools.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/internal/run_pset.hh>
Index: tests/test_positive.cc
--- tests/test_positive.cc (revision 1276)
+++ tests/test_positive.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::test::positive.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/level/fill.hh>
#include <mln/test/positive.hh>
@@ -52,7 +52,7 @@
int main()
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(1,1);
level::fill(ima, 0);
Index: tests/linear_lap.cc
--- tests/linear_lap.cc (revision 1276)
+++ tests/linear_lap.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::linear::lap_4.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
@@ -45,7 +45,7 @@
border::thickness = 1;
- image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
- image2d_b<int> tmp(lena.domain());
+ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int> tmp(lena.domain());
linear::lap_4(lena, tmp);
}
Index: tests/labeling_foreground.cc
--- tests/labeling_foreground.cc (revision 1276)
+++ tests/labeling_foreground.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::labeling::foreground.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/neighb2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/pw/all.hh>
@@ -45,7 +45,7 @@
using namespace mln;
using value::int_u8;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/tiny.pgm"),
out(lena.domain());
Index: tests/dpoints_pixter.cc
--- tests/dpoints_pixter.cc (revision 1276)
+++ tests/dpoints_pixter.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::dpoints_fwd_pixter.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/make/pixel.hh>
@@ -69,7 +69,7 @@
using namespace mln;
border::thickness = 1;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(5, 5);
win::rectangle2d rect(3, 3);
Index: tests/safe_image.cc
--- tests/safe_image.cc (revision 1276)
+++ tests/safe_image.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::safe_image.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/safe.hh>
@@ -38,7 +38,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(1, 1);
point2d
in = make::point2d(0, 0),
Index: tests/estim_mean.cc
--- tests/estim_mean.cc (revision 1276)
+++ tests/estim_mean.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::estim::mean.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
@@ -42,7 +42,7 @@
using namespace mln;
using value::int_u8;
- image2d_b<int_u8> ima(3, 3);
+ image2d<int_u8> ima(3, 3);
debug::iota(ima);
// 1 2 3
// 4 5 6
Index: tests/morpho_gradient.cc
--- tests/morpho_gradient.cc (revision 1276)
+++ tests/morpho_gradient.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::gradient.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
@@ -49,7 +49,7 @@
win::rectangle2d rect(5, 5);
border::thickness = 2;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/tiny.pgm"),
out(lena.domain());
Index: tests/level_median_dir.cc
--- tests/level_median_dir.cc (revision 1276)
+++ tests/level_median_dir.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::level::median.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
@@ -46,7 +46,7 @@
border::thickness = 7;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
Index: tests/convert_to_image.cc
--- tests/convert_to_image.cc (revision 1276)
+++ tests/convert_to_image.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::convert::to_image.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/window2d.hh>
#include <mln/core/pset_if.hh>
#include <mln/fun/p2b/chess.hh>
@@ -57,7 +57,7 @@
0, 1, 0, // < center point
1, 0, 1 };
- image2d_b<bool> ima_X = convert::to_image(box_3x3 | fun::p2b::chess);
+ image2d<bool> ima_X = convert::to_image(box_3x3 | fun::p2b::chess);
window2d win_X = make::window2d(X);
mln_assertion(convert::to_image(win_X) = ima_X);
Index: tests/rle_image.cc
--- tests/rle_image.cc (revision 1276)
+++ tests/rle_image.cc (working copy)
@@ -1,4 +1,4 @@
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/rle_image.hh>
#include <mln/core/rle_encode.hh>
@@ -39,7 +39,7 @@
// mln::debug::print(rle);
// std::cout << std::endl;
- mln::image2d_b<int> ima2d (1, 5);
+ mln::image2d<int> ima2d (1, 5);
ima2d(make::point2d(0, 4)) = 5;
// mln::debug::print(ima2d);
Index: tests/interpolated.cc
--- tests/interpolated.cc (revision 1276)
+++ tests/interpolated.cc (working copy)
@@ -25,14 +25,14 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/image2d_b.cc
+/*! \file tests/image2d.cc
*
- * \brief Tests on mln::image2d_b.
+ * \brief Tests on mln::image2d.
*/
#include <iostream>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/interpolated.hh>\
#include <mln/metal/vec.hh>
@@ -51,14 +51,14 @@
const unsigned ncols = 4;
const unsigned border = 4;
- image2d_b<float> f(nrows, ncols, border);
+ image2d<float> f(nrows, ncols, border);
float tab[] = {1., 3., 5., 7.,
4., 7., 10., 13.,
7., 11., 15., 19.,
10., 15., 20., 25.};
level::fill(f, tab);
- interpolated< image2d_b<float> > inter(f);
+ interpolated< image2d<float> > inter(f);
metal::vec<2, float> v1 = make::vec(2.3, 0.6);
metal::vec<2, float> v2 = make::vec(3.2, 1.8);
Index: tests/w_window1d_int.cc
--- tests/w_window1d_int.cc (revision 1276)
+++ tests/w_window1d_int.cc (working copy)
@@ -56,7 +56,7 @@
-1, 0, 1 };
w_window1d_int w_win = make::w_window1d(ws);
- image1d_b<int> ima = convert::to_image(w_win);
+ image1d<int> ima = convert::to_image(w_win);
w_window1d_int w_win_2 = convert::to_w_window(ima);
mln_assertion(w_win_2 = w_win);
}
@@ -67,7 +67,7 @@
// -3 -2 -1 0 +1
// -2 -1 0 +1 +2
// -1 0 +1 +2 +3
- image1d_b<int> ima = convert::to_image(w_win);
+ image1d<int> ima = convert::to_image(w_win);
mln_assertion(estim::sum(ima) = 0);
}
Index: tests/w_window2d_int.cc
--- tests/w_window2d_int.cc (revision 1276)
+++ tests/w_window2d_int.cc (working copy)
@@ -56,7 +56,7 @@
-1, 0, 1 };
w_window2d_int w_win = make::w_window2d(ws);
- image2d_b<int> ima = convert::to_image(w_win);
+ image2d<int> ima = convert::to_image(w_win);
w_window2d_int w_win_2 = convert::to_w_window(ima);
mln_assertion(w_win_2 = w_win);
}
@@ -67,7 +67,7 @@
// -3 -2 -1 0 +1
// -2 -1 0 +1 +2
// -1 0 +1 +2 +3
- image2d_b<int> ima = convert::to_image(w_win);
+ image2d<int> ima = convert::to_image(w_win);
mln_assertion(estim::sum(ima) = 0);
}
Index: tests/window2d.cc
--- tests/window2d.cc (revision 1276)
+++ tests/window2d.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/window2d.hh>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/convert/to_image.hh>
#include <mln/debug/println.hh>
@@ -49,7 +49,7 @@
w.insert(make::dpoint2d(-1,-1));
w.insert(make::dpoint2d( 1, 1));
- image2d_b<bool> ima = convert::to_image(w);
+ image2d<bool> ima = convert::to_image(w);
debug::println(ima);
mln_assertion(w.delta() = 1);
Index: tests/w_window3d_int.cc
--- tests/w_window3d_int.cc (revision 1276)
+++ tests/w_window3d_int.cc (working copy)
@@ -64,7 +64,7 @@
3, 2, 3};
w_window3d_int w_win = make::w_window3d(ws);
- image3d_b<int> ima = convert::to_image(w_win);
+ image3d<int> ima = convert::to_image(w_win);
debug::println(ima);
std::cout << std::endl;
w_window3d_int w_win_2 = convert::to_w_window(ima);
@@ -77,7 +77,7 @@
// -3 -2 -1 0 +1
// -2 -1 0 +1 +2
// -1 0 +1 +2 +3
- image3d_b<int> ima = convert::to_image(w_win);
+ image3d<int> ima = convert::to_image(w_win);
debug::println(ima);
mln_assertion(estim::sum(ima) = 0);
}
Index: tests/io_pbm.cc
--- tests/io_pbm.cc (revision 1276)
+++ tests/io_pbm.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::pbm::load.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/io/pbm/load.hh>
#include <mln/io/pbm/save.hh>
@@ -39,9 +39,9 @@
{
using namespace mln;
- image2d_b< bool >
+ image2d< bool >
lena = io::pbm::load("../img/lena.pbm");
- image2d_b<bool> out(lena.domain());
+ image2d<bool> out(lena.domain());
//level::transform(lena, binarise(), out);
Index: tests/io_ppm.cc
--- tests/io_ppm.cc (revision 1276)
+++ tests/io_ppm.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::ppm::load.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/rgb8.hh>
@@ -46,7 +46,7 @@
using value::rgb8;
using value::int_u8;
- image2d_b<rgb8>
+ image2d<rgb8>
lena = io::ppm::load("../img/lena.ppm");
io::ppm::save(lena, "out.ppm");
Index: tests/main.cc
--- tests/main.cc (revision 1276)
+++ tests/main.cc (working copy)
@@ -27,7 +27,7 @@
#include <cmath>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/level/fill.hh>
#include <mln/debug/println.hh>
@@ -53,7 +53,7 @@
using namespace mln;
const unsigned size = 1000;
- image2d_b<value::int_u8> f(size, size);
+ image2d<value::int_u8> f(size, size);
morpho::Rd(f, f, c8());
}
@@ -72,7 +72,7 @@
// std::cout << c8() << std::endl;
// {
-// image2d_b<int> ima(b);
+// image2d<int> ima(b);
// level::fill(ima, 51);
// debug::println(ima);
@@ -86,12 +86,12 @@
// {
-// image2d_b<int> ima(b);
+// image2d<int> ima(b);
// level::fill(ima, cos_sin);
// debug::println(ima);
// std::cout << std::endl;
-// image2d_b<int> ima2 = morpho::erosion(ima, win);
+// image2d<int> ima2 = morpho::erosion(ima, win);
// debug::println(ima2);
// }
Index: tests/cast_image.cc
--- tests/cast_image.cc (revision 1276)
+++ tests/cast_image.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::cast_image.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/fun/p2b/chess.hh>
#include <mln/level/fill.hh>
#include <mln/debug/println.hh>
@@ -41,7 +41,7 @@
{
using namespace mln;
- image2d_b<bool> ima(8, 8);
+ image2d<bool> ima(8, 8);
level::fill(ima, fun::p2b::chess);
debug::println(ima);
debug::println( cast_image<int>(ima) );
Index: tests/linear_sobel._cc
--- tests/linear_sobel._cc (revision 1276)
+++ tests/linear_sobel._cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::linear::sobel.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/level/saturate.hh>
@@ -48,11 +48,11 @@
border::thickness = 1;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
- image2d_b<int> tmp(lena.domain());
+ image2d<int> tmp(lena.domain());
linear::sobel(lena, tmp);
level::saturate(tmp, out);
Index: tests/mesh_image.cc
--- tests/mesh_image.cc (revision 1276)
+++ tests/mesh_image.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::mesh_image.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/point2d.hh>
#include <mln/debug/println.hh>
#include <mln/util/graph.hh>
@@ -72,7 +72,7 @@
v.push_back (make::point2d (1,19));
- image2d_b<int> ima (20, 20, 1);
+ image2d<int> ima (20, 20, 1);
mesh_p<point2d> m(g, v);
Index: tests/pixter1d.cc
--- tests/pixter1d.cc (revision 1276)
+++ tests/pixter1d.cc (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/pixter1d_b.cc
+/*! \file tests/pixter1d.cc
*
- * \brief Tests on mln::fwd_pixter1d_b.
+ * \brief Tests on mln::fwd_pixter1d.
*/
-#include <mln/core/image1d_b.hh>
+#include <mln/core/image1d.hh>
const unsigned size = 20;
@@ -86,7 +86,7 @@
{
using namespace mln;
- typedef image1d_b<int> I;
+ typedef image1d<int> I;
I ima(size);
test_fill(ima);
Index: tests/pixter3d.cc
--- tests/pixter3d.cc (revision 1276)
+++ tests/pixter3d.cc (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/pixter3d_b.cc
+/*! \file tests/pixter3d.cc
*
- * \brief Tests on mln::fwd_pixter3d_b.
+ * \brief Tests on mln::fwd_pixter3d.
*/
-#include <mln/core/image3d_b.hh>
+#include <mln/core/image3d.hh>
const unsigned size = 5;
@@ -88,7 +88,7 @@
{
using namespace mln;
- typedef image3d_b<int> I;
+ typedef image3d<int> I;
I ima(size, size, size);
test_fill(ima);
Index: tests/morpho_thinning.cc
--- tests/morpho_thinning.cc (revision 1276)
+++ tests/morpho_thinning.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::thinning.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/win/rectangle2d.hh>
@@ -59,7 +59,7 @@
border::thickness = 2;
- image2d_b<int_u8>
+ image2d<int_u8>
pic = io::pgm::load("../img/picasso.pgm"),
out(pic.domain());
Index: tests/chamfer.cc
--- tests/chamfer.cc (revision 1276)
+++ tests/chamfer.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on all files in mln/geom/chamfer.hh .
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/core/image_if_value.hh>
#include <mln/core/inplace.hh>
@@ -49,13 +49,13 @@
using namespace mln;
unsigned max = 51;
- image2d_b<bool> ima(9, 9);
+ image2d<bool> ima(9, 9);
{
level::fill(ima, false);
ima.at(4,4) = true;
const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 0> ();
- image2d_b<unsigned> out = geom::chamfer(ima, w_win, max);
+ image2d<unsigned> out = geom::chamfer(ima, w_win, max);
debug::println(out | value::interval(0, 8));
}
@@ -63,7 +63,7 @@
level::fill(ima, false);
ima.at(4,4) = true;
const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 3> ();
- image2d_b<unsigned> out = geom::chamfer(ima, w_win, max);
+ image2d<unsigned> out = geom::chamfer(ima, w_win, max);
debug::println(out | value::interval(0, 8));
}
@@ -71,8 +71,8 @@
level::fill(ima, false);
ima.at(4,4) = true;
const w_window2d_int& w_win = win_chamfer::mk_chamfer_5x5_int<4, 6, 9> ();
- image2d_b<unsigned> out = geom::chamfer(ima, w_win, max);
- image2d_b<unsigned>::fwd_piter p(out.domain());
+ image2d<unsigned> out = geom::chamfer(ima, w_win, max);
+ image2d<unsigned>::fwd_piter p(out.domain());
for_all(p)
out(p) = out(p) / 2;
debug::println(out | value::interval(0, 8));
Index: tests/morpho_laplacian.cc
--- tests/morpho_laplacian.cc (revision 1276)
+++ tests/morpho_laplacian.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::laplacian.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
@@ -53,11 +53,11 @@
win::rectangle2d rect(5, 5);
border::thickness = 2;
- image2d_b<int_u8> lena = io::pgm::load("../img/tiny.pgm");
- image2d_b<int> lap(lena.domain());
+ image2d<int_u8> lena = io::pgm::load("../img/tiny.pgm");
+ image2d<int> lap(lena.domain());
morpho::laplacian(lena, rect, lap);
- image2d_b< value::int_u_sat<8> > out(lena.domain());
+ image2d< value::int_u_sat<8> > out(lena.domain());
arith::plus_cst(lap, 128, out);
io::pgm::save(out, "out.pgm");
}
Index: tests/labeling_estimate.cc
--- tests/labeling_estimate.cc (revision 1276)
+++ tests/labeling_estimate.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::labeling::foreground.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/neighb2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/pw/all.hh>
@@ -46,7 +46,7 @@
using namespace mln;
using value::int_u8;
- image2d_b<int_u8> lena = io::pgm::load("../img/tiny.pgm"),
+ image2d<int_u8> lena = io::pgm::load("../img/tiny.pgm"),
out(lena.domain());
unsigned n;
Index: tests/level_fill.cc
--- tests/level_fill.cc (revision 1276)
+++ tests/level_fill.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::level::fill
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/level/fill.hh>
@@ -49,21 +49,21 @@
// {
// const unsigned size = 3;
-// image2d_b<unsigned> ima(size, size);
+// image2d<unsigned> ima(size, size);
// level::fill(ima, u);
// debug::println(ima);
// }
{
const unsigned size = 10000;
- image2d_b<unsigned char> ima(size, size);
+ image2d<unsigned char> ima(size, size);
for (unsigned i = 0; i < 5; ++i)
level::fill(ima, uc);
}
// {
// // do *not* compile so that's great since ima is not mutable
-// sub_image< const image2d_b<int>, box2d > ima;
+// sub_image< const image2d<int>, box2d > ima;
// level::fill(ima, 0);
// }
Index: tests/pixel.cc
--- tests/pixel.cc (revision 1276)
+++ tests/pixel.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::pixel.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/pixel.hh>
#include <mln/metal/equal.hh>
@@ -39,7 +39,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
border::thickness = 0;
I ima(3, 3);
Index: tests/io_ppm16.cc
--- tests/io_ppm16.cc (revision 1276)
+++ tests/io_ppm16.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::pbm::load for 16bits ppm
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/value/rgb8.hh>
@@ -76,15 +76,15 @@
using value::rgb8;
using value::rgb16;
- typedef image2d_b<rgb8> I;
+ typedef image2d<rgb8> I;
// load a 8bits image A
- image2d_b<rgb8>
+ image2d<rgb8>
a = io::ppm::load<rgb8>("../img/lena.ppm");
- image2d_b<rgb16> b(a.domain());
+ image2d<rgb16> b(a.domain());
- image2d_b<rgb8>::fwd_piter p(b.domain());
+ image2d<rgb8>::fwd_piter p(b.domain());
// save it as a 16bits ppm image B
to16bits f;
@@ -93,9 +93,9 @@
io::ppm::save(b, "out16.ppm");
// reload B into C
- image2d_b<rgb16>
+ image2d<rgb16>
c = io::ppm::load<rgb16>("out16.ppm");
- image2d_b<rgb8> d(a.domain());
+ image2d<rgb8> d(a.domain());
// save C as a 8bits ppm image D
Index: tests/sub_image.cc
--- tests/sub_image.cc (revision 1276)
+++ tests/sub_image.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::sub_image.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/core/inplace.hh>
@@ -42,7 +42,7 @@
{
using namespace mln;
- image2d_b<int> ima(8, 8);
+ image2d<int> ima(8, 8);
level::fill(ima, 0);
debug::println(ima);
Index: tests/debug_println.cc
--- tests/debug_println.cc (revision 1276)
+++ tests/debug_println.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::debug::println.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/level/fill.hh>
#include <mln/debug/println.hh>
@@ -40,7 +40,7 @@
int main()
{
- image2d_b<bool> msk(3, 3);
+ image2d<bool> msk(3, 3);
msk.at(1, 1) = true;
debug::println(msk);
}
Index: tests/level_median_fast.cc
--- tests/level_median_fast.cc (revision 1276)
+++ tests/level_median_fast.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::level::fast_median.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
@@ -82,7 +82,7 @@
// {
// win::rectangle2d rect(3, 3);
// border::thickness = 4;
-// image2d_b<int_u8> ima(3, 3);
+// image2d<int_u8> ima(3, 3);
// debug::iota(ima);
// debug::println(ima);
// test(ima, rect);
@@ -93,7 +93,7 @@
win::rectangle2d rect(51, 51);
border::thickness = 52;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
Index: tests/local_convolve.cc
--- tests/local_convolve.cc (revision 1276)
+++ tests/local_convolve.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::linear::local::convolve.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/w_window2d_int.hh>
@@ -51,7 +51,7 @@
const unsigned size = 3;
border::thickness = size - 1;
- image2d_b<int_u8> ima(size, size);
+ image2d<int_u8> ima(size, size);
debug::iota(ima);
point2d p = make::point2d(1,1);
@@ -65,7 +65,7 @@
}
{
- typedef image2d_b<int_u8> I;
+ typedef image2d<int_u8> I;
linear::local::convolve(pixel<const I>(ima, p), w_win, res);
linear::local::convolve(pixel<I>(ima, p), w_win, res);
}
Index: tests/stack.cc
--- tests/stack.cc (revision 1276)
+++ tests/stack.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::value::stack.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/stack.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
@@ -40,10 +40,10 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
box2d b = make::box2d(2, 2);
- image2d_b<int> ima5(b), ima1(b);
+ image2d<int> ima5(b), ima1(b);
point2d p = make::point2d(0, 0);
metal::vec<2, int> v = make::vec(5, 1);
@@ -52,9 +52,9 @@
mln_assertion(value::stack(ima5, ima1)(p) = v);
mln_assertion(ima5(p) = 5 && ima1(p) = 1);
- value::stack_image<2, image2d_b<int> > s1(value::stack(ima5, ima1));
+ value::stack_image<2, image2d<int> > s1(value::stack(ima5, ima1));
- value::stack_image<2, image2d_b<int> > s2;
+ value::stack_image<2, image2d<int> > s2;
p = make::point2d(1, 1);
s2 = s1;
Index: tests/image1d.cc
--- tests/image1d.cc (revision 1276)
+++ tests/image1d.cc (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/image1d_b.cc
+/*! \file tests/image1d.cc
*
- * \brief Tests on mln::image1d_b.
+ * \brief Tests on mln::image1d.
*/
-#include <mln/core/image1d_b.hh>
+#include <mln/core/image1d.hh>
#include <mln/geom/size1d.hh>
@@ -41,7 +41,7 @@
const unsigned ninds = 1;
const unsigned border = 4;
- image1d_b<int> f(ninds, border);
+ image1d<int> f(ninds, border);
mln_assertion(f.npoints() = ninds);
mln_assertion(f.ncells() = (ninds + 2 * border));
Index: tests/image3d.cc
--- tests/image3d.cc (revision 1276)
+++ tests/image3d.cc (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/image3d_b.cc
+/*! \file tests/image3d.cc
*
- * \brief Tests on mln::image3d_b.
+ * \brief Tests on mln::image3d.
*/
-#include <mln/core/image3d_b.hh>
+#include <mln/core/image3d.hh>
#include <mln/geom/size3d.hh>
@@ -43,7 +43,7 @@
const unsigned ncols = 5;
const unsigned border = 4;
- image3d_b<int> f(nslis, nrows, ncols, border);
+ image3d<int> f(nslis, nrows, ncols, border);
mln_assertion(f.npoints() = geom::nslis(f) * geom::nrows(f) * geom::ncols(f));
mln_assertion(f.ncells() = ((nrows + 2 * border)
Index: tests/level_approx_median.cc
--- tests/level_approx_median.cc (revision 1276)
+++ tests/level_approx_median.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::level::approx::median.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/core/win/octagon2d.hh>
@@ -52,7 +52,7 @@
win::octagon2d oct(13);
border::thickness = 52;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
Index: tests/io_pgm27.cc
--- tests/io_pgm27.cc (revision 1276)
+++ tests/io_pgm27.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::pbm::load.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
@@ -72,18 +72,18 @@
using value::int_u;
typedef value::int_u<27> int_u27;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load<int_u8>("../img/lena.pgm");
- image2d_b<int_u27> out(lena.domain());
+ image2d<int_u27> out(lena.domain());
level::transform(lena, to27bits(), out);
io::pgm::save(out, "out27.pgm");
- image2d_b<int_u27> lena2;
+ image2d<int_u27> lena2;
io::pgm::load(lena2, "out27.pgm");
- image2d_b<int_u8> out2(lena.domain());
+ image2d<int_u8> out2(lena.domain());
level::transform(lena2, to8bits(), out2);
Index: tests/decorated_image.cc
--- tests/decorated_image.cc (revision 1276)
+++ tests/decorated_image.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::decorated_image.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/decorated_image.hh>
@@ -54,7 +54,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(1, 1);
point2d p = make::point2d(0, 0);
Index: tests/image_if.cc
--- tests/image_if.cc (revision 1276)
+++ tests/image_if.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::image_if.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/image_if.hh>
#include <mln/fun/p2b/chess.hh>
#include <mln/debug/println.hh>
@@ -40,7 +40,7 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
I ima(8, 8);
// debug::println(ima | fun::p2b::chess);
mln_assertion((ima | fun::p2b::chess).npoints() = 32);
Index: tests/value_float01.cc
--- tests/value_float01.cc (revision 1276)
+++ tests/value_float01.cc (working copy)
@@ -27,7 +27,7 @@
#include <iostream>
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
@@ -120,12 +120,12 @@
{
std::cout << "convert" << std::endl;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load<int_u8>("../img/lena.pgm"),
ref(lena.domain());
- image2d_b<float01_16> out(lena.domain());
- image2d_b<float01_16> tmp(lena.domain());
+ image2d<float01_16> out(lena.domain());
+ image2d<float01_16> tmp(lena.domain());
level::transform(lena, tofloat01(), tmp);
Index: tests/line_convolve.cc
--- tests/line_convolve.cc (revision 1276)
+++ tests/line_convolve.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::linear::line_convolve.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
@@ -50,11 +50,11 @@
border::thickness = 4;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
- image2d_b<float> tmp(lena.domain());
+ image2d<float> tmp(lena.domain());
float ws[] = { .11, .11, .11, .11, .11, .11, .11, .11, .11 };
linear::line_convolve(lena, ws, tmp);
Index: tests/level_paste.cc
--- tests/level_paste.cc (revision 1276)
+++ tests/level_paste.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::level::fill
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/level/fill.hh>
#include <mln/level/paste.hh>
@@ -43,13 +43,13 @@
using namespace mln;
box2d b(make::point2d(1,2), make::point2d(2,4));
- image2d_b<int> ima(b, 2);
+ image2d<int> ima(b, 2);
debug::iota(ima);
debug::println(ima);
box2d b2(make::point2d(-1,-2), make::point2d(3,6));
- image2d_b<int> ima2(b2, 0);
+ image2d<int> ima2(b2, 0);
debug::iota(ima2);
debug::println(ima2);
Index: tests/linear_gaussian.cc
--- tests/linear_gaussian.cc (revision 1276)
+++ tests/linear_gaussian.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::linear::gaussian.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_u_sat.hh>
@@ -47,12 +47,12 @@
{
using namespace mln;
- image2d_b< value::int_u8 > lena = io::pgm::load("../img/lena.pgm");
+ image2d< value::int_u8 > lena = io::pgm::load("../img/lena.pgm");
- image2d_b<float> tmp(lena.domain());
+ image2d<float> tmp(lena.domain());
linear::gaussian(lena, 5.1f, tmp);
- image2d_b< value::int_u_sat<8> > out(lena.domain());
+ image2d< value::int_u_sat<8> > out(lena.domain());
level::transform(tmp, math::round<int>(), out);
io::pgm::save(out, "out.pgm");
}
Index: tests/trait_images.cc
--- tests/trait_images.cc (revision 1276)
+++ tests/trait_images.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::trait::images.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/sub_image.hh>
#include <mln/core/image_if.hh>
@@ -41,16 +41,16 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
- std::cout << "image2d_b: ";
+ std::cout << "image2d: ";
mln::trait::image::print<I>(std::cout);
std::cout << std::endl
- << "sub_image< image2d_b >: ";
+ << "sub_image< image2d >: ";
mln::trait::image::print< sub_image<I, box2d> >(std::cout);
std::cout << std::endl
- << "image_if< image2d_b >: ";
+ << "image_if< image2d >: ";
mln::trait::image::print< image_if<I, fun::p2b::chess_t> >(std::cout);
}
Index: tests/level_assign.cc
--- tests/level_assign.cc (revision 1276)
+++ tests/level_assign.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::level::assign.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/level/assign.hh>
#include <mln/level/compare.hh>
#include <mln/debug/iota.hh>
@@ -41,7 +41,7 @@
using namespace mln;
const unsigned size = 1000;
- image2d_b<int> rhs(size, size), lhs(rhs.domain());
+ image2d<int> rhs(size, size), lhs(rhs.domain());
debug::iota(rhs);
level::assign(lhs, rhs);
mln_assertion(lhs = rhs);
Index: tests/level_memset_.cc
--- tests/level_memset_.cc (revision 1276)
+++ tests/level_memset_.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::level::memset_.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/geom/ncols.hh>
#include <mln/level/fill.hh>
#include <mln/level/memset_.hh>
@@ -40,7 +40,7 @@
{
using namespace mln;
- image2d_b<int> ima(3, 3);
+ image2d<int> ima(3, 3);
level::fill(ima, 0);
int X = 9;
level::memset_(ima, make::point2d(0,0),
Index: tests/io_pgm16.cc
--- tests/io_pgm16.cc (revision 1276)
+++ tests/io_pgm16.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::io::pbm::load.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/value/int_u8.hh>
@@ -75,17 +75,17 @@
win::rectangle2d rect(51, 51);
border::thickness = 52;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load<int_u8>("../img/lena.pgm");
- image2d_b<int_u16> out(lena.domain());
+ image2d<int_u16> out(lena.domain());
level::transform(lena, to16bits(), out);
io::pgm::save(out, "out16.pgm");
- image2d_b<int_u16>
+ image2d<int_u16>
lena2 = io::pgm::load<int_u16>("out16.pgm");
- image2d_b<int_u8> out2(lena.domain());
+ image2d<int_u8> out2(lena.domain());
level::transform(lena2, to8bits(), out2);
Index: tests/morpho_contrast.cc
--- tests/morpho_contrast.cc (revision 1276)
+++ tests/morpho_contrast.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::contrast.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
@@ -53,11 +53,11 @@
win::rectangle2d rect(5, 5);
border::thickness = 2;
- image2d_b<int_u8>
+ image2d<int_u8>
lena = io::pgm::load("../img/tiny.pgm"),
out(lena.domain());
- image2d_b< value::int_s<10> >
+ image2d< value::int_s<10> >
in(lena.domain()),
tmp(lena.domain());
@@ -70,7 +70,7 @@
{
// self-duality test:
morpho::complementation_inplace(in);
- image2d_b< value::int_s<10> > tmp_(lena.domain());
+ image2d< value::int_s<10> > tmp_(lena.domain());
morpho::contrast(in, rect, tmp_);
morpho::complementation_inplace(tmp_);
mln_assertion(tmp_ = tmp);
Index: tests/pw_value.cc
--- tests/pw_value.cc (revision 1276)
+++ tests/pw_value.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::fun::pw_value_.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/fun/ops.hh>
#include <mln/pw/value.hh>
#include <mln/pw/cst.hh>
@@ -40,7 +40,7 @@
{
using namespace mln;
- image2d_b<int> ima(3, 3);
+ image2d<int> ima(3, 3);
point2d p = make::point2d(1, 1);
ima(p) = 51;
mln_assertion( (pw::value(ima) = pw::cst(51))(p) = true );
Index: tests/canvas_browsing_fwd.cc
--- tests/canvas_browsing_fwd.cc (revision 1276)
+++ tests/canvas_browsing_fwd.cc (working copy)
@@ -30,8 +30,8 @@
* \brief Tests on mln::canvas::browsing::fwd.
*/
-#include <mln/core/image2d_b.hh>
-#include <mln/core/image3d_b.hh>
+#include <mln/core/image2d.hh>
+#include <mln/core/image3d.hh>
#include <mln/canvas/browsing/fwd.hh>
#include <mln/canvas/browsing/snake_fwd.hh>
#include <mln/canvas/browsing/directional.hh>
@@ -98,8 +98,8 @@
int main()
{
using namespace mln;
- image2d_b<unsigned> ima2(3, 3);
- image3d_b<unsigned> ima3(3, 3, 3);
+ image2d<unsigned> ima2(3, 3);
+ image3d<unsigned> ima3(3, 3, 3);
my_test(ima2, fun::p2v::iota, canvas::browsing::fwd);
debug::println(ima2);
Index: tests/color_pretty.cc
--- tests/color_pretty.cc (revision 1276)
+++ tests/color_pretty.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::sub_image.
*/
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/io/pbm/load.hh>
# include <mln/make/win_chamfer.hh>
# include <mln/geom/chamfer.hh>
@@ -50,7 +50,7 @@
unsigned max = 51;
- image2d_b<bool> input = io::pbm::load("../img/toto.pbm");
+ image2d<bool> input = io::pbm::load("../img/toto.pbm");
// Create a weighted windows :
// 0 2 0
@@ -59,10 +59,10 @@
const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 0> ();
// Call chamfer for a distance image.
- image2d_b<unsigned> tmp = geom::chamfer(input, w_win, max);
+ image2d<unsigned> tmp = geom::chamfer(input, w_win, max);
// Call color_pretty for sub_image.
- image2d_b<value::rgb8> out = display::color_pretty(inplace (tmp | 4));
+ image2d<value::rgb8> out = display::color_pretty(inplace (tmp | 4));
// Save output image from color in out.ppm.
io::ppm::save(out, "out.ppm");
Index: tests/hexa.cc
--- tests/hexa.cc (revision 1276)
+++ tests/hexa.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::hexa
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/hexa.hh>
#include <mln/value/int_u8.hh>
@@ -42,7 +42,7 @@
using namespace mln;
using value::int_u8;
- typedef image2d_b<int_u8> I;
+ typedef image2d<int_u8> I;
I ima(3,3);
hexa<I> h(ima);
Index: tests/tr_image.cc
--- tests/tr_image.cc (revision 1276)
+++ tests/tr_image.cc (working copy)
@@ -25,15 +25,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/image2d_b.cc
+/*! \file tests/image2d.cc
*
- * \brief Tests on mln::image2d_b.
+ * \brief Tests on mln::image2d.
*/
#include <iostream>
#include <mln/fun/x2x/rotation.hh>
-#include <mln/core/image3d_b.hh>
+#include <mln/core/image3d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/tr_image.hh>
#include <mln/debug/iota.hh>
@@ -44,21 +44,21 @@
using namespace mln;
using value::int_u8;
- image3d_b<int_u8> in(3, 3, 3);
- image3d_b<int_u8> out(in.domain());
+ image3d<int_u8> in(3, 3, 3);
+ image3d<int_u8> out(in.domain());
debug::iota(in);
debug::println(in);
fun::x2x::rotation<3,float> rot1(1.67, 0);
- tr_image<fun::x2x::rotation<3,float>, image3d_b<int_u8> > inter(in, rot1);
+ tr_image<fun::x2x::rotation<3,float>, image3d<int_u8> > inter(in, rot1);
- image3d_b<int_u8>::fwd_piter p(out.domain());
+ image3d<int_u8>::fwd_piter p(out.domain());
for_all(p)
{
- metal::vec<3,int> vec = (image3d_b<int_u8>::point)p;
+ metal::vec<3,int> vec = (image3d<int_u8>::point)p;
if (inter.has(vec))
out(p) = inter(vec);
else
Index: tests/morpho_dilation.cc
--- tests/morpho_dilation.cc (revision 1276)
+++ tests/morpho_dilation.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Test on mln::morpho::dilation.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/win/rectangle2d.hh>
#include <mln/core/win/octagon2d.hh>
#include <mln/core/win/diag2d.hh>
@@ -60,17 +60,17 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
// {
-// image2d_b<int_u8> out(lena.domain());
+// image2d<int_u8> out(lena.domain());
// morpho::dilation(lena, rec, out);
// io::pgm::save(out, "out1.pgm");
// }
{
win::octagon2d oct(31);
- image2d_b<int_u8> out(lena.domain());
+ image2d<int_u8> out(lena.domain());
morpho::dilation(lena, oct, out);
io::pgm::save(out, "out2.pgm");
}
@@ -79,19 +79,19 @@
// vec_p<point2d> vec = convert::to_vec_p(rec, point2d::zero);
// window2d win = convert::to_window(vec);
-// image2d_b<int_u8> out(lena.domain());
+// image2d<int_u8> out(lena.domain());
// level::ero(lena, win, out);
// morpho::dilation(lena, win, out);
// io::pgm::save(out, "out.pgm");
// }
// {
-// image2d_b<bool> bin(lena.domain()), out(lena.domain());
+// image2d<bool> bin(lena.domain()), out(lena.domain());
// level::fill(bin, pw::value(lena) > pw::cst(127));
// morpho::dilation(bin, rec, out);
-// image2d_b<int_u8> test(lena.domain());
-// image2d_b<int_u8>::fwd_piter p(lena.domain());
+// image2d<int_u8> test(lena.domain());
+// image2d<int_u8>::fwd_piter p(lena.domain());
// for_all(p)
// test(p) = out(p) ? 255 : 0;
// io::pgm::save(test, "test.pgm");
Index: tests/trait_ch_value.cc
--- tests/trait_ch_value.cc (revision 1276)
+++ tests/trait_ch_value.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::trait::ch_value.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/trait/ch_value.hh>
@@ -38,6 +38,6 @@
{
using namespace mln;
- typedef image2d_b<int> I;
+ typedef image2d<int> I;
trait::ch_value<I, bool>::ret ima;
}
Index: tests/line_piter.cc
--- tests/line_piter.cc (revision 1276)
+++ tests/line_piter.cc (working copy)
@@ -30,7 +30,7 @@
* \brief Tests on mln::line_piter.
*/
-#include <mln/core/image2d_b.hh>
+#include <mln/core/image2d.hh>
#include <mln/core/line_piter.hh>
int main()
@@ -39,9 +39,9 @@
box2d b(make::point2d(1,2), make::point2d(5,8));
const unsigned border = 2;
- image2d_b<int> f(b, border);
+ image2d<int> f(b, border);
- image2d_b<int>::line_piter p(f.domain());
+ image2d<int>::line_piter p(f.domain());
for_all(p)
std::cout << p <<std::endl;
}
Index: mln/trait/image_from_mesh.hh
--- mln/trait/image_from_mesh.hh (revision 1276)
+++ mln/trait/image_from_mesh.hh (working copy)
@@ -45,9 +45,9 @@
// Fwd decls.
- template <typename T> struct image1d_b;
- template <typename T> struct image2d_b;
- template <typename T> struct image3d_b;
+ template <typename T> struct image1d;
+ template <typename T> struct image2d;
+ template <typename T> struct image3d;
namespace trait
@@ -58,19 +58,19 @@
template <typename V>
struct image_from_mesh< grid::tick, V >
{
- typedef image1d_b<V> ret;
+ typedef image1d<V> ret;
};
template <typename V>
struct image_from_mesh< grid::square, V >
{
- typedef image2d_b<V> ret;
+ typedef image2d<V> ret;
};
template <typename V>
struct image_from_mesh< grid::cube, V >
{
- typedef image3d_b<V> ret;
+ typedef image3d<V> ret;
};
Index: mln/trait/images.hh
--- mln/trait/images.hh (revision 1276)
+++ mln/trait/images.hh (working copy)
@@ -83,9 +83,9 @@
{
// Primitive types.
- template <typename T> struct image1d_b;
- template <typename T> struct image2d_b;
- template <typename T> struct image3d_b;
+ template <typename T> struct image1d;
+ template <typename T> struct image2d;
+ template <typename T> struct image3d;
namespace pw { template <typename F, typename S> struct image; }
template <typename P, typename T> class rle_image;
template <typename P, typename T> class sparse_image;
Index: mln/core/pixter1d.hh
--- mln/core/pixter1d.hh (revision 1276)
+++ mln/core/pixter1d.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_PIXTER1D_B_HH
# define MLN_CORE_PIXTER1D_B_HH
-/*! \file mln/core/pixter1d_b.hh
+/*! \file mln/core/pixter1d.hh
*
* \brief Pixel iterator class on a image 1d with border.
*/
@@ -43,9 +43,9 @@
{
template <typename I>
- class fwd_pixter1d_b : public internal::pixel_iterator_base_< I, fwd_pixter1d_b<I> >
+ class fwd_pixter1d : public internal::pixel_iterator_base_< I, fwd_pixter1d<I> >
{
- typedef internal::pixel_iterator_base_< I, fwd_pixter1d_b<I> > super_;
+ typedef internal::pixel_iterator_base_< I, fwd_pixter1d<I> > super_;
public:
@@ -56,7 +56,7 @@
*
* \param[in] image Image to iterate over its pixels.
*/
- fwd_pixter1d_b(I& image);
+ fwd_pixter1d(I& image);
/// Go to the next pixel.
void next_();
@@ -64,13 +64,13 @@
};
- // FIXME: bkd_pixter1d_b
+ // FIXME: bkd_pixter1d
#ifndef MLN_INCLUDE_ONLY
template <typename I>
- fwd_pixter1d_b<I>::fwd_pixter1d_b(I& image) :
+ fwd_pixter1d<I>::fwd_pixter1d(I& image) :
super_(image)
{
mln_precondition(image.has_data());
@@ -78,7 +78,7 @@
template <typename I>
void
- fwd_pixter1d_b<I>::next_()
+ fwd_pixter1d<I>::next_()
{
++this->value_ptr_;
}
Index: mln/core/pixter2d.hh
--- mln/core/pixter2d.hh (revision 1276)
+++ mln/core/pixter2d.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_PIXTER2D_B_HH
# define MLN_CORE_PIXTER2D_B_HH
-/*! \file mln/core/pixter2d_b.hh
+/*! \file mln/core/pixter2d.hh
*
* \brief Pixel iterator class on a image 2d with border.
*/
@@ -43,9 +43,9 @@
{
template <typename I>
- class fwd_pixter2d_b : public internal::pixel_iterator_base_< I, fwd_pixter2d_b<I> >
+ class fwd_pixter2d : public internal::pixel_iterator_base_< I, fwd_pixter2d<I> >
{
- typedef internal::pixel_iterator_base_< I, fwd_pixter2d_b<I> > super_;
+ typedef internal::pixel_iterator_base_< I, fwd_pixter2d<I> > super_;
public:
@@ -56,7 +56,7 @@
*
* \param[in] image Image to iterate over its pixels.
*/
- fwd_pixter2d_b(I& image);
+ fwd_pixter2d(I& image);
/// Go to the next pixel.
void next_();
@@ -76,9 +76,9 @@
template <typename I>
- class bkd_pixter2d_b : public internal::pixel_iterator_base_< I, bkd_pixter2d_b<I> >
+ class bkd_pixter2d : public internal::pixel_iterator_base_< I, bkd_pixter2d<I> >
{
- typedef internal::pixel_iterator_base_< I, bkd_pixter2d_b<I> > super_;
+ typedef internal::pixel_iterator_base_< I, bkd_pixter2d<I> > super_;
public:
@@ -89,7 +89,7 @@
*
* \param[in] image Image to iterate over its pixels.
*/
- bkd_pixter2d_b(I& image);
+ bkd_pixter2d(I& image);
/// Go to the next pixel.
void next_();
@@ -116,7 +116,7 @@
// Fwd.
template <typename I>
- fwd_pixter2d_b<I>::fwd_pixter2d_b(I& image) :
+ fwd_pixter2d<I>::fwd_pixter2d(I& image) :
super_(image)
{
mln_precondition(image.has_data());
@@ -127,7 +127,7 @@
template <typename I>
void
- fwd_pixter2d_b<I>::next_()
+ fwd_pixter2d<I>::next_()
{
++this->value_ptr_;
if (this->value_ptr_ = eor_ && this->value_ptr_ != this->eoi_)
@@ -140,7 +140,7 @@
// Bkd.
template <typename I>
- bkd_pixter2d_b<I>::bkd_pixter2d_b(I& image) :
+ bkd_pixter2d<I>::bkd_pixter2d(I& image) :
super_(image)
{
mln_precondition(image.has_data());
@@ -151,7 +151,7 @@
template <typename I>
void
- bkd_pixter2d_b<I>::next_()
+ bkd_pixter2d<I>::next_()
{
--this->value_ptr_;
if (this->value_ptr_ = bor_ && this->value_ptr_ != this->boi_)
@@ -163,7 +163,7 @@
template <typename I>
void
- bkd_pixter2d_b<I>::start()
+ bkd_pixter2d<I>::start()
{
this->value_ptr_ = this->eoi_ - 1;
}
Index: mln/core/pixter3d.hh
--- mln/core/pixter3d.hh (revision 1276)
+++ mln/core/pixter3d.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_PIXTER3D_B_HH
# define MLN_CORE_PIXTER3D_B_HH
-/*! \file mln/core/pixter3d_b.hh
+/*! \file mln/core/pixter3d.hh
*
* \brief Pixel iterator class on a image 3d with border.
*/
@@ -43,9 +43,9 @@
{
template <typename I>
- class fwd_pixter3d_b : public internal::pixel_iterator_base_< I, fwd_pixter3d_b<I> >
+ class fwd_pixter3d : public internal::pixel_iterator_base_< I, fwd_pixter3d<I> >
{
- typedef internal::pixel_iterator_base_< I, fwd_pixter3d_b<I> > super_;
+ typedef internal::pixel_iterator_base_< I, fwd_pixter3d<I> > super_;
public:
@@ -56,7 +56,7 @@
*
* \param[in] image Image to iterate over its pixels.
*/
- fwd_pixter3d_b(I& image);
+ fwd_pixter3d(I& image);
/// Go to the next pixel.
void next_();
@@ -86,13 +86,13 @@
};
- // FIXME: bkd_pixter3d_b
+ // FIXME: bkd_pixter3d
#ifndef MLN_INCLUDE_ONLY
template <typename I>
- fwd_pixter3d_b<I>::fwd_pixter3d_b(I& image) :
+ fwd_pixter3d<I>::fwd_pixter3d(I& image) :
super_(image)
{
mln_precondition(image.has_data());
@@ -107,7 +107,7 @@
template <typename I>
void
- fwd_pixter3d_b<I>::next_()
+ fwd_pixter3d<I>::next_()
{
++this->value_ptr_;
if (this->value_ptr_ = eor_ && this->value_ptr_ != this->eoi_)
Index: mln/core/image1d.hh
--- mln/core/image1d.hh (revision 1276)
+++ mln/core/image1d.hh (working copy)
@@ -28,9 +28,9 @@
#ifndef MLN_CORE_IMAGE1D_B_HH
# define MLN_CORE_IMAGE1D_B_HH
-/*! \file mln/core/image1d_b.hh
+/*! \file mln/core/image1d.hh
*
- * \brief Definition of the basic mln::image1d_b class.
+ * \brief Definition of the basic mln::image1d class.
*/
# include <mln/core/internal/fixme.hh>
@@ -45,7 +45,7 @@
// FIXME:
-// # include <mln/core/pixter1d_b.hh>
+// # include <mln/core/pixter1d.hh>
// # include <mln/core/dpoints_pixter.hh>
@@ -53,15 +53,15 @@
{
// Fwd decl.
- template <typename T> struct image1d_b;
+ template <typename T> struct image1d;
namespace internal
{
- /// Data structure for mln::image1d_b<T>.
+ /// Data structure for mln::image1d<T>.
template <typename T>
- struct data_< image1d_b<T> >
+ struct data_< image1d<T> >
{
data_(const box1d& b, unsigned bdr);
~data_();
@@ -86,7 +86,7 @@
{
template <typename T>
- struct image_< image1d_b<T> > : default_image_< T, image1d_b<T> >
+ struct image_< image1d<T> > : default_image_< T, image1d<T> >
{
typedef trait::image::category::primary category;
@@ -112,7 +112,7 @@
* thickness before and after data.
*/
template <typename T>
- struct image1d_b : public internal::image_primary_< box1d, image1d_b<T> >
+ struct image1d : public internal::image_primary_< box1d, image1d<T> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box1d pset;
@@ -136,7 +136,7 @@
/// Skeleton.
- typedef image1d_b< tag::value_<T> > skeleton;
+ typedef image1d< tag::value_<T> > skeleton;
/// Value_Set associated type.
@@ -144,14 +144,14 @@
/// Constructor without argument.
- image1d_b();
+ image1d();
/// Constructor with the number of indices and the border
/// thickness.
- image1d_b(unsigned ninds, unsigned bdr = border::thickness);
+ image1d(unsigned ninds, unsigned bdr = border::thickness);
/// Constructor with a box and the border thickness.
- image1d_b(const box1d& b, unsigned bdr = border::thickness);
+ image1d(const box1d& b, unsigned bdr = border::thickness);
/// Initialize an empty image.
@@ -208,19 +208,19 @@
};
template <typename T, typename J>
- void init_(tag::image_t, mln::image1d_b<T>& target, const J& model);
+ void init_(tag::image_t, mln::image1d<T>& target, const J& model);
# ifndef MLN_INCLUDE_ONLY
// init_
template <typename T>
- void init_(tag::border_t, unsigned& b, const image1d_b<T>& model)
+ void init_(tag::border_t, unsigned& b, const image1d<T>& model)
{
b = model.border();
}
template <typename T, typename J>
- void init_(tag::image_t, image1d_b<T>& target, const J& model)
+ void init_(tag::image_t, image1d<T>& target, const J& model)
{
box1d b;
init_(tag::bbox, b, model);
@@ -229,13 +229,13 @@
target.init_(b, bdr);
}
- // internal::data_< image1d_b<T> >
+ // internal::data_< image1d<T> >
namespace internal
{
template <typename T>
- data_< image1d_b<T> >::data_(const box1d& b, unsigned bdr)
+ data_< image1d<T> >::data_(const box1d& b, unsigned bdr)
: buffer_(0),
array_ (0),
b_ (b),
@@ -245,14 +245,14 @@
}
template <typename T>
- data_< image1d_b<T> >::~data_()
+ data_< image1d<T> >::~data_()
{
deallocate_();
}
template <typename T>
void
- data_< image1d_b<T> >::update_vb_()
+ data_< image1d<T> >::update_vb_()
{
vb_.pmin() = b_.pmin() - dpoint1d(all(bdr_));
vb_.pmax() = b_.pmax() + dpoint1d(all(bdr_));
@@ -260,7 +260,7 @@
template <typename T>
void
- data_< image1d_b<T> >::allocate_()
+ data_< image1d<T> >::allocate_()
{
update_vb_();
unsigned
@@ -272,7 +272,7 @@
template <typename T>
void
- data_< image1d_b<T> >::deallocate_()
+ data_< image1d<T> >::deallocate_()
{
if (buffer_)
{
@@ -284,21 +284,21 @@
} // end of namespace mln::internal
- // image1d_b<T>
+ // image1d<T>
template <typename T>
- image1d_b<T>::image1d_b()
+ image1d<T>::image1d()
{
}
template <typename T>
- image1d_b<T>::image1d_b(const box1d& b, unsigned bdr)
+ image1d<T>::image1d(const box1d& b, unsigned bdr)
{
init_(b, bdr);
}
template <typename T>
- image1d_b<T>::image1d_b(unsigned ninds, unsigned bdr)
+ image1d<T>::image1d(unsigned ninds, unsigned bdr)
{
mln_precondition(ninds != 0);
init_(make::box1d(ninds), bdr);
@@ -306,22 +306,22 @@
template <typename T>
void
- image1d_b<T>::init_(const box1d& b, unsigned bdr)
+ image1d<T>::init_(const box1d& b, unsigned bdr)
{
mln_precondition(! this->has_data());
- this->data_ = new internal::data_< image1d_b<T> >(b, bdr);
+ this->data_ = new internal::data_< image1d<T> >(b, bdr);
}
template <typename T>
- const typename image1d_b<T>::vset&
- image1d_b<T>::values() const
+ const typename image1d<T>::vset&
+ image1d<T>::values() const
{
return vset::the();
}
template <typename T>
const box1d&
- image1d_b<T>::domain() const
+ image1d<T>::domain() const
{
mln_precondition(this->has_data());
return this->data_->b_;
@@ -329,7 +329,7 @@
template <typename T>
unsigned
- image1d_b<T>::border() const
+ image1d<T>::border() const
{
mln_precondition(this->has_data());
return this->data_->bdr_;
@@ -337,7 +337,7 @@
template <typename T>
std::size_t
- image1d_b<T>::ncells() const
+ image1d<T>::ncells() const
{
mln_precondition(this->has_data());
return this->data_->vb_.npoints();
@@ -345,7 +345,7 @@
template <typename T>
bool
- image1d_b<T>::owns_(const point1d& p) const
+ image1d<T>::owns_(const point1d& p) const
{
mln_precondition(this->has_data());
return this->data_->vb_.has(p);
@@ -353,7 +353,7 @@
template <typename T>
const T&
- image1d_b<T>::operator()(const point1d& p) const
+ image1d<T>::operator()(const point1d& p) const
{
mln_precondition(this->owns_(p));
return this->data_->array_[p.ind()];
@@ -361,7 +361,7 @@
template <typename T>
T&
- image1d_b<T>::operator()(const point1d& p)
+ image1d<T>::operator()(const point1d& p)
{
mln_precondition(this->owns_(p));
return this->data_->array_[p.ind()];
@@ -369,7 +369,7 @@
template <typename T>
const T&
- image1d_b<T>::operator[](unsigned o) const
+ image1d<T>::operator[](unsigned o) const
{
mln_precondition(o < ncells());
return *(this->data_->buffer_ + o);
@@ -377,7 +377,7 @@
template <typename T>
T&
- image1d_b<T>::operator[](unsigned o)
+ image1d<T>::operator[](unsigned o)
{
mln_precondition(o < ncells());
return *(this->data_->buffer_ + o);
@@ -385,7 +385,7 @@
template <typename T>
const T&
- image1d_b<T>::at(int ind) const
+ image1d<T>::at(int ind) const
{
mln_precondition(this->owns_(make::point1d(ind)));
return this->data_->array_[ind];
@@ -393,7 +393,7 @@
template <typename T>
T&
- image1d_b<T>::at(int ind)
+ image1d<T>::at(int ind)
{
mln_precondition(this->owns_(make::point1d(ind)));
return this->data_->array_[ind];
@@ -401,7 +401,7 @@
template <typename T>
const T*
- image1d_b<T>::buffer() const
+ image1d<T>::buffer() const
{
mln_precondition(this->has_data());
return this->data_->buffer_;
@@ -409,7 +409,7 @@
template <typename T>
T*
- image1d_b<T>::buffer()
+ image1d<T>::buffer()
{
mln_precondition(this->has_data());
return this->data_->buffer_;
@@ -417,7 +417,7 @@
template <typename T>
int
- image1d_b<T>::offset(const dpoint1d& dp) const
+ image1d<T>::offset(const dpoint1d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0];
@@ -426,7 +426,7 @@
template <typename T>
point1d
- image1d_b<T>::point_at_offset(unsigned o) const
+ image1d<T>::point_at_offset(unsigned o) const
{
mln_precondition(o < ncells());
point1d p = make::point1d(o + this->data_->vb_.min_ind());
@@ -442,7 +442,7 @@
# include <mln/core/trait/pixter.hh>
# include <mln/core/dpoints_pixter.hh>
-# include <mln/core/pixter1d_b.hh>
+# include <mln/core/pixter1d.hh>
# include <mln/core/w_window.hh>
@@ -455,19 +455,19 @@
// pixter
template <typename T>
- struct fwd_pixter< image1d_b<T> >
+ struct fwd_pixter< image1d<T> >
{
- typedef fwd_pixter1d_b< image1d_b<T> > ret;
+ typedef fwd_pixter1d< image1d<T> > ret;
};
template <typename T>
- struct fwd_pixter< const image1d_b<T> >
+ struct fwd_pixter< const image1d<T> >
{
- typedef fwd_pixter1d_b< const image1d_b<T> > ret;
+ typedef fwd_pixter1d< const image1d<T> > ret;
};
template <typename T>
- struct bkd_pixter< image1d_b<T> >
+ struct bkd_pixter< image1d<T> >
{
typedef mln::internal::fixme ret;
};
@@ -475,19 +475,19 @@
// qixter
template <typename T, typename W>
- struct fwd_qixter< image1d_b<T>, W >
+ struct fwd_qixter< image1d<T>, W >
{
- typedef dpoints_fwd_pixter< image1d_b<T> > ret;
+ typedef dpoints_fwd_pixter< image1d<T> > ret;
};
template <typename T, typename W>
- struct fwd_qixter< const image1d_b<T>, W >
+ struct fwd_qixter< const image1d<T>, W >
{
- typedef dpoints_fwd_pixter< const image1d_b<T> > ret;
+ typedef dpoints_fwd_pixter< const image1d<T> > ret;
};
template <typename T, typename W>
- struct bkd_qixter< image1d_b<T>, W >
+ struct bkd_qixter< image1d<T>, W >
{
typedef mln::internal::fixme ret;
};
Index: mln/core/image2d.hh
--- mln/core/image2d.hh (revision 1276)
+++ mln/core/image2d.hh (working copy)
@@ -28,9 +28,9 @@
#ifndef MLN_CORE_IMAGE2D_B_HH
# define MLN_CORE_IMAGE2D_B_HH
-/*! \file mln/core/image2d_b.hh
+/*! \file mln/core/image2d.hh
*
- * \brief Definition of the basic mln::image2d_b class.
+ * \brief Definition of the basic mln::image2d class.
*/
# include <mln/core/internal/image_primary.hh>
@@ -45,7 +45,7 @@
// FIXME:
-// # include <mln/core/pixter2d_b.hh>
+// # include <mln/core/pixter2d.hh>
// # include <mln/core/dpoints_pixter.hh>
@@ -53,7 +53,7 @@
{
// Fwd decl.
- template <typename T> struct image2d_b;
+ template <typename T> struct image2d;
@@ -61,7 +61,7 @@
{
template <typename T>
- struct data_< image2d_b<T> >
+ struct data_< image2d<T> >
{
data_(const box2d& b, unsigned bdr);
~data_();
@@ -85,7 +85,7 @@
{
template <typename T>
- struct image_< image2d_b<T> > : default_image_< T, image2d_b<T> >
+ struct image_< image2d<T> > : default_image_< T, image2d<T> >
{
typedef trait::image::category::primary category;
@@ -111,7 +111,7 @@
* thickness around data.
*/
template <typename T>
- struct image2d_b : public internal::image_primary_< box2d, image2d_b<T> >
+ struct image2d : public internal::image_primary_< box2d, image2d<T> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box2d pset;
@@ -135,7 +135,7 @@
/// Skeleton.
- typedef image2d_b< tag::value_<T> > skeleton;
+ typedef image2d< tag::value_<T> > skeleton;
/// Value_Set associated type.
@@ -143,15 +143,15 @@
/// Constructor without argument.
- image2d_b();
+ image2d();
/// Constructor with the numbers of rows and columns and the
/// border thickness.
- image2d_b(int nrows, int ncols, unsigned bdr = border::thickness);
+ image2d(int nrows, int ncols, unsigned bdr = border::thickness);
/// Constructor with a box and the border thickness (default is
/// 3).
- image2d_b(const box2d& b, unsigned bdr = border::thickness);
+ image2d(const box2d& b, unsigned bdr = border::thickness);
/// Initialize an empty image.
@@ -212,10 +212,10 @@
// Fwd decl.
template <typename T>
- void init_(tag::border_t, unsigned& bdr, const image2d_b<T>& model);
+ void init_(tag::border_t, unsigned& bdr, const image2d<T>& model);
template <typename T, typename J>
- void init_(tag::image_t, mln::image2d_b<T>& target, const J& model);
+ void init_(tag::image_t, mln::image2d<T>& target, const J& model);
@@ -224,13 +224,13 @@
// init_
template <typename T>
- void init_(tag::border_t, unsigned& bdr, const image2d_b<T>& model)
+ void init_(tag::border_t, unsigned& bdr, const image2d<T>& model)
{
bdr = model.border();
}
template <typename T, typename J>
- void init_(tag::image_t, image2d_b<T>& target, const J& model)
+ void init_(tag::image_t, image2d<T>& target, const J& model)
{
box2d b;
init_(tag::bbox, b, model);
@@ -240,13 +240,13 @@
}
- // internal::data_< image2d_b<T> >
+ // internal::data_< image2d<T> >
namespace internal
{
template <typename T>
- data_< image2d_b<T> >::data_(const box2d& b, unsigned bdr)
+ data_< image2d<T> >::data_(const box2d& b, unsigned bdr)
: buffer_(0),
array_ (0),
b_ (b),
@@ -256,14 +256,14 @@
}
template <typename T>
- data_< image2d_b<T> >::~data_()
+ data_< image2d<T> >::~data_()
{
deallocate_();
}
template <typename T>
void
- data_< image2d_b<T> >::update_vb_()
+ data_< image2d<T> >::update_vb_()
{
vb_.pmin() = b_.pmin() - dpoint2d(all(bdr_));
vb_.pmax() = b_.pmax() + dpoint2d(all(bdr_));
@@ -271,7 +271,7 @@
template <typename T>
void
- data_< image2d_b<T> >::allocate_()
+ data_< image2d<T> >::allocate_()
{
update_vb_();
unsigned
@@ -292,7 +292,7 @@
template <typename T>
void
- data_< image2d_b<T> >::deallocate_()
+ data_< image2d<T> >::deallocate_()
{
if (buffer_)
{
@@ -310,43 +310,43 @@
} // end of namespace mln::internal
- // image2d_b<T>
+ // image2d<T>
template <typename T>
- image2d_b<T>::image2d_b()
+ image2d<T>::image2d()
{
}
template <typename T>
- image2d_b<T>::image2d_b(int nrows, int ncols, unsigned bdr)
+ image2d<T>::image2d(int nrows, int ncols, unsigned bdr)
{
init_(make::box2d(nrows, ncols), bdr);
}
template <typename T>
- image2d_b<T>::image2d_b(const box2d& b, unsigned bdr)
+ image2d<T>::image2d(const box2d& b, unsigned bdr)
{
init_(b, bdr);
}
template <typename T>
void
- image2d_b<T>::init_(const box2d& b, unsigned bdr)
+ image2d<T>::init_(const box2d& b, unsigned bdr)
{
mln_precondition(! this->has_data());
- this->data_ = new internal::data_< image2d_b<T> >(b, bdr);
+ this->data_ = new internal::data_< image2d<T> >(b, bdr);
}
template <typename T>
- const typename image2d_b<T>::vset&
- image2d_b<T>::values() const
+ const typename image2d<T>::vset&
+ image2d<T>::values() const
{
return vset::the();
}
template <typename T>
const box2d&
- image2d_b<T>::domain() const
+ image2d<T>::domain() const
{
mln_precondition(this->has_data());
return this->data_->b_;
@@ -354,7 +354,7 @@
template <typename T>
unsigned
- image2d_b<T>::border() const
+ image2d<T>::border() const
{
mln_precondition(this->has_data());
return this->data_->bdr_;
@@ -362,7 +362,7 @@
template <typename T>
std::size_t
- image2d_b<T>::ncells() const
+ image2d<T>::ncells() const
{
mln_precondition(this->has_data());
return this->data_->vb_.npoints();
@@ -370,7 +370,7 @@
template <typename T>
bool
- image2d_b<T>::owns_(const point2d& p) const
+ image2d<T>::owns_(const point2d& p) const
{
mln_precondition(this->has_data());
return this->data_->vb_.has(p);
@@ -378,7 +378,7 @@
template <typename T>
const T&
- image2d_b<T>::operator()(const point2d& p) const
+ image2d<T>::operator()(const point2d& p) const
{
mln_precondition(this->owns_(p));
return this->data_->array_[p.row()][p.col()];
@@ -386,7 +386,7 @@
template <typename T>
T&
- image2d_b<T>::operator()(const point2d& p)
+ image2d<T>::operator()(const point2d& p)
{
mln_precondition(this->owns_(p));
return this->data_->array_[p.row()][p.col()];
@@ -394,7 +394,7 @@
template <typename T>
const T&
- image2d_b<T>::operator[](unsigned o) const
+ image2d<T>::operator[](unsigned o) const
{
mln_precondition(o < ncells());
return *(this->data_->buffer_ + o);
@@ -402,7 +402,7 @@
template <typename T>
T&
- image2d_b<T>::operator[](unsigned o)
+ image2d<T>::operator[](unsigned o)
{
mln_precondition(o < ncells());
return *(this->data_->buffer_ + o);
@@ -410,7 +410,7 @@
template <typename T>
const T&
- image2d_b<T>::at(int row, int col) const
+ image2d<T>::at(int row, int col) const
{
mln_precondition(this->owns_(make::point2d(row, col)));
return this->data_->array_[row][col];
@@ -418,7 +418,7 @@
template <typename T>
T&
- image2d_b<T>::at(int row, int col)
+ image2d<T>::at(int row, int col)
{
mln_precondition(this->owns_(make::point2d(row, col)));
return this->data_->array_[row][col];
@@ -426,7 +426,7 @@
template <typename T>
const T*
- image2d_b<T>::buffer() const
+ image2d<T>::buffer() const
{
mln_precondition(this->has_data());
return this->data_->buffer_;
@@ -434,7 +434,7 @@
template <typename T>
T*
- image2d_b<T>::buffer()
+ image2d<T>::buffer()
{
mln_precondition(this->has_data());
return this->data_->buffer_;
@@ -442,7 +442,7 @@
template <typename T>
int
- image2d_b<T>::offset(const dpoint2d& dp) const
+ image2d<T>::offset(const dpoint2d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0] * this->data_->vb_.len(1) + dp[1];
@@ -451,7 +451,7 @@
template <typename T>
point2d
- image2d_b<T>::point_at_offset(unsigned o) const
+ image2d<T>::point_at_offset(unsigned o) const
{
mln_precondition(o < ncells());
point2d p = make::point2d(o / this->data_->vb_.len(1) + this->data_->vb_.min_row(),
@@ -468,7 +468,7 @@
# include <mln/core/trait/pixter.hh>
# include <mln/core/dpoints_pixter.hh>
-# include <mln/core/pixter2d_b.hh>
+# include <mln/core/pixter2d.hh>
# include <mln/core/w_window.hh>
@@ -481,45 +481,45 @@
// pixter
template <typename T>
- struct fwd_pixter< image2d_b<T> >
+ struct fwd_pixter< image2d<T> >
{
- typedef fwd_pixter2d_b< image2d_b<T> > ret;
+ typedef fwd_pixter2d< image2d<T> > ret;
};
template <typename T>
- struct fwd_pixter< const image2d_b<T> >
+ struct fwd_pixter< const image2d<T> >
{
- typedef fwd_pixter2d_b< const image2d_b<T> > ret;
+ typedef fwd_pixter2d< const image2d<T> > ret;
};
template <typename T>
- struct bkd_pixter< image2d_b<T> >
+ struct bkd_pixter< image2d<T> >
{
- typedef bkd_pixter2d_b< image2d_b<T> > ret;
+ typedef bkd_pixter2d< image2d<T> > ret;
};
template <typename T>
- struct bkd_pixter< const image2d_b<T> >
+ struct bkd_pixter< const image2d<T> >
{
- typedef bkd_pixter2d_b< const image2d_b<T> > ret;
+ typedef bkd_pixter2d< const image2d<T> > ret;
};
// qixter
template <typename T, typename W>
- struct fwd_qixter< image2d_b<T>, W >
+ struct fwd_qixter< image2d<T>, W >
{
- typedef dpoints_fwd_pixter< image2d_b<T> > ret;
+ typedef dpoints_fwd_pixter< image2d<T> > ret;
};
template <typename T, typename W>
- struct fwd_qixter< const image2d_b<T>, W >
+ struct fwd_qixter< const image2d<T>, W >
{
- typedef dpoints_fwd_pixter< const image2d_b<T> > ret;
+ typedef dpoints_fwd_pixter< const image2d<T> > ret;
};
template <typename T, typename W>
- struct bkd_qixter< image2d_b<T>, W >
+ struct bkd_qixter< image2d<T>, W >
{
typedef mln::internal::fixme ret;
};
@@ -527,19 +527,19 @@
// nixter
template <typename T, typename N>
- struct fwd_nixter< image2d_b<T>, N >
+ struct fwd_nixter< image2d<T>, N >
{
- typedef dpoints_fwd_pixter< image2d_b<T> > ret;
+ typedef dpoints_fwd_pixter< image2d<T> > ret;
};
template <typename T, typename N>
- struct fwd_nixter< const image2d_b<T>, N >
+ struct fwd_nixter< const image2d<T>, N >
{
- typedef dpoints_fwd_pixter< const image2d_b<T> > ret;
+ typedef dpoints_fwd_pixter< const image2d<T> > ret;
};
template <typename T, typename N>
- struct bkd_nixter< image2d_b<T>, N >
+ struct bkd_nixter< image2d<T>, N >
{
typedef mln::internal::fixme ret;
};
Index: mln/core/image3d.hh
--- mln/core/image3d.hh (revision 1276)
+++ mln/core/image3d.hh (working copy)
@@ -28,9 +28,9 @@
#ifndef MLN_CORE_IMAGE3D_B_HH
# define MLN_CORE_IMAGE3D_B_HH
-/*! \file mln/core/image3d_b.hh
+/*! \file mln/core/image3d.hh
*
- * \brief Definition of the basic mln::image3d_b class.
+ * \brief Definition of the basic mln::image3d class.
*/
# include <mln/core/internal/fixme.hh>
@@ -45,7 +45,7 @@
// FIXME:
-// # include <mln/core/pixter3d_b.hh>
+// # include <mln/core/pixter3d.hh>
// # include <mln/core/dpoints_pixter.hh>
@@ -53,7 +53,7 @@
{
// Fwd decl.
- template <typename T> struct image3d_b;
+ template <typename T> struct image3d;
@@ -61,7 +61,7 @@
{
template <typename T>
- struct data_< image3d_b<T> >
+ struct data_< image3d<T> >
{
data_(const box3d& b, unsigned bdr);
~data_();
@@ -87,7 +87,7 @@
{
template <typename T>
- struct image_< image3d_b<T> > : default_image_< T, image3d_b<T> >
+ struct image_< image3d<T> > : default_image_< T, image3d<T> >
{
typedef trait::image::category::primary category;
@@ -113,7 +113,7 @@
* thickness around data.
*/
template <typename T>
- struct image3d_b : public internal::image_primary_< box3d, image3d_b<T> >
+ struct image3d : public internal::image_primary_< box3d, image3d<T> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box3d pset;
@@ -127,7 +127,7 @@
/// Super type
- typedef internal::image_primary_< box3d, image3d_b<T> > super_;
+ typedef internal::image_primary_< box3d, image3d<T> > super_;
/// Value associated type.
typedef T value;
@@ -140,7 +140,7 @@
/// Skeleton.
- typedef image3d_b< tag::value_<T> > skeleton;
+ typedef image3d< tag::value_<T> > skeleton;
/// Value_Set associated type.
@@ -148,15 +148,15 @@
/// Constructor without argument.
- image3d_b();
+ image3d();
/// Constructor with a box and the border thickness (default is
/// 3).
- image3d_b(const box3d& b, unsigned bdr = border::thickness);
+ image3d(const box3d& b, unsigned bdr = border::thickness);
/// Constructor with the numbers of indexes and the
/// border thickness.
- image3d_b(int nslis, int nrows, int ncols, unsigned bdr = border::thickness);
+ image3d(int nslis, int nrows, int ncols, unsigned bdr = border::thickness);
/// Initialize an empty image.
@@ -216,7 +216,7 @@
};
template <typename T, typename J>
- void init_(tag::image_t, mln::image3d_b<T>& target, const J& model);
+ void init_(tag::image_t, mln::image3d<T>& target, const J& model);
@@ -225,13 +225,13 @@
// init_
template <typename T>
- void init_(tag::border_t, unsigned& b, const image3d_b<T>& model)
+ void init_(tag::border_t, unsigned& b, const image3d<T>& model)
{
b = model.border();
}
template <typename T, typename J>
- void init_(tag::image_t, image3d_b<T>& target, const J& model)
+ void init_(tag::image_t, image3d<T>& target, const J& model)
{
box3d b;
init_(tag::bbox, b, model);
@@ -241,13 +241,13 @@
}
- // internal::data_< image3d_b<T> >
+ // internal::data_< image3d<T> >
namespace internal
{
template <typename T>
- data_< image3d_b<T> >::data_(const box3d& b, unsigned bdr)
+ data_< image3d<T> >::data_(const box3d& b, unsigned bdr)
: buffer_(0),
array_ (0),
b_ (b),
@@ -257,14 +257,14 @@
}
template <typename T>
- data_< image3d_b<T> >::~data_()
+ data_< image3d<T> >::~data_()
{
deallocate_();
}
template <typename T>
void
- data_< image3d_b<T> >::update_vb_()
+ data_< image3d<T> >::update_vb_()
{
vb_.pmin() = b_.pmin() - dpoint3d(all(bdr_));
vb_.pmax() = b_.pmax() + dpoint3d(all(bdr_));
@@ -272,7 +272,7 @@
template <typename T>
void
- data_< image3d_b<T> >::allocate_()
+ data_< image3d<T> >::allocate_()
{
update_vb_();
unsigned
@@ -299,7 +299,7 @@
template <typename T>
void
- data_< image3d_b<T> >::deallocate_()
+ data_< image3d<T> >::deallocate_()
{
if (buffer_)
{
@@ -325,43 +325,43 @@
} // end of namespace mln::internal
- // image3d_b<T>
+ // image3d<T>
template <typename T>
- image3d_b<T>::image3d_b()
+ image3d<T>::image3d()
{
}
template <typename T>
- image3d_b<T>::image3d_b(const box3d& b, unsigned bdr)
+ image3d<T>::image3d(const box3d& b, unsigned bdr)
{
init_(b, bdr);
}
template <typename T>
- image3d_b<T>::image3d_b(int nslis, int nrows, int ncols, unsigned bdr)
+ image3d<T>::image3d(int nslis, int nrows, int ncols, unsigned bdr)
{
init_(make::box3d(nslis, nrows, ncols), bdr);
}
template <typename T>
void
- image3d_b<T>::init_(const box3d& b, unsigned bdr)
+ image3d<T>::init_(const box3d& b, unsigned bdr)
{
mln_precondition(! this->has_data());
- this->data_ = new internal::data_< image3d_b<T> >(b, bdr);
+ this->data_ = new internal::data_< image3d<T> >(b, bdr);
}
template <typename T>
- const typename image3d_b<T>::vset&
- image3d_b<T>::values() const
+ const typename image3d<T>::vset&
+ image3d<T>::values() const
{
return vset::the();
}
template <typename T>
const box3d&
- image3d_b<T>::domain() const
+ image3d<T>::domain() const
{
mln_precondition(this->has_data());
return data_->b_;
@@ -369,7 +369,7 @@
template <typename T>
unsigned
- image3d_b<T>::border() const
+ image3d<T>::border() const
{
mln_precondition(this->has_data());
return data_->bdr_;
@@ -377,7 +377,7 @@
template <typename T>
std::size_t
- image3d_b<T>::ncells() const
+ image3d<T>::ncells() const
{
mln_precondition(this->has_data());
return data_->vb_.npoints();
@@ -385,7 +385,7 @@
template <typename T>
bool
- image3d_b<T>::owns_(const point3d& p) const
+ image3d<T>::owns_(const point3d& p) const
{
mln_precondition(this->has_data());
return data_->vb_.has(p);
@@ -393,7 +393,7 @@
template <typename T>
const T&
- image3d_b<T>::operator()(const point3d& p) const
+ image3d<T>::operator()(const point3d& p) const
{
mln_precondition(this->owns_(p));
return data_->array_[p.sli()][p.row()][p.col()];
@@ -401,7 +401,7 @@
template <typename T>
T&
- image3d_b<T>::operator()(const point3d& p)
+ image3d<T>::operator()(const point3d& p)
{
mln_precondition(this->owns_(p));
return data_->array_[p.sli()][p.row()][p.col()];
@@ -409,7 +409,7 @@
template <typename T>
const T&
- image3d_b<T>::operator[](unsigned o) const
+ image3d<T>::operator[](unsigned o) const
{
mln_precondition(o < ncells());
return *(data_->buffer_ + o);
@@ -417,7 +417,7 @@
template <typename T>
T&
- image3d_b<T>::operator[](unsigned o)
+ image3d<T>::operator[](unsigned o)
{
mln_precondition(o < ncells());
return *(data_->buffer_ + o);
@@ -425,7 +425,7 @@
template <typename T>
const T&
- image3d_b<T>::at(int sli, int row, int col) const
+ image3d<T>::at(int sli, int row, int col) const
{
mln_precondition(this->owns_(make::point3d(sli, row, col)));
return data_->array_[sli][row][col];
@@ -433,7 +433,7 @@
template <typename T>
T&
- image3d_b<T>::at(int sli, int row, int col)
+ image3d<T>::at(int sli, int row, int col)
{
mln_precondition(this->owns_(make::point3d(sli, row, col)));
return data_->array_[sli][row][col];
@@ -441,7 +441,7 @@
template <typename T>
const T*
- image3d_b<T>::buffer() const
+ image3d<T>::buffer() const
{
mln_precondition(this->has_data());
return data_->buffer_;
@@ -449,7 +449,7 @@
template <typename T>
T*
- image3d_b<T>::buffer()
+ image3d<T>::buffer()
{
mln_precondition(this->has_data());
return data_->buffer_;
@@ -457,7 +457,7 @@
template <typename T>
int
- image3d_b<T>::offset(const dpoint3d& dp) const
+ image3d<T>::offset(const dpoint3d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0];
@@ -466,7 +466,7 @@
template <typename T>
point3d
- image3d_b<T>::point_at_offset(unsigned o) const
+ image3d<T>::point_at_offset(unsigned o) const
{
mln_precondition(o < ncells());
point3d p = make::point3d(o / (data_->vb_.len(1) * data_->vb_.len(2)) + data_->vb_.min_sli(),
@@ -484,7 +484,7 @@
# include <mln/core/trait/pixter.hh>
# include <mln/core/dpoints_pixter.hh>
-# include <mln/core/pixter3d_b.hh>
+# include <mln/core/pixter3d.hh>
# include <mln/core/w_window.hh>
@@ -497,19 +497,19 @@
// pixter
template <typename T>
- struct fwd_pixter< image3d_b<T> >
+ struct fwd_pixter< image3d<T> >
{
- typedef fwd_pixter3d_b< image3d_b<T> > ret;
+ typedef fwd_pixter3d< image3d<T> > ret;
};
template <typename T>
- struct fwd_pixter< const image3d_b<T> >
+ struct fwd_pixter< const image3d<T> >
{
- typedef fwd_pixter3d_b< const image3d_b<T> > ret;
+ typedef fwd_pixter3d< const image3d<T> > ret;
};
template <typename T>
- struct bkd_pixter< image3d_b<T> >
+ struct bkd_pixter< image3d<T> >
{
typedef mln::internal::fixme ret;
};
@@ -517,19 +517,19 @@
// qixter
template <typename T, typename W>
- struct fwd_qixter< image3d_b<T>, W >
+ struct fwd_qixter< image3d<T>, W >
{
- typedef dpoints_fwd_pixter< image3d_b<T> > ret;
+ typedef dpoints_fwd_pixter< image3d<T> > ret;
};
template <typename T, typename W>
- struct fwd_qixter< const image3d_b<T>, W >
+ struct fwd_qixter< const image3d<T>, W >
{
- typedef dpoints_fwd_pixter< const image3d_b<T> > ret;
+ typedef dpoints_fwd_pixter< const image3d<T> > ret;
};
template <typename T, typename W>
- struct bkd_qixter< image3d_b<T>, W >
+ struct bkd_qixter< image3d<T>, W >
{
typedef mln::internal::fixme ret;
};
Index: mln/convert/to_image.hh
--- mln/convert/to_image.hh (revision 1276)
+++ mln/convert/to_image.hh (working copy)
@@ -33,9 +33,9 @@
* \brief Conversions to mln::Image.
*/
-# include <mln/core/image1d_b.hh>
-# include <mln/core/image2d_b.hh>
-# include <mln/core/image3d_b.hh>
+# include <mln/core/image1d.hh>
+# include <mln/core/image2d.hh>
+# include <mln/core/image3d.hh>
# include <mln/core/concept/point_set.hh>
# include <mln/core/concept/window.hh>
@@ -71,19 +71,19 @@
template <typename V>
struct helper_image_from_< 3, V >
{
- typedef image3d_b<V> ret;
+ typedef image3d<V> ret;
};
template <typename V>
struct helper_image_from_< 2, V >
{
- typedef image2d_b<V> ret;
+ typedef image2d<V> ret;
};
template <typename V>
struct helper_image_from_< 1, V >
{
- typedef image1d_b<V> ret;
+ typedef image1d<V> ret;
};
} // end of namespace mln::internal
@@ -119,9 +119,9 @@
template <typename W>
mln_image_from(W, mln_weight(W)) to_image(const Weighted_Window<W>& w_win);
- /// Convert an histo \p h into an image1d_b<std::size_t>.
+ /// Convert an histo \p h into an image1d<std::size_t>.
template <typename S>
- image1d_b<std::size_t> to_image(const mln::histo::data<S>& h);
+ image1d<std::size_t> to_image(const mln::histo::data<S>& h);
# ifndef MLN_INCLUDE_ONLY
@@ -175,12 +175,12 @@
}
template <typename S>
- image1d_b<std::size_t> to_image(const histo::data<S>& h)
+ image1d<std::size_t> to_image(const histo::data<S>& h)
{
mln_value(S)
v_min = h.vset()[0],
v_max = h.vset()[h.vset().nvalues() - 1];
- image1d_b<std::size_t> ima(make::box1d(v_min, v_max));
+ image1d<std::size_t> ima(make::box1d(v_min, v_max));
for(std::size_t i = 0; i < h.vset().nvalues(); ++i)
ima(make::point1d(i)) = h[i];
return ima;
Index: mln/display/color_pretty.hh
--- mln/display/color_pretty.hh (revision 1276)
+++ mln/display/color_pretty.hh (working copy)
@@ -36,7 +36,7 @@
# include <mln/trait/image_from_mesh.hh>
# include <mln/core/image_if_value.hh>
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/value/rgb8.hh>
# include <mln/level/fill.hh>
# include <mln/level/paste.hh>
@@ -63,7 +63,7 @@
{
const I& input = exact (input_);
- image2d_b<value::rgb8> output(input.domain().bbox());
+ image2d<value::rgb8> output(input.domain().bbox());
level::fill(output, value::rgb8(255, 0, 0));
// /// FIXME by :
Index: mln/io/pfm/load.hh
--- mln/io/pfm/load.hh (revision 1276)
+++ mln/io/pfm/load.hh (working copy)
@@ -33,7 +33,7 @@
// # include <fstream>
// # include <string>
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/value/int_u8.hh>
@@ -111,7 +111,7 @@
} // end of namespace mln::io::internal
- image2d_b<float> load(const std::string& filename)
+ image2d<float> load(const std::string& filename)
{
std::ifstream file(filename.c_str());
if (! file)
@@ -123,7 +123,7 @@
int nrows, ncols;
internal::read_pfm_header(file, nrows, ncols);
- image2d_b<float> ima(nrows, ncols);
+ image2d<float> ima(nrows, ncols);
internal::load_raw_2d(file, ima);
return ima;
}
Index: mln/io/pgm/load.hh
--- mln/io/pgm/load.hh (revision 1276)
+++ mln/io/pgm/load.hh (working copy)
@@ -33,7 +33,7 @@
# include <fstream>
# include <string>
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/value/int_u8.hh>
@@ -50,12 +50,12 @@
{
template <typename V>
- image2d_b<V> load(const std::string& filename)
+ image2d<V> load(const std::string& filename)
{
return io::internal::pnm::load<V>(PGM, filename);
}
- image2d_b<value::int_u8> load(const std::string& filename)
+ image2d<value::int_u8> load(const std::string& filename)
{
return load<value::int_u8>(filename);
}
Index: mln/io/fits/load.hh
--- mln/io/fits/load.hh (revision 1276)
+++ mln/io/fits/load.hh (working copy)
@@ -33,7 +33,7 @@
# include <fstream>
# include <string>
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/value/int_u8.hh>
# include <mln/io/fitsio.h>
@@ -59,7 +59,7 @@
return;
}
- image2d_b<float> load(const std::string& filename)
+ image2d<float> load(const std::string& filename)
{
fitsfile *fptr;
int status, nfound, anynull;
@@ -78,7 +78,7 @@
std::cout << "ncols : " << ncols
<< "nrows : " << nrows << std::endl;
- image2d_b<float> output(nrows, ncols);
+ image2d<float> output(nrows, ncols);
nullval = 0; // don't check null values
Index: mln/io/ppm/load.hh
--- mln/io/ppm/load.hh (revision 1276)
+++ mln/io/ppm/load.hh (working copy)
@@ -33,7 +33,7 @@
# include <fstream>
# include <string>
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/value/rgb8.hh>
# include <mln/io/internal/pnm/load.hh>
@@ -47,12 +47,12 @@
namespace ppm
{
template <typename V>
- image2d_b<V> load(const std::string& filename)
+ image2d<V> load(const std::string& filename)
{
return io::internal::pnm::load<V>(PPM, filename);
}
- image2d_b<value::rgb8> load(const std::string& filename)
+ image2d<value::rgb8> load(const std::string& filename)
{
return load< value::rgb8 >(filename);
}
Index: mln/io/internal/pnm/load.hh
--- mln/io/internal/pnm/load.hh (revision 1276)
+++ mln/io/internal/pnm/load.hh (working copy)
@@ -38,7 +38,7 @@
# include <fstream>
# include <string>
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/value/int_u8.hh>
# include <mln/value/rgb.hh>
@@ -90,7 +90,7 @@
// used when (sizeof(int_u8) != 1)
template <typename V>
void load_raw_2d_uncontiguous(std::ifstream& file,
- image2d_b<V>& ima)
+ image2d<V>& ima)
{
const int
min_row = geom::min_row(ima),
@@ -147,7 +147,7 @@
/// main function : load pnm format
template <typename V>
- image2d_b<V> load(char type_, const std::string& filename)
+ image2d<V> load(char type_, const std::string& filename)
{
std::ifstream file(filename.c_str());
if (! file)
@@ -162,7 +162,7 @@
read_header(type_ - 3, type_, file, type,
nrows, ncols, maxval);
- image2d_b<V> ima(nrows, ncols);
+ image2d<V> ima(nrows, ncols);
if (type = type_)
load_raw_2d(file, ima);
else
Index: mln/io/pbm/load.hh
--- mln/io/pbm/load.hh (revision 1276)
+++ mln/io/pbm/load.hh (working copy)
@@ -33,7 +33,7 @@
# include <fstream>
# include <string>
-# include <mln/core/image2d_b.hh>
+# include <mln/core/image2d.hh>
# include <mln/io/internal/pnm/load_header.hh>
namespace mln
@@ -93,7 +93,7 @@
} // end of namespace mln::io::internal
- image2d_b<bool> load(const std::string& filename)
+ image2d<bool> load(const std::string& filename)
{
std::ifstream file(filename.c_str());
if (! file)
@@ -106,7 +106,7 @@
int nrows, ncols;
io::internal::pnm::read_header('1', '4', file, type, nrows, ncols);
- image2d_b<bool> ima(nrows, ncols);
+ image2d<bool> ima(nrows, ncols);
if (type = '4')
internal::load_raw_2d(file, ima);
else
1
0