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
October 2006
- 3 participants
- 108 discussions
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Oops, my bad.
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix the distribution.
* oln/Makefile.am (nobase_oln_HEADERS): Remove core/fwd_piter.hh.
Add core/iterator_vtypes.hh.
Makefile.am | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: oln/Makefile.am
--- oln/Makefile.am (revision 632)
+++ oln/Makefile.am (working copy)
@@ -104,8 +104,6 @@
core/automatic/topology_having_neighborhood.hh \
core/automatic/topology_having_subset.hh \
\
- core/fwd_piter.hh \
- \
core/gen/bbox.hh \
core/gen/bbox_bkd_piter.hh \
core/gen/bbox_fwd_piter.hh \
@@ -133,6 +131,7 @@
\
core/case.hh \
core/image_entry.hh \
+ core/iterator_vtypes.hh \
core/macros.hh \
core/neighborhood_entry.hh \
core/point_set_entry.hh \
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix tests/window2d.
* oln/core/image_entry.hh
(oln::single_vtype<image_entry<E>, typedef_::bkd_qiter_type>):
New.
* oln/core/iterator_vtypes.hh
(oln::single_vtype<image1d<T>, typedef_::fwd_qiter_type>)
(oln::single_vtype<image2d<T>, typedef_::fwd_qiter_type>)
(oln::single_vtype<image3d<T>, typedef_::fwd_qiter_type>): New.
Aesthetic changes.
* oln/core/1d/aliases.hh (oln::window_)
(oln::fwd_qiter_win_, oln::bkd_qiter_win_): New forward
declarations.
(oln::window1d, oln::fwd_qiter1d): New typedefs.
* oln/core/3d/aliases.hh (oln::window_)
(oln::fwd_qiter_win_, oln::bkd_qiter_win_): New forward
declarations.
(oln::window3d, oln::fwd_qiter3d): New typedefs.
1d/aliases.hh | 10 +++
2d/aliases.hh | 4 +
3d/aliases.hh | 10 +++
image_entry.hh | 31 +++++++--
iterator_vtypes.hh | 173 ++++++++++++++++++++++++++++++++++++-----------------
5 files changed, 168 insertions(+), 60 deletions(-)
Index: oln/core/image_entry.hh
--- oln/core/image_entry.hh (revision 631)
+++ oln/core/image_entry.hh (working copy)
@@ -75,6 +75,13 @@
typedef mlc::undefined value_type;
// rvalue_type: see below.
+ // piter_type: see below.
+ // fwd_piter_type: see below.
+ // bkd_piter_type: see below.
+
+ // fwd_qiter_type: see below.
+ // bkd_qiter_type: see below.
+
typedef mlc::undefined concrete_type;
/// \brief Morpher type.
@@ -100,22 +107,24 @@
};
- // Piter.
+ // Rvalue.
template <typename E>
- struct single_vtype< image_entry<E>, typedef_::piter_type >
+ struct single_vtype< image_entry<E>, typedef_::rvalue_type >
{
- typedef oln_type_of(E, fwd_piter) ret;
+ typedef oln_type_of(E, value) ret;
};
- // Rvalue.
+ /* FIXME: Should we keep the `piter' vtype, knowing that the macro
+ `oln_piter' gives the `fwd_piter' vtype (and not the `piter'
+ vtype)? */
+ // Piter.
template <typename E>
- struct single_vtype< image_entry<E>, typedef_::rvalue_type >
+ struct single_vtype< image_entry<E>, typedef_::piter_type >
{
- typedef oln_type_of(E, value) ret;
+ typedef oln_type_of(E, fwd_piter) ret;
};
-
// Fwd piter.
template <typename E>
struct single_vtype< image_entry<E>, typedef_::fwd_piter_type >
@@ -130,6 +139,7 @@
typedef mlc::undefined ret;
};
+
// Fwd qiter.
template <typename E>
struct single_vtype< image_entry<E>, typedef_::fwd_qiter_type >
@@ -137,6 +147,13 @@
typedef mlc::undefined ret;
};
+ // Bkd qiter.
+ template <typename E>
+ struct single_vtype< image_entry<E>, typedef_::bkd_qiter_type >
+ {
+ typedef mlc::undefined ret;
+ };
+
} // end of namespace oln
Index: oln/core/iterator_vtypes.hh
--- oln/core/iterator_vtypes.hh (revision 631)
+++ oln/core/iterator_vtypes.hh (working copy)
@@ -38,7 +38,123 @@
namespace oln
{
- // morpher::add_isubset<Image, Isubset>
+ /*------------------.
+ | oln::image1d<T>. |
+ `------------------*/
+
+ template <typename T> class image1d;
+
+ /// fwd_piter vtype of image1d.
+ template <typename T>
+ struct single_vtype< image1d<T>, typedef_::fwd_piter_type >
+ {
+ typedef fwd_piter1d ret;
+ };
+
+ /// bkd_piter vtype of image1d.
+ template <typename T>
+ struct single_vtype< image1d<T>, typedef_::bkd_piter_type >
+ {
+ typedef bkd_piter1d ret;
+ };
+
+
+ /// fwd_qiter vtype of image1d.
+ template <typename T>
+ struct single_vtype< image1d<T>, typedef_::fwd_qiter_type >
+ {
+ typedef fwd_qiter1d ret;
+ };
+
+ // FIXME : Not yet available.
+
+// /// bkd_qiter vtype of image1d.
+// template <typename T>
+// struct single_vtype< image1d<T>, typedef_::bkd_qiter_type >
+// {
+// typedef bkd_qiter1d ret;
+// };
+
+
+ /*------------------.
+ | oln::image2d<T>. |
+ `------------------*/
+
+ template <typename T> class image2d;
+
+ /// fwd_piter vtype of image2d.
+ template <typename T>
+ struct single_vtype< image2d<T>, typedef_::fwd_piter_type >
+ {
+ typedef fwd_piter2d ret;
+ };
+
+ /// bkd_piter vtype of image2d.
+ template <typename T>
+ struct single_vtype< image2d<T>, typedef_::bkd_piter_type >
+ {
+ typedef bkd_piter2d ret;
+ };
+
+
+ /// fwd_qiter vtype of image2d.
+ template <typename T>
+ struct single_vtype< image2d<T>, typedef_::fwd_qiter_type >
+ {
+ typedef fwd_qiter2d ret;
+ };
+
+ // FIXME : Not yet available.
+
+// /// bkd_qiter vtype of image2d.
+// template <typename T>
+// struct single_vtype< image2d<T>, typedef_::bkd_qiter_type >
+// {
+// typedef bkd_qiter2d ret;
+// };
+
+
+ /*------------------.
+ | oln::image3d<T>. |
+ `------------------*/
+
+ template <typename T> class image3d;
+
+ /// fwd_piter vtype of image3d.
+ template <typename T>
+ struct single_vtype< image3d<T>, typedef_::fwd_piter_type >
+ {
+ typedef fwd_piter3d ret;
+ };
+
+ /// bkd_piter vtype of image3d.
+ template <typename T>
+ struct single_vtype< image3d<T>, typedef_::bkd_piter_type >
+ {
+ typedef bkd_piter3d ret;
+ };
+
+
+ /// fwd_qiter vtype of image3d.
+ template <typename T>
+ struct single_vtype< image3d<T>, typedef_::fwd_qiter_type >
+ {
+ typedef fwd_qiter3d ret;
+ };
+
+ // FIXME : Not yet available.
+
+// /// bkd_qiter vtype of image3d.
+// template <typename T>
+// struct single_vtype< image3d<T>, typedef_::bkd_qiter_type >
+// {
+// typedef bkd_qiter3d ret;
+// };
+
+
+ /*--------------------------------------------.
+ | oln::morpher::add_isubset<Image, Isubset>. |
+ `--------------------------------------------*/
namespace morpher {
template <typename Image, typename Isubset> struct add_isubset;
@@ -85,7 +201,9 @@
};
- // morpher::add_neighborhood<Image, Isubset>
+ /*-------------------------------------------------.
+ | oln::morpher::add_neighborhood<Image, Isubset>. |
+ `-------------------------------------------------*/
namespace morpher {
template <typename Image, typename Neighb> struct add_neighborhood;
@@ -111,57 +229,6 @@
};
- // image1d<T>
-
- template <typename T> class image1d;
-
- template <typename T>
- struct single_vtype< image1d<T>, typedef_::fwd_piter_type >
- {
- typedef fwd_piter1d ret;
- };
-
- template <typename T>
- struct single_vtype< image1d<T>, typedef_::bkd_piter_type >
- {
- typedef bkd_piter1d ret;
- };
-
-
- // image2d<T>
-
- template <typename T> class image2d;
-
- template <typename T>
- struct single_vtype< image2d<T>, typedef_::fwd_piter_type >
- {
- typedef fwd_piter2d ret;
- };
-
- template <typename T>
- struct single_vtype< image2d<T>, typedef_::bkd_piter_type >
- {
- typedef bkd_piter2d ret;
- };
-
-
- // image3d<T>
-
- template <typename T> class image3d;
-
- template <typename T>
- struct single_vtype< image3d<T>, typedef_::fwd_piter_type >
- {
- typedef fwd_piter3d ret;
- };
-
- template <typename T>
- struct single_vtype< image3d<T>, typedef_::bkd_piter_type >
- {
- typedef bkd_piter3d ret;
- };
-
-
} // end of namespace oln
Index: oln/core/1d/aliases.hh
--- oln/core/1d/aliases.hh (revision 631)
+++ oln/core/1d/aliases.hh (working copy)
@@ -38,10 +38,14 @@
template <typename C> class point1d_;
template <typename C> class dpoint1d_;
template <typename D> class neighb_;
+ template <typename D> class window_;
template <typename P> class bbox_;
template <typename P> class topo_lbbox_;
template <typename T> class fwd_piter_bbox_;
template <typename T> class bkd_piter_bbox_;
+ template <typename P> class fwd_qiter_win_;
+// FIXME: Not yet available.
+// template <typename P> class bkd_qiter_win_;
class grid1d;
/// \}
@@ -52,12 +56,18 @@
typedef dpoint1d_<int> dpoint1d;
typedef neighb_<dpoint1d> neighb1d;
+ typedef window_<dpoint1d> window1d;
typedef bbox_<point1d> bbox1d;
typedef topo_lbbox_<point1d> topo1d;
+
typedef fwd_piter_bbox_<point1d> fwd_piter1d;
typedef bkd_piter_bbox_<point1d> bkd_piter1d;
+ typedef fwd_qiter_win_<point1d> fwd_qiter1d;
+// FIXME: Not yet available.
+// typedef bkd_qiter_win_<point1d> fwd_qiter1d;
+
typedef point1d_<float> point1df;
typedef dpoint1d_<float> dpoint1df;
/// \}
Index: oln/core/2d/aliases.hh
--- oln/core/2d/aliases.hh (revision 631)
+++ oln/core/2d/aliases.hh (working copy)
@@ -44,6 +44,8 @@
template <typename P> class fwd_piter_bbox_;
template <typename P> class bkd_piter_bbox_;
template <typename P> class fwd_qiter_win_;
+// FIXME: Not yet available.
+// template <typename P> class bkd_qiter_win_;
class grid2d;
/// \}
@@ -63,6 +65,8 @@
typedef bkd_piter_bbox_<point2d> bkd_piter2d;
typedef fwd_qiter_win_<point2d> fwd_qiter2d;
+// FIXME: Not yet available.
+// typedef bkd_qiter_win_<point2d> fwd_qiter2d;
typedef point2d_<float> point2df;
typedef dpoint2d_<float> dpoint2df;
Index: oln/core/3d/aliases.hh
--- oln/core/3d/aliases.hh (revision 631)
+++ oln/core/3d/aliases.hh (working copy)
@@ -38,10 +38,14 @@
template <typename C> class point3d_;
template <typename C> class dpoint3d_;
template <typename D> class neighb_;
+ template <typename D> class window_;
template <typename P> class bbox_;
template <typename P> class topo_lbbox_;
template <typename T> class fwd_piter_bbox_;
template <typename T> class bkd_piter_bbox_;
+ template <typename P> class fwd_qiter_win_;
+// FIXME: Not yet available.
+// template <typename P> class bkd_qiter_win_;
class grid3d;
/// \}
@@ -52,12 +56,18 @@
typedef dpoint3d_<int> dpoint3d;
typedef neighb_<dpoint3d> neighb3d;
+ typedef window_<dpoint3d> window3d;
typedef bbox_<point3d> bbox3d;
typedef topo_lbbox_<point3d> topo3d;
+
typedef fwd_piter_bbox_<point3d> fwd_piter3d;
typedef bkd_piter_bbox_<point3d> bkd_piter3d;
+ typedef fwd_qiter_win_<point3d> fwd_qiter3d;
+// FIXME: Not yet available.
+// typedef bkd_qiter_win_<point3d> fwd_qiter3d;
+
typedef point3d_<float> point3df;
typedef dpoint3d_<float> dpoint3df;
/// \}
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix access to images in tests.
* tests/data.hh: New file.
* tests/io_pnm: Include it.
(main): Use rdata to compute the path to loaded images.
* tests/window2d.cc: Likewise.
Add copyright header.
* tests/Makefile.am (AM_CPPFLAGS): Add -I$(srcdir)/check and
-DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\".
(noinst_HEADERS): New.
Add data.hh
* tests/check/Makefile.am (EXTRA_DIST): Add Makefile.flags.
Makefile.am | 7 ++++++-
check/Makefile.am | 8 ++++----
data.hh | 15 +++++++++++++++
io_pnm.cc | 7 +++++--
window2d.cc | 32 +++++++++++++++++++++++++++++++-
5 files changed, 61 insertions(+), 8 deletions(-)
Index: tests/window2d.cc
--- tests/window2d.cc (revision 630)
+++ tests/window2d.cc (working copy)
@@ -1,8 +1,38 @@
+// Copyright (C) 2006 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.
+
+/// Test oln::window2d.
+
#include <oln/basics2d.hh>
#include <oln/debug/print.hh>
#include <oln/io/pnm.hh>
#include <oln/morpher/add_neighborhood.hh>
+#include "data.hh"
namespace test
{
@@ -29,7 +59,7 @@
{
using namespace oln;
- image2d<unsigned char> ima = io::load_pgm("../img/lena32.pgm");
+ image2d<unsigned char> ima = io::load_pgm(rdata("lena32.pgm"));
debug::println(ima);
window2d win;
Index: tests/io_pnm.cc
--- tests/io_pnm.cc (revision 630)
+++ tests/io_pnm.cc (working copy)
@@ -28,12 +28,15 @@
/// Test oln::io_pnm.cc.
#include <cassert>
+
#include <oln/basics2d.hh>
#include <oln/io/pnm.hh>
+#include "data.hh"
+
int
main()
{
- oln::image2d<bool> ima = oln::io::load_pbm("../img/chien.pbm");
- oln::image2d<unsigned char> ima2 = oln::io::load_pgm("../img/lena32.pgm");
+ oln::image2d<bool> ima = oln::io::load_pbm(rdata("chien.pbm"));
+ oln::image2d<unsigned char> ima2 = oln::io::load_pgm(rdata("lena32.pgm"));
}
Index: tests/data.hh
--- tests/data.hh (revision 0)
+++ tests/data.hh (revision 0)
@@ -0,0 +1,15 @@
+// FIXME: Should be compiled in libolncheck, as in Olena 0.10.
+// (This is temporary.)
+
+#ifndef OLN_TESTS_DATA_HH
+# define OLN_TESTS_DATA_HH
+
+#include <iostream>
+
+std::string
+rdata(const std::string& file)
+{
+ return OLN_IMG_DIR "/" + file;
+}
+
+#endif // ! OLN_TESTS_DATA_HH
Index: tests/Makefile.am
--- tests/Makefile.am (revision 630)
+++ tests/Makefile.am (working copy)
@@ -2,9 +2,13 @@
SUBDIRS = check sanity
+# FIXME: Revamp (see Olena 0.10's test suite).
+
AM_CPPFLAGS = \
+ -I$(srcdir)/check \
-I$(top_srcdir)/olena -I$(top_srcdir)/extended \
- -I$(top_srcdir)/static -I$(top_srcdir)/metalic
+ -I$(top_srcdir)/static -I$(top_srcdir)/metalic \
+ -DOLN_IMG_DIR=\"$(top_srcdir)/olena/img\"
# FIXME: Add
#
@@ -16,6 +20,7 @@
TESTS_CXXFLAGS = @TESTS_CXXFLAGS@
CXXFLAGS += $(TESTS_CXXFLAGS)
+noinst_HEADERS = data.hh
check_PROGRAMS = \
dpoint2d \
Index: tests/check/Makefile.am
--- tests/check/Makefile.am (revision 630)
+++ tests/check/Makefile.am (working copy)
@@ -1,10 +1,11 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
-# FIXME: To be enabled when the test suite mechanism is available.
+## FIXME: To be (fully) enabled when the test suite mechanism is available.
# include Makefile.flags
-# AM_CPPFLAGS += -DCXX=\""$(CXX)"\" \
+# AM_CPPFLAGS +=
+# -DCXX=\""$(CXX)"\" \
# -DCPPFLAGS=\""$(CPPFLAGS)"\" \
# -DCXXFLAGS=\""$(CXXFLAGS)"\" \
# -DOLN_EXTRA_CPPFLAGS=\""$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS)"\" \
@@ -30,5 +31,4 @@
# data.cc \
# $(COMMON_CHECK_SOURCES)
-
-# EXTRA_DIST = Makefile.flags Makefile.check Makefile.runtests
+EXTRA_DIST = Makefile.flags # Makefile.check Makefile.runtests
1
0
2006-10-12 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add image accessors with indices.
* tests/at.cc: New.
* oln/core/automatic/image1d.hh: New.
* oln/core/automatic/image2d.hh: New.
* oln/core/automatic/image3d.hh: New.
* tests/Makefile.am (check_PROGRAMS): Add 'at'.
Move io_pnm to get consistent with SOURCES list.
(at_SOURCES): New.
* oln/core/typedefs.hh (oln_psite, oln_psite_): New.
* oln/core/automatic/image_being_mutable.hh
(lvalue_t, psite_t): Remove; use oln_lvalue and oln_psite instead.
(impl_op_readwrite): Update sig.
* oln/core/abstract/image/dimension/1d.hh (at): New const method.
(at, has_at): New methods that should be elsewhere; this is a hack.
(image1d): Move ctor impl inside guards.
* oln/core/abstract/image/dimension/2d.hh (at): New const method.
(at, has_at): New methods that should be elsewhere; this is a hack.
(image2d): Move ctor impl inside guards.
* oln/core/abstract/image/dimension/3d.hh (at): New const method.
(at, has_at): New methods that should be elsewhere; this is a hack.
(image3d): Move ctor impl inside guards.
* oln/core/abstract/point.hh (include): Add xtd/vec.hh.
* oln/core/1d/neighb1d.hh (mk_c2): Update to mimic neighb2d.
* oln/core/2d/image2d.hh (impl_at): New.
* oln/core/3d/image3d.hh (impl_at): New.
* oln/Makefile.am (nobase_oln_HEADERS): Update.
* oln/morpher/internal/image_extension.hh (delegate): New mutable
version.
Index: tests/at.cc
===================================================================
--- tests/at.cc (revision 0)
+++ tests/at.cc (revision 0)
@@ -0,0 +1,51 @@
+// Copyright (C) 2006 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.
+
+#include <cassert>
+// FIXME: Don't include oln/basics2d.hh, which is too big.
+// (Fix.)
+#include <oln/basics1d.hh>
+#include <oln/basics2d.hh>
+#include <oln/morpher/add_neighborhood.hh>
+
+
+int
+main()
+{
+ using namespace oln;
+
+ image2d<int> ima(1, 1);
+ point2d p(0, 0);
+
+ (ima + c4).at(0, 0) = 51;
+ assert(ima(p) == 51);
+
+ image1d<int> sig(1);
+ point1d i(0);
+ (sig + c2).at(0) = 51;
+ assert(sig(i) == 51);
+}
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am (revision 629)
+++ tests/Makefile.am (working copy)
@@ -28,12 +28,15 @@
npoints \
window2d \
\
+ at \
+ \
+ io_pnm \
+ \
identity_morpher \
add_neighborhood_morpher \
morphers \
\
- fill \
- io_pnm
+ fill
# Images and auxiliary structures.
dpoint2d_SOURCES = dpoint2d.cc
@@ -46,6 +49,9 @@
npoints_SOURCES = npoints.cc
window2d_SOURCES = window2d.cc
+# Methods.
+at_SOURCES = at.cc
+
# I/O.
io_pnm_SOURCES = io_pnm.cc
Index: oln/core/typedefs.hh
===================================================================
--- oln/core/typedefs.hh (revision 629)
+++ oln/core/typedefs.hh (working copy)
@@ -219,6 +219,9 @@
# define oln_point(T) oln_type_of(T, point)
# define oln_point_(T) oln_type_of_(T, point)
+# define oln_psite(T) oln_type_of(T, psite)
+# define oln_psite_(T) oln_type_of_(T, psite)
+
# define oln_dpoint(T) oln_type_of(T, dpoint)
# define oln_dpoint_(T) oln_type_of_(T, dpoint)
Index: oln/core/automatic/image1d.hh
===================================================================
--- oln/core/automatic/image1d.hh (revision 0)
+++ oln/core/automatic/image1d.hh (revision 0)
@@ -0,0 +1,151 @@
+// Copyright (C) 2006 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 OLN_CORE_AUTOMATIC_IMAGE1D_HH
+# define OLN_CORE_AUTOMATIC_IMAGE1D_HH
+
+# include <oln/core/automatic/impl.hh>
+# include <oln/morpher/tags.hh>
+# include <oln/core/1d/point1d.hh>
+
+
+namespace oln
+{
+ // Forward declaration.
+ namespace abstract
+ {
+ template <typename E> class image1d;
+
+ } // end of namespace oln::abstract
+
+
+ namespace automatic
+ {
+
+
+ /// Default implementation corresponding to the interface
+ /// oln::abstract::image1d.
+ template <typename E, typename tag>
+ class set_impl<abstract::image1d, tag, E> :
+ public virtual stc::any__simple<E>
+ {
+ public:
+
+ oln_rvalue(E) impl_at(const oln_coord(E)& index) const;
+
+ // FIXME: Hack.
+ oln_lvalue(E)& impl_at(const oln_coord(E)& index);
+ bool impl_has_at(const oln_coord(E)& index) const;
+
+ };
+
+
+
+ /// Implementation corresponding to the interface
+ /// oln::abstract::image1d for an identity morpher.
+ template <typename E>
+ class set_impl<abstract::image1d, morpher::tag::identity, E> :
+ public virtual stc::any__simple<E>
+ {
+ public:
+
+ oln_rvalue(E) impl_at(const oln_coord(E)& index) const;
+
+ // FIXME: Hack.
+ oln_lvalue(E)& impl_at(const oln_coord(E)& index);
+ bool impl_has_at(const oln_coord(E)& index) const;
+
+ };
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+
+ // Default is: 1. convert (index) -> p then 2. call operator()(p).
+
+ template <typename E, typename tag>
+ oln_rvalue(E)
+ set_impl<abstract::image1d, tag, E>
+ ::impl_at(const oln_coord(E)& index) const
+ {
+ point1d tmp(index);
+ return this->exact().operator()(tmp);
+ }
+
+ template <typename E, typename tag>
+ oln_lvalue(E)&
+ set_impl<abstract::image1d, tag, E>
+ ::impl_at(const oln_coord(E)& index)
+ {
+ point1d tmp(index);
+ return this->exact().operator()(tmp);
+ }
+
+ template <typename E, typename tag>
+ bool
+ set_impl<abstract::image1d, tag, E>
+ ::impl_has_at(const oln_coord(E)& index) const
+ {
+ point1d tmp(index);
+ return this->exact().has(tmp);
+ }
+
+
+ // For morphers: delegate.
+
+ template <typename E>
+ oln_rvalue(E)
+ set_impl<abstract::image1d, morpher::tag::identity, E>
+ ::impl_at(const oln_coord(E)& index) const
+ {
+ return this->exact().delegate().at(index);
+ }
+
+ template <typename E>
+ oln_lvalue(E)&
+ set_impl<abstract::image1d, morpher::tag::identity, E>
+ ::impl_at(const oln_coord(E)& index)
+ {
+ return this->exact().delegate().at(index);
+ }
+
+ template <typename E>
+ bool
+ set_impl<abstract::image1d, morpher::tag::identity, E>
+ ::impl_has_at(const oln_coord(E)& index) const
+ {
+ return this->exact().delegate().has_at(index);
+ }
+
+# endif
+
+ } // end of namespace oln::automatic
+
+} // end of namespace oln
+
+#endif // ! OLN_CORE_AUTOMATIC_IMAGE1D_HH
Index: oln/core/automatic/image2d.hh
===================================================================
--- oln/core/automatic/image2d.hh (revision 0)
+++ oln/core/automatic/image2d.hh (revision 0)
@@ -0,0 +1,151 @@
+// Copyright (C) 2006 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 OLN_CORE_AUTOMATIC_IMAGE2D_HH
+# define OLN_CORE_AUTOMATIC_IMAGE2D_HH
+
+# include <oln/core/automatic/impl.hh>
+# include <oln/morpher/tags.hh>
+# include <oln/core/2d/point2d.hh>
+
+
+namespace oln
+{
+ // Forward declaration.
+ namespace abstract
+ {
+ template <typename E> class image2d;
+
+ } // end of namespace oln::abstract
+
+
+ namespace automatic
+ {
+
+
+ /// Default implementation corresponding to the interface
+ /// oln::abstract::image2d.
+ template <typename E, typename tag>
+ class set_impl<abstract::image2d, tag, E> :
+ public virtual stc::any__simple<E>
+ {
+ public:
+
+ oln_rvalue(E) impl_at(const oln_coord(E)& row, const oln_coord(E)& col) const;
+
+ // FIXME: Hack.
+ oln_lvalue(E)& impl_at(const oln_coord(E)& row, const oln_coord(E)& col);
+ bool impl_has_at(const oln_coord(E)& row, const oln_coord(E)& col) const;
+
+ };
+
+
+
+ /// Implementation corresponding to the interface
+ /// oln::abstract::image2d for an identity morpher.
+ template <typename E>
+ class set_impl<abstract::image2d, morpher::tag::identity, E> :
+ public virtual stc::any__simple<E>
+ {
+ public:
+
+ oln_rvalue(E) impl_at(const oln_coord(E)& row, const oln_coord(E)& col) const;
+
+ // FIXME: Hack.
+ oln_lvalue(E)& impl_at(const oln_coord(E)& row, const oln_coord(E)& col);
+ bool impl_has_at(const oln_coord(E)& row, const oln_coord(E)& col) const;
+
+ };
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+
+ // Default is: 1. convert (row, col) -> p then 2. call operator()(p).
+
+ template <typename E, typename tag>
+ oln_rvalue(E)
+ set_impl<abstract::image2d, tag, E>
+ ::impl_at(const oln_coord(E)& row, const oln_coord(E)& col) const
+ {
+ point2d tmp(row, col);
+ return this->exact().operator()(tmp);
+ }
+
+ template <typename E, typename tag>
+ oln_lvalue(E)&
+ set_impl<abstract::image2d, tag, E>
+ ::impl_at(const oln_coord(E)& row, const oln_coord(E)& col)
+ {
+ point2d tmp(row, col);
+ return this->exact().operator()(tmp);
+ }
+
+ template <typename E, typename tag>
+ bool
+ set_impl<abstract::image2d, tag, E>
+ ::impl_has_at(const oln_coord(E)& row, const oln_coord(E)& col) const
+ {
+ point2d tmp(row, col);
+ return this->exact().has(tmp);
+ }
+
+
+ // For morphers: delegate.
+
+ template <typename E>
+ oln_rvalue(E)
+ set_impl<abstract::image2d, morpher::tag::identity, E>
+ ::impl_at(const oln_coord(E)& row, const oln_coord(E)& col) const
+ {
+ return this->exact().delegate().at(row, col);
+ }
+
+ template <typename E>
+ oln_lvalue(E)&
+ set_impl<abstract::image2d, morpher::tag::identity, E>
+ ::impl_at(const oln_coord(E)& row, const oln_coord(E)& col)
+ {
+ return this->exact().delegate().at(row, col);
+ }
+
+ template <typename E>
+ bool
+ set_impl<abstract::image2d, morpher::tag::identity, E>
+ ::impl_has_at(const oln_coord(E)& row, const oln_coord(E)& col) const
+ {
+ return this->exact().delegate().has_at(row, col);
+ }
+
+# endif
+
+ } // end of namespace oln::automatic
+
+} // end of namespace oln
+
+#endif // ! OLN_CORE_AUTOMATIC_IMAGE2D_HH
Index: oln/core/automatic/image3d.hh
===================================================================
--- oln/core/automatic/image3d.hh (revision 0)
+++ oln/core/automatic/image3d.hh (revision 0)
@@ -0,0 +1,175 @@
+// Copyright (C) 2006 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 OLN_CORE_AUTOMATIC_IMAGE3D_HH
+# define OLN_CORE_AUTOMATIC_IMAGE3D_HH
+
+# include <oln/core/automatic/impl.hh>
+# include <oln/morpher/tags.hh>
+# include <oln/core/3d/point3d.hh>
+
+
+namespace oln
+{
+ // Forward declaration.
+ namespace abstract
+ {
+ template <typename E> class image3d;
+
+ } // end of namespace oln::abstract
+
+
+ namespace automatic
+ {
+
+
+ /// Default implementation corresponding to the interface
+ /// oln::abstract::image3d.
+ template <typename E, typename tag>
+ class set_impl<abstract::image3d, tag, E> :
+ public virtual stc::any__simple<E>
+ {
+ public:
+
+ oln_rvalue(E) impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const;
+
+ // FIXME: Hack.
+ oln_lvalue(E)& impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col);
+ bool impl_has_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const;
+
+ };
+
+
+
+ /// Implementation corresponding to the interface
+ /// oln::abstract::image3d for an identity morpher.
+ template <typename E>
+ class set_impl<abstract::image3d, morpher::tag::identity, E> :
+ public virtual stc::any__simple<E>
+ {
+ public:
+
+ oln_rvalue(E) impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const;
+
+ // FIXME: Hack.
+ oln_lvalue(E)& impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col);
+ bool impl_has_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const;
+
+ };
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+
+ // Default is: 1. convert (slice, row, col) -> p then 2. call operator()(p).
+
+ template <typename E, typename tag>
+ oln_rvalue(E)
+ set_impl<abstract::image3d, tag, E>
+ ::impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const
+ {
+ point3d tmp(slice, row, col);
+ return this->exact().operator()(tmp);
+ }
+
+ template <typename E, typename tag>
+ oln_lvalue(E)&
+ set_impl<abstract::image3d, tag, E>
+ ::impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col)
+ {
+ point3d tmp(slice, row, col);
+ return this->exact().operator()(tmp);
+ }
+
+ template <typename E, typename tag>
+ bool
+ set_impl<abstract::image3d, tag, E>
+ ::impl_has_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const
+ {
+ point3d tmp(slice, row, col);
+ return this->exact().has(tmp);
+ }
+
+
+ // For morphers: delegate.
+
+ template <typename E>
+ oln_rvalue(E)
+ set_impl<abstract::image3d, morpher::tag::identity, E>
+ ::impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const
+ {
+ return this->exact().delegate().at(slice, row, col);
+ }
+
+ template <typename E>
+ oln_lvalue(E)&
+ set_impl<abstract::image3d, morpher::tag::identity, E>
+ ::impl_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col)
+ {
+ return this->exact().delegate().at(slice, row, col);
+ }
+
+ template <typename E>
+ bool
+ set_impl<abstract::image3d, morpher::tag::identity, E>
+ ::impl_has_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const
+ {
+ return this->exact().delegate().has_at(slice, row, col);
+ }
+
+# endif
+
+ } // end of namespace oln::automatic
+
+} // end of namespace oln
+
+#endif // ! OLN_CORE_AUTOMATIC_IMAGE3D_HH
Index: oln/core/automatic/image_being_mutable.hh
===================================================================
--- oln/core/automatic/image_being_mutable.hh (revision 629)
+++ oln/core/automatic/image_being_mutable.hh (working copy)
@@ -50,20 +50,17 @@
class set_impl<abstract::image_being_mutable, morpher::tag::identity, E> :
public virtual stc::any__simple<E>
{
- private:
- typedef oln_type_of(E, lvalue) lvalue_t;
- typedef oln_type_of(E, psite) psite_t;
-
public:
/// Accessor delegation.
- lvalue_t& impl_op_readwrite(const psite_t& p) const;
+ oln_lvalue(E)& impl_op_readwrite(const oln_psite(E)& p);
};
# ifndef OLN_INCLUDE_ONLY
template <typename E>
- typename set_impl<abstract::image_being_mutable, morpher::tag::identity, E>::lvalue_t&
- set_impl<abstract::image_being_mutable, morpher::tag::identity, E>::impl_op_readwrite(const typename set_impl<abstract::image_being_mutable, morpher::tag::identity, E>::psite_t& p) const
+ oln_lvalue(E)&
+ set_impl<abstract::image_being_mutable, morpher::tag::identity, E>
+ ::impl_op_readwrite(const oln_psite(E)& p)
{
return this->exact().delegate().operator()(p);
}
Index: oln/core/abstract/image/dimension/1d.hh
===================================================================
--- oln/core/abstract/image/dimension/1d.hh (revision 629)
+++ oln/core/abstract/image/dimension/1d.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_ABSTRACT_IMAGE_DIMENSION_1D_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/automatic/image1d.hh>
namespace oln
@@ -43,11 +44,50 @@
public virtual image<E>,
public automatic::get_impl<image1d, E>
{
+ public:
+
+ oln_rvalue(E) at(const oln_coord(E)& index) const;
+
+ // FIXME: Hack (should be elsewhere)!
+ oln_lvalue(E)& at(const oln_coord(E)& index);
+ bool has_at(const oln_coord(E)& index) const;
+
protected:
/// Constructor (protected, empty).
- image1d() {}
+ image1d();
};
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename E>
+ image1d<E>::image1d()
+ {
+ }
+
+ template <typename E>
+ oln_rvalue(E)
+ image1d<E>::at(const oln_coord(E)& index) const
+ {
+ return this->exact().impl_at(index);
+ }
+
+ template <typename E>
+ oln_lvalue(E)&
+ image1d<E>::at(const oln_coord(E)& index)
+ {
+ return this->exact().impl_at(index);
+ }
+
+ template <typename E>
+ bool
+ image1d<E>::has_at(const oln_coord(E)& index) const
+ {
+ return this->exact().impl_has_at(index);
+ }
+
+# endif
+
} // end of namespace oln::abstract
} // end of namespace oln
Index: oln/core/abstract/image/dimension/2d.hh
===================================================================
--- oln/core/abstract/image/dimension/2d.hh (revision 629)
+++ oln/core/abstract/image/dimension/2d.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_ABSTRACT_IMAGE_DIMENSION_2D_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/automatic/image2d.hh>
namespace oln
@@ -43,6 +44,14 @@
public virtual image<E>,
public automatic::get_impl<image2d, E>
{
+ public:
+
+ oln_rvalue(E) at(const oln_coord(E)& row, const oln_coord(E)& col) const;
+
+ // FIXME: Hack (should be elsewhere)!
+ oln_lvalue(E)& at(const oln_coord(E)& row, const oln_coord(E)& col);
+ bool has_at(const oln_coord(E)& row, const oln_coord(E)& col) const;
+
protected:
/// Constructor (protected, empty).
image2d();
@@ -56,6 +65,27 @@
{
}
+ template <typename E>
+ oln_rvalue(E)
+ image2d<E>::at(const oln_coord(E)& row, const oln_coord(E)& col) const
+ {
+ return this->exact().impl_at(row, col);
+ }
+
+ template <typename E>
+ oln_lvalue(E)&
+ image2d<E>::at(const oln_coord(E)& row, const oln_coord(E)& col)
+ {
+ return this->exact().impl_at(row, col);
+ }
+
+ template <typename E>
+ bool
+ image2d<E>::has_at(const oln_coord(E)& row, const oln_coord(E)& col) const
+ {
+ return this->exact().impl_has_at(row, col);
+ }
+
# endif
} // end of namespace oln::abstract
Index: oln/core/abstract/image/dimension/3d.hh
===================================================================
--- oln/core/abstract/image/dimension/3d.hh (revision 629)
+++ oln/core/abstract/image/dimension/3d.hh (working copy)
@@ -29,6 +29,7 @@
# define OLN_CORE_ABSTRACT_IMAGE_DIMENSION_3D_HH
# include <oln/core/abstract/image.hh>
+# include <oln/core/automatic/image3d.hh>
namespace oln
@@ -43,10 +44,61 @@
public virtual image<E>,
public automatic::get_impl<image3d, E>
{
+ public:
+
+ oln_rvalue(E) at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const;
+
+ // FIXME: Hack (should be elsewhere)!
+ oln_lvalue(E)& at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col);
+ bool has_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const;
+
protected:
/// Constructor (protected, empty).
- image3d() {}
+ image3d();
};
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename E>
+ image3d<E>::image3d()
+ {
+ }
+
+ template <typename E>
+ oln_rvalue(E)
+ image3d<E>::at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const
+ {
+ return this->exact().impl_at(slice, row, col);
+ }
+
+ template <typename E>
+ oln_lvalue(E)&
+ image3d<E>::at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col)
+ {
+ return this->exact().impl_at(slice, row, col);
+ }
+
+ template <typename E>
+ bool
+ image3d<E>::has_at(const oln_coord(E)& slice,
+ const oln_coord(E)& row,
+ const oln_coord(E)& col) const
+ {
+ return this->exact().impl_has_at(slice, row, col);
+ }
+
+# endif
} // end of namespace oln::abstract
Index: oln/core/abstract/point.hh
===================================================================
--- oln/core/abstract/point.hh (revision 629)
+++ oln/core/abstract/point.hh (working copy)
@@ -29,6 +29,8 @@
#ifndef OLN_CORE_ABSTRACT_POINT_HH
# define OLN_CORE_ABSTRACT_POINT_HH
+# include <xtd/vec.hh>
+
# include <oln/core/typedefs.hh>
# include <oln/core/traits_id.hh>
# include <oln/core/abstract/dpoint.hh>
Index: oln/core/1d/neighb1d.hh
===================================================================
--- oln/core/1d/neighb1d.hh (revision 629)
+++ oln/core/1d/neighb1d.hh (working copy)
@@ -46,13 +46,9 @@
neighb1d mk_c2()
{
- static bool flower = true;
- static neighb1d the_;
- if (flower)
- {
- the_.add(dpoint1d(1));
- flower = false;
- }
+ neighb1d the_;
+ the_
+ .add(dpoint1d(1));
return the_;
}
@@ -67,7 +63,7 @@
# ifndef OLN_INCLUDE_ONLY
- const neighb1d c2 = internal::mk_c2();
+ const neighb1d c2 = internal::mk_c2();
# endif
Index: oln/core/2d/image2d.hh
===================================================================
--- oln/core/2d/image2d.hh (revision 629)
+++ oln/core/2d/image2d.hh (working copy)
@@ -93,7 +93,10 @@
const topo2d& impl_topo() const;
T impl_op_read(const point2d& p) const;
+ T impl_at(int row, int col) const;
+
T& impl_op_readwrite(const point2d& p);
+ T& impl_at(int row, int col);
T* adr_at(int row, int col);
const T* adr_at(int row, int col) const;
@@ -128,12 +131,14 @@
{
}
+
template <typename T>
const topo2d& image2d<T>::impl_topo() const
{
return topo_;
}
+
template <typename T>
T image2d<T>::impl_op_read(const point2d& p) const
{
@@ -143,6 +148,14 @@
}
template <typename T>
+ T image2d<T>::impl_at(int row, int col) const
+ {
+ precondition(data_->has(row, col));
+ return data_->operator()(row, col);
+ }
+
+
+ template <typename T>
T& image2d<T>::impl_op_readwrite(const point2d& p)
{
precondition(data_ != 0);
@@ -151,6 +164,14 @@
}
template <typename T>
+ T& image2d<T>::impl_at(int row, int col)
+ {
+ precondition(data_->has(row, col));
+ return data_->operator()(row, col);
+ }
+
+
+ template <typename T>
T* image2d<T>::adr_at(int row, int col)
{
precondition(data_ != 0);
Index: oln/core/3d/image3d.hh
===================================================================
--- oln/core/3d/image3d.hh (revision 629)
+++ oln/core/3d/image3d.hh (working copy)
@@ -94,7 +94,10 @@
const topo3d& impl_topo() const;
T impl_op_read(const point3d& p) const;
+ T impl_at(int slice, int row, int col) const;
+
T& impl_op_readwrite(const point3d& p);
+ T& impl_at(int slice, int row, int col);
T* adr_at(int slice, int row, int col);
const T* adr_at(int slice, int row, int col) const;
@@ -106,7 +109,6 @@
};
-
# ifndef OLN_INCLUDE_ONLY
template <typename T>
@@ -137,13 +139,16 @@
}
template <typename T>
- const topo3d& image3d<T>::impl_topo() const
+ const topo3d&
+ image3d<T>::impl_topo() const
{
return topo_;
}
+
template <typename T>
- T image3d<T>::impl_op_read(const point3d& p) const
+ T
+ image3d<T>::impl_op_read(const point3d& p) const
{
precondition(data_ != 0);
precondition(topo_.has_large(p));
@@ -151,14 +156,33 @@
}
template <typename T>
- T& image3d<T>::impl_op_readwrite(const point3d& p)
+ T
+ image3d<T>::impl_at(int slice, int row, int col) const
{
+ precondition(data_->has(slice, row, col));
+ return data_->operator()(slice, row, col);
+ }
+
+
+ template <typename T>
+ T&
+ image3d<T>::impl_op_readwrite(const point3d& p)
+ {
precondition(data_ != 0);
precondition(topo_.has_large(p));
return data_->operator()(p.slice(), p.row(), p.col());
}
template <typename T>
+ T&
+ image3d<T>::impl_at(int slice, int row, int col)
+ {
+ precondition(data_->has(slice, row, col));
+ return data_->operator()(slice, row, col);
+ }
+
+
+ template <typename T>
T* image3d<T>::adr_at(int slice, int row, int col)
{
precondition(data_ != 0);
Index: oln/Makefile.am
===================================================================
--- oln/Makefile.am (revision 629)
+++ oln/Makefile.am (working copy)
@@ -91,6 +91,9 @@
core/abstract/window.hh \
\
core/automatic/image.hh \
+ core/automatic/image1d.hh \
+ core/automatic/image2d.hh \
+ core/automatic/image3d.hh \
core/automatic/image_being_mutable.hh \
core/automatic/image_being_random_accessible.hh \
core/automatic/image_having_neighborhood.hh \
Index: oln/morpher/internal/image_extension.hh
===================================================================
--- oln/morpher/internal/image_extension.hh (revision 629)
+++ oln/morpher/internal/image_extension.hh (working copy)
@@ -86,7 +86,9 @@
// FIXME: Handle the constness.
image_extension(const Image& image);
+
const Image& delegate() const;
+ Image& delegate();
protected:
Image image_;
@@ -109,6 +111,13 @@
return image_;
}
+ template <typename Image, typename Exact>
+ Image&
+ image_extension<Image, Exact>::delegate()
+ {
+ return image_;
+ }
+
# endif
} // end of namespace oln::morpher::internal
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix sanity tests.
* oln/core/spe/row.hh, oln/core/spe/col.hh, oln/core/spe/slice.hh
(oln/core/abstract/point_set/point_set_having_bbox.hh)
(oln/core/abstract/image/bbox/hierarchy.hh): Include them.
col.hh | 2 ++
row.hh | 2 ++
slice.hh | 2 ++
3 files changed, 6 insertions(+)
Index: oln/core/spe/row.hh
--- oln/core/spe/row.hh (revision 628)
+++ oln/core/spe/row.hh (working copy)
@@ -32,7 +32,9 @@
# include <oln/core/abstract/point.hh>
# include <oln/core/abstract/dpoint.hh>
# include <oln/core/abstract/point_set.hh>
+# include <oln/core/abstract/point_set/point_set_having_bbox.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/bbox/hierarchy.hh>
# include <oln/core/abstract/iterator_on_points.hh>
Index: oln/core/spe/col.hh
--- oln/core/spe/col.hh (revision 628)
+++ oln/core/spe/col.hh (working copy)
@@ -32,7 +32,9 @@
# include <oln/core/abstract/point.hh>
# include <oln/core/abstract/dpoint.hh>
# include <oln/core/abstract/point_set.hh>
+# include <oln/core/abstract/point_set/point_set_having_bbox.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/bbox/hierarchy.hh>
# include <oln/core/abstract/iterator_on_points.hh>
Index: oln/core/spe/slice.hh
--- oln/core/spe/slice.hh (revision 628)
+++ oln/core/spe/slice.hh (working copy)
@@ -32,7 +32,9 @@
# include <oln/core/abstract/point.hh>
# include <oln/core/abstract/dpoint.hh>
# include <oln/core/abstract/point_set.hh>
+# include <oln/core/abstract/point_set/point_set_having_bbox.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/abstract/image/bbox/hierarchy.hh>
# include <oln/core/abstract/iterator_on_points.hh>
1
0
12 Oct '06
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
* oln/core/fwd_piter.hh: Rename as....
* oln/core/iterator_vtypes.hh: ...this.
Adjust header guards.
* oln/basics1d.hh, oln/basics2d.hh, oln/basics3d.hh,
* oln/core/1d/image1d.hh, oln/core/2d/image2d.hh,
* oln/core/3d/image3d.hh, oln/core/internal/bbox_bkd_piter.hh,
* oln/core/internal/bbox_fwd_piter.hh, oln/io/pnm.hh,
* oln/morpher/add_neighborhood.hh: Adjust.
basics1d.hh | 2 +-
basics2d.hh | 2 +-
basics3d.hh | 2 +-
core/1d/image1d.hh | 2 +-
core/2d/image2d.hh | 2 +-
core/3d/image3d.hh | 2 +-
core/internal/bbox_bkd_piter.hh | 2 +-
core/internal/bbox_fwd_piter.hh | 2 +-
io/pnm.hh | 2 +-
morpher/add_neighborhood.hh | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
Index: oln/basics1d.hh
--- oln/basics1d.hh (revision 627)
+++ oln/basics1d.hh (working copy)
@@ -49,7 +49,7 @@
# include <oln/core/1d/image1d.hh>
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
#endif // ! OLN_BASICS1D_HH
Index: oln/io/pnm.hh
--- oln/io/pnm.hh (revision 627)
+++ oln/io/pnm.hh (working copy)
@@ -36,7 +36,7 @@
# include <oln/core/abstract/iterator.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
# include <oln/core/gen/bkd_piter_bbox.hh>
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
# include <oln/core/2d/aliases.hh>
# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/2d/image2d.hh>
Index: oln/core/1d/image1d.hh
--- oln/core/1d/image1d.hh (revision 627)
+++ oln/core/1d/image1d.hh (working copy)
@@ -39,7 +39,7 @@
# include <oln/core/1d/aliases.hh>
// For fwd_piter and bkd_piter virtual types.
// FIXME: Really necessary?
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
namespace oln
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 627)
+++ oln/core/2d/image2d.hh (working copy)
@@ -39,7 +39,7 @@
# include <oln/core/2d/aliases.hh>
// For fwd_piter and bkd_piter virtual types.
// FIXME: Really necessary?
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
namespace oln
Index: oln/core/3d/image3d.hh
--- oln/core/3d/image3d.hh (revision 627)
+++ oln/core/3d/image3d.hh (working copy)
@@ -39,7 +39,7 @@
# include <oln/core/3d/aliases.hh>
// For fwd_piter and bkd_piter virtual types.
// FIXME: Really necessary?
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
namespace oln
Index: oln/core/internal/bbox_bkd_piter.hh
--- oln/core/internal/bbox_bkd_piter.hh (revision 627)
+++ oln/core/internal/bbox_bkd_piter.hh (working copy)
@@ -32,7 +32,7 @@
# include <oln/core/abstract/iterator_on_points.hh>
# include <oln/core/abstract/point.hh>
# include <oln/core/gen/bbox.hh>
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
namespace oln
Index: oln/core/internal/bbox_fwd_piter.hh
--- oln/core/internal/bbox_fwd_piter.hh (revision 627)
+++ oln/core/internal/bbox_fwd_piter.hh (working copy)
@@ -32,7 +32,7 @@
# include <oln/core/abstract/iterator_on_points.hh>
# include <oln/core/abstract/point.hh>
# include <oln/core/gen/bbox.hh>
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
namespace oln
Index: oln/basics2d.hh
--- oln/basics2d.hh (revision 627)
+++ oln/basics2d.hh (working copy)
@@ -52,7 +52,7 @@
# include <oln/core/2d/image2d.hh>
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
# include <oln/core/spe/row.hh>
# include <oln/core/spe/col.hh>
Index: oln/basics3d.hh
--- oln/basics3d.hh (revision 627)
+++ oln/basics3d.hh (working copy)
@@ -49,7 +49,7 @@
# include <oln/core/3d/image3d.hh>
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
# include <oln/core/spe/slice.hh>
# include <oln/core/spe/row.hh>
Index: oln/morpher/add_neighborhood.hh
--- oln/morpher/add_neighborhood.hh (revision 627)
+++ oln/morpher/add_neighborhood.hh (working copy)
@@ -30,7 +30,7 @@
# include <oln/morpher/internal/image_extension.hh>
# include <oln/core/gen/topo_add_nbh.hh>
-# include <oln/core/fwd_piter.hh>
+# include <oln/core/iterator_vtypes.hh>
# include <oln/core/gen/fwd_niter_neighb.hh>
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Reorganize and fix oln/core/3d/.
* oln/core/3d/aliases.hh (oln::fwd_piter3d, oln::bkd_piter3d): Fix
their definitions.
* oln/core/3d/neighb3d.hh (c6, c18, c26)
(c4_slice, c8_slice, c4_row, c8_row, c4_col, c8_col): Rename as...
(mk_c6, mk_c18, mk_c26, mk_c4_slice, mk_c8_slice)
(mk_c4_row, mk_c8_row, mk_c4_col, mk_c8_col): ...these.
(c6, c18, c26, c4_slice, c8_slice, c4_row, c8_row)
(c4_col, c8_col): New objects.
* oln/core/3d/array3d.hh, oln/core/3d/dpoint3d.hh,
* oln/core/3d/image3d.hh, oln/core/3d/neighb3d.hh,
* oln/core/3d/point3d.hh: Separate the interface of the methods
and functions from their implementation.
* oln/core/3d/image3d.hh (oln::vtypes< image3d<T> >): Set
topo_type to topo3d.
(bbox_<point3d>): Move explicit instantiation...
* oln/basics3d.hh: ...here
(oln/core/fwd_piter.hh): Include it.
* oln/core/3d/image3d.hh: Move the definition of the virtual types
fwd_piter and bkd_piter of oln::image3d...
* oln/core/fwd_piter.hh: ...here.
* oln/core/abstract/image/hybrid/classical.hh
(oln::abstract:classical_3d_image): New.
(oln::case_<image_hybrid_hierarchy_wrt_classical, E, 3>): Rename
as...
(oln::case_<image_hybrid_hierarchy_wrt_classical, E, 4>): ...this.
(oln::case_<image_hybrid_hierarchy_wrt_classical, E, 3>): New.
Handle 3D case.
basics3d.hh | 4 -
core/3d/aliases.hh | 4 -
core/3d/array3d.hh | 81 ++++++++++++++++++++++----------
core/3d/dpoint3d.hh | 57 ++++++++++++++++------
core/3d/image3d.hh | 66 ++++++++++++++++++++------
core/3d/neighb3d.hh | 65 +++++++++++++++++++++----
core/3d/point3d.hh | 58 ++++++++++++++++------
core/abstract/image/hybrid/classical.hh | 31 +++++++++++-
core/abstract/point.hh | 1
core/fwd_piter.hh | 15 +++++
10 files changed, 297 insertions(+), 85 deletions(-)
Index: oln/core/fwd_piter.hh
--- oln/core/fwd_piter.hh (revision 626)
+++ oln/core/fwd_piter.hh (working copy)
@@ -144,10 +144,21 @@
typedef bkd_piter2d ret;
};
+
+ // image3d<T>
+
+ template <typename T> class image3d;
+
+ template <typename T>
+ struct single_vtype< image3d<T>, typedef_::fwd_piter_type >
+ {
+ typedef fwd_piter3d ret;
+ };
+
template <typename T>
- struct single_vtype< image2d<T>, typedef_::fwd_qiter_type >
+ struct single_vtype< image3d<T>, typedef_::bkd_piter_type >
{
- typedef fwd_qiter2d ret;
+ typedef bkd_piter3d ret;
};
Index: oln/core/abstract/image/hybrid/classical.hh
--- oln/core/abstract/image/hybrid/classical.hh (revision 626)
+++ oln/core/abstract/image/hybrid/classical.hh (working copy)
@@ -33,6 +33,7 @@
# include <oln/core/abstract/image/dimension/1d.hh>
# include <oln/core/abstract/image/dimension/2d.hh>
+# include <oln/core/abstract/image/dimension/3d.hh>
# include <oln/core/abstract/image/bbox/hierarchy.hh>
# include <oln/core/abstract/image/accessibility/hierarchy.hh>
@@ -70,6 +71,15 @@
classical_2d_image();
};
+ template <typename E>
+ struct classical_3d_image
+ : public virtual abstract::classical_image<E>,
+ public virtual abstract::image3d<E>
+ {
+ protected:
+ classical_3d_image();
+ };
+
# ifndef OLN_INCLUDE_ONLY
@@ -88,6 +98,11 @@
{
}
+ template <typename E>
+ classical_3d_image<E>::classical_3d_image()
+ {
+ }
+
# endif
} // end of namespace oln::abstract
@@ -96,6 +111,7 @@
// Fwd. decl.
class grid1d;
class grid2d;
+ class grid3d;
/// 1D case.
@@ -124,9 +140,22 @@
};
- /// General case.
+ /// 3D case.
template <typename E>
struct case_< image_hybrid_hierarchy_wrt_classical, E, 3 > :
+ where_< mlc::and_list_< mlc::eq_< oln_type_of(E, grid), oln::grid3d >,
+ mlc::eq_< oln_deduce_type_of(E, topo, is_random_accessible), mlc::true_ >,
+ mlc::neq_< oln_deduce_type_of(E, topo, bbox), mlc::not_found >
+ >
+ >
+ {
+ typedef abstract::classical_3d_image<E> ret;
+ };
+
+
+ /// General case.
+ template <typename E>
+ struct case_< image_hybrid_hierarchy_wrt_classical, E, 4 > :
where_< mlc::and_< mlc::eq_< oln_deduce_type_of(E, topo, is_random_accessible), mlc::true_ >,
mlc::neq_< oln_deduce_type_of(E, topo, bbox), mlc::not_found >
>
Index: oln/core/abstract/point.hh
--- oln/core/abstract/point.hh (revision 626)
+++ oln/core/abstract/point.hh (working copy)
@@ -33,6 +33,7 @@
# include <oln/core/traits_id.hh>
# include <oln/core/abstract/dpoint.hh>
+# include <xtd/vec.hh>
Index: oln/core/3d/aliases.hh
--- oln/core/3d/aliases.hh (revision 626)
+++ oln/core/3d/aliases.hh (working copy)
@@ -55,8 +55,8 @@
typedef bbox_<point3d> bbox3d;
typedef topo_lbbox_<point3d> topo3d;
- typedef fwd_piter_bbox_<topo3d> fwd_piter3d;
- typedef bkd_piter_bbox_<topo3d> bkd_piter3d;
+ typedef fwd_piter_bbox_<point3d> fwd_piter3d;
+ typedef bkd_piter_bbox_<point3d> bkd_piter3d;
typedef point3d_<float> point3df;
typedef dpoint3d_<float> dpoint3df;
Index: oln/core/3d/neighb3d.hh
--- oln/core/3d/neighb3d.hh (revision 626)
+++ oln/core/3d/neighb3d.hh (working copy)
@@ -36,8 +36,23 @@
namespace oln
{
+ namespace internal
+ {
+
+ neighb3d mk_c6();
+ neighb3d mk_c18();
+ neighb3d mk_c26();
+ neighb3d mk_c4_slice();
+ neighb3d mk_c8_slice();
+ neighb3d mk_c4_row();
+ neighb3d mk_c8_row();
+ neighb3d mk_c4_col();
+ neighb3d mk_c8_col();
+
+
+# ifndef OLN_INCLUDE_ONLY
- neighb3d c6()
+ neighb3d mk_c6()
{
static bool flower = true;
static neighb3d the_;
@@ -53,7 +68,7 @@
}
- neighb3d c18()
+ neighb3d mk_c18()
{
static bool flower = true;
static neighb3d the_;
@@ -75,7 +90,7 @@
}
- neighb3d c26()
+ neighb3d mk_c26()
{
static bool flower = true;
static neighb3d the_;
@@ -101,7 +116,7 @@
}
- neighb3d c4_slice()
+ neighb3d mk_c4_slice()
{
static bool flower = true;
static neighb3d the_;
@@ -116,7 +131,7 @@
}
- neighb3d c8_slice()
+ neighb3d mk_c8_slice()
{
static bool flower = true;
static neighb3d the_;
@@ -133,7 +148,7 @@
}
- neighb3d c4_row()
+ neighb3d mk_c4_row()
{
static bool flower = true;
static neighb3d the_;
@@ -148,7 +163,7 @@
}
- neighb3d c8_row()
+ neighb3d mk_c8_row()
{
static bool flower = true;
static neighb3d the_;
@@ -165,7 +180,7 @@
}
- neighb3d c4_col()
+ neighb3d mk_c4_col()
{
static bool flower = true;
static neighb3d the_;
@@ -180,7 +195,7 @@
}
- neighb3d c8_col()
+ neighb3d mk_c8_col()
{
static bool flower = true;
static neighb3d the_;
@@ -196,9 +211,39 @@
return the_;
}
+# endif
-} // end of namespace oln
+ } // end of namespace oln::internal
+
+
+ extern const neighb3d c6;
+ extern const neighb3d c18;
+ extern const neighb3d c26;
+ extern const neighb3d c4_slice;
+ extern const neighb3d c8_slice;
+ extern const neighb3d c4_row;
+ extern const neighb3d c8_row;
+ extern const neighb3d c4_col;
+ extern const neighb3d c8_col;
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ const neighb3d c6 = internal::mk_c6();
+ const neighb3d c18 = internal::mk_c18();
+ const neighb3d c26 = internal::mk_c26();
+
+ const neighb3d c4_slice = internal::mk_c4_slice();
+ const neighb3d c8_slice = internal::mk_c8_slice();
+ const neighb3d c4_row = internal::mk_c4_row();
+ const neighb3d c8_row = internal::mk_c8_row();
+ const neighb3d c4_col = internal::mk_c4_col();
+ const neighb3d c8_col = internal::mk_c8_col();
+
+# endif
+
+} // end of namespace oln
#endif // ! OLN_CORE_3D_NEIGHB3D_HH
Index: oln/core/3d/dpoint3d.hh
--- oln/core/3d/dpoint3d.hh (revision 626)
+++ oln/core/3d/dpoint3d.hh (working copy)
@@ -70,38 +70,67 @@
{
typedef dpoint3d_<C> self_t;
typedef stc_get_super(dpoint3d_<C>) super_t;
- typedef oln_type_of(self_t, coord) coord_t;
using super_t::v_;
public:
/// Ctor.
- dpoint3d_()
+ dpoint3d_();
+
+ /// Ctor.
+ dpoint3d_(const xtd::vec<3,C>& v);
+
+ /// Ctor.
+ dpoint3d_(C slice, C row, C col);
+
+ C slice() const;
+ C& slice();
+
+ C row() const;
+ C& row();
+
+ C col() const;
+ C& col();
+ };
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename C>
+ dpoint3d_<C>::dpoint3d_()
{
}
- /// Ctor.
- dpoint3d_(const xtd::vec<3,coord_t>& v)
+ template <typename C>
+ dpoint3d_<C>::dpoint3d_(const xtd::vec<3,C>& v)
: super_t(v)
{
}
- /// Ctor.
- dpoint3d_(coord_t slice, coord_t row, coord_t col)
+ template <typename C>
+ dpoint3d_<C>::dpoint3d_(C slice, C row, C col)
: super_t(xtd::mk_vec(slice, row, col))
{
}
- coord_t slice() const { return v_[0]; }
- coord_t& slice() { return v_[0]; }
+ template <typename C>
+ C dpoint3d_<C>::slice() const { return v_[0]; }
+ template <typename C>
+ C& dpoint3d_<C>::slice() { return v_[0]; }
+
+ template <typename C>
+ C dpoint3d_<C>::row() const { return v_[1]; }
+ template <typename C>
+ C& dpoint3d_<C>::row() { return v_[1]; }
+
+ template <typename C>
+ C dpoint3d_<C>::col() const { return v_[2]; }
+ template <typename C>
+ C& dpoint3d_<C>::col() { return v_[2]; }
- coord_t row() const { return v_[1]; }
- coord_t& row() { return v_[1]; }
-
- coord_t col() const { return v_[2]; }
- coord_t& col() { return v_[2]; }
- };
+# endif
} // end of namespace oln
Index: oln/core/3d/array3d.hh
--- oln/core/3d/array3d.hh (revision 626)
+++ oln/core/3d/array3d.hh (working copy)
@@ -44,8 +44,42 @@
/// Ctor.
array3d(coord_t imin, coord_t jmin, coord_t kmin,
- coord_t imax, coord_t jmax, coord_t kmax) :
- imin_(imin), jmin_(jmin), kmin_(kmin),
+ coord_t imax, coord_t jmax, coord_t kmax);
+ /// Ctor.
+ array3d(coord_t ilen, coord_t jlen, coord_t klen);
+
+ /// Dtor.
+ ~array3d();
+
+ value_t operator()(coord_t i, coord_t j, coord_t k) const;
+ value_t& operator()(coord_t i, coord_t j, coord_t k);
+
+ bool has(coord_t i, coord_t j, coord_t k) const;
+
+ size_t memsize() const;
+
+ protected:
+
+ coord_t imin_, jmin_, kmin_, imax_, jmax_, kmax_;
+ coord_t ilen_, jlen_, klen_;
+ value_t* buffer_;
+ value_t** array_2nd_dim_;
+ value_t*** array_1st_dim_;
+
+ private:
+
+ void allocate_();
+ void deallocate_();
+ };
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename value_t, typename coord_t>
+ array3d<value_t, coord_t>::array3d(coord_t imin, coord_t jmin, coord_t kmin,
+ coord_t imax, coord_t jmax, coord_t kmax)
+ : imin_(imin), jmin_(jmin), kmin_(kmin),
imax_(imax), jmax_(jmax), kmax_(kmax)
{
precondition(imax >= imin and jmax >= jmin and kmax >= kmin);
@@ -55,9 +89,9 @@
allocate_();
}
- /// Ctor.
- array3d(coord_t ilen, coord_t jlen, coord_t klen) :
- imin_(0), jmin_(0), kmin_(0),
+ template <typename value_t, typename coord_t>
+ array3d<value_t, coord_t>::array3d(coord_t ilen, coord_t jlen, coord_t klen)
+ : imin_(0), jmin_(0), kmin_(0),
ilen_(ilen), jlen_(jlen), klen_(klen)
{
precondition(ilen > 0 and jlen > 0 and klen > 0);
@@ -67,25 +101,30 @@
allocate_();
}
- /// Dtor.
- ~array3d()
+ template <typename value_t, typename coord_t>
+ array3d<value_t, coord_t>::~array3d()
{
deallocate_();
}
- value_t operator()(coord_t i, coord_t j, coord_t k) const
+ template <typename value_t, typename coord_t>
+ value_t
+ array3d<value_t, coord_t>::operator()(coord_t i, coord_t j, coord_t k) const
{
precondition(has(i, j, k));
return array_1st_dim_[i][j][k];
}
- value_t& operator()(coord_t i, coord_t j, coord_t k)
+ template <typename value_t, typename coord_t>
+ value_t&
+ array3d<value_t, coord_t>::operator()(coord_t i, coord_t j, coord_t k)
{
precondition(has(i, j, k));
return array_1st_dim_[i][j][k];
}
- bool has(coord_t i, coord_t j, coord_t k) const
+ template <typename value_t, typename coord_t>
+ bool array3d<value_t, coord_t>::has(coord_t i, coord_t j, coord_t k) const
{
return
i >= imin_ and i <= imax_ and
@@ -93,7 +132,8 @@
k >= kmin_ and k <= kmax_;
}
- size_t memsize() const
+ template <typename value_t, typename coord_t>
+ size_t array3d<value_t, coord_t>::memsize() const
{
return
// buffer_
@@ -106,17 +146,8 @@
size_t(ilen_) * sizeof(value_t*);
}
- protected:
-
- coord_t imin_, jmin_, kmin_, imax_, jmax_, kmax_;
- coord_t ilen_, jlen_, klen_;
- value_t* buffer_;
- value_t** array_2nd_dim_;
- value_t*** array_1st_dim_;
-
- private:
-
- void allocate_()
+ template <typename value_t, typename coord_t>
+ void array3d<value_t, coord_t>::allocate_()
{
buffer_ = new value_t[size_t(ilen_) * size_t(jlen_) * size_t(klen_)];
array_2nd_dim_ = new value_t*[size_t(ilen_) * size_t(jlen_)];
@@ -135,7 +166,8 @@
array_1st_dim_ -= imin_;
}
- void deallocate_()
+ template <typename value_t, typename coord_t>
+ void array3d<value_t, coord_t>::deallocate_()
{
precondition(buffer_ != 0 and
array_2nd_dim_ != 0 and
@@ -148,7 +180,8 @@
delete[] array_1st_dim_;
array_1st_dim_ = 0; // safety
}
- };
+
+# endif
} // end of namespace oln
Index: oln/core/3d/image3d.hh
--- oln/core/3d/image3d.hh (revision 626)
+++ oln/core/3d/image3d.hh (working copy)
@@ -53,15 +53,11 @@
template <typename T>
struct vtypes< image3d<T> >
{
- // FIXME: or `typedef topo3d topo_type;' ?
- typedef topo_lbbox_<point3d> topo_type;
+ typedef topo3d topo_type;
typedef grid3d grid_type;
typedef point3d point_type;
- typedef fwd_piter_bbox_<topo_type> fwd_piter_type;
- typedef bkd_piter_bbox_<topo_type> bkd_piter_type;
-
typedef T value_type;
typedef T lvalue_type;
typedef mlc::true_ is_mutable_type;
@@ -90,7 +86,32 @@
/// Ctor using sizes.
image3d(unsigned nslices, unsigned nrows, unsigned ncols,
- unsigned border = 2)
+ unsigned border = 2);
+
+ /// Ctor using an existing topology.
+ image3d(const topo3d& topo);
+
+ const topo3d& impl_topo() const;
+
+ T impl_op_read(const point3d& p) const;
+ T& impl_op_readwrite(const point3d& p);
+
+ T* adr_at(int slice, int row, int col);
+ const T* adr_at(int slice, int row, int col) const;
+
+ private:
+
+ topo3d topo_;
+ internal::tracked_ptr<array_t> data_;
+ };
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename T>
+ image3d<T>::image3d(unsigned nslices, unsigned nrows, unsigned ncols,
+ unsigned border)
: topo_(bbox3d(point3d(0, 0, 0 ),
point3d(nslices - 1, nrows - 1, ncols - 1)),
border),
@@ -103,8 +124,8 @@
{
}
- /// Ctor using an existing topology.
- image3d(const topo3d& topo)
+ template <typename T>
+ image3d<T>::image3d(const topo3d& topo)
: topo_(topo),
data_(new array_t(topo.bbox().pmin().slice(),
topo.bbox().pmin().row(),
@@ -115,30 +136,45 @@
{
}
- const topo3d& impl_topo() const
+ template <typename T>
+ const topo3d& image3d<T>::impl_topo() const
{
return topo_;
}
- T impl_op_read(const point3d& p) const
+ template <typename T>
+ T image3d<T>::impl_op_read(const point3d& p) const
{
precondition(data_ != 0);
precondition(topo_.has_large(p));
return data_->operator()(p.slice(), p.row(), p.col());
}
- T& impl_op_readwrite(const point3d& p)
+ template <typename T>
+ T& image3d<T>::impl_op_readwrite(const point3d& p)
{
precondition(data_ != 0);
precondition(topo_.has_large(p));
return data_->operator()(p.slice(), p.row(), p.col());
}
- private:
+ template <typename T>
+ T* image3d<T>::adr_at(int slice, int row, int col)
+ {
+ precondition(data_ != 0);
+ precondition(data_->has(slice, row, col));
+ return &(data_->operator()(slice, row, col));
+ }
- topo3d topo_;
- internal::tracked_ptr<array_t> data_;
- };
+ template <typename T>
+ const T* image3d<T>::adr_at(int slice, int row, int col) const
+ {
+ precondition(data_ != 0);
+ precondition(data_->has(slice, row, col));
+ return &(data_->operator()(slice, row, col));
+ }
+
+# endif
} // end of namespace oln
Index: oln/core/3d/point3d.hh
--- oln/core/3d/point3d.hh (revision 626)
+++ oln/core/3d/point3d.hh (working copy)
@@ -78,39 +78,67 @@
{
typedef point3d_<C> self_t;
typedef stc_get_super(point3d_<C>) super_t;
- typedef oln_type_of(self_t, coord) coord_t;
using super_t::v_;
public:
/// Ctor.
- point3d_()
+ point3d_();
+
+ /// Ctor.
+ point3d_(C slice, C row, C col);
+
+ /// Ctor.
+ point3d_(const xtd::vec<3,C>& v);
+
+ C slice() const;
+ C& slice();
+
+ C row() const;
+ C& row();
+
+ C col() const;
+ C& col();
+ };
+
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename C>
+ point3d_<C>::point3d_()
{
}
- /// Ctor.
- point3d_(coord_t slice, coord_t row, coord_t col)
+ template <typename C>
+ point3d_<C>::point3d_(C slice, C row, C col)
: super_t (xtd::mk_vec(slice, row, col))
{
}
- /// Ctor.
- point3d_(const xtd::vec<3,coord_t>& v)
+ template <typename C>
+ point3d_<C>::point3d_(const xtd::vec<3,C>& v)
: super_t(v)
{
}
- coord_t slice() const { return v_[0]; }
- coord_t& slice() { return v_[0]; }
-
- coord_t row() const { return v_[1]; }
- coord_t& row() { return v_[1]; }
-
- coord_t col() const { return v_[2]; }
- coord_t& col() { return v_[2]; }
- };
+ template <typename C>
+ C point3d_<C>::slice() const { return v_[0]; }
+ template <typename C>
+ C& point3d_<C>::slice() { return v_[0]; }
+
+ template <typename C>
+ C point3d_<C>::row() const { return v_[1]; }
+ template <typename C>
+ C& point3d_<C>::row() { return v_[1]; }
+
+ template <typename C>
+ C point3d_<C>::col() const { return v_[2]; }
+ template <typename C>
+ C& point3d_<C>::col() { return v_[2]; }
+# endif
} // end of namespace oln
Index: oln/basics3d.hh
--- oln/basics3d.hh (revision 626)
+++ oln/basics3d.hh (working copy)
@@ -35,7 +35,6 @@
# include <oln/core/3d/grid3d.hh>
# include <oln/core/3d/point3d.hh>
-
# include <oln/core/3d/dpoint3d.hh>
# include <oln/core/gen/bbox.hh>
@@ -43,7 +42,6 @@
# include <oln/core/3d/bbox3d.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
-
# include <oln/core/gen/bkd_piter_bbox.hh>
# include <oln/core/gen/neighb.hh>
@@ -51,6 +49,8 @@
# include <oln/core/3d/image3d.hh>
+# include <oln/core/fwd_piter.hh>
+
# include <oln/core/spe/slice.hh>
# include <oln/core/spe/row.hh>
# include <oln/core/spe/col.hh>
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix explicit instantiations of oln::bbox_.
* oln/basics1d.hh (bbox_<point1d>): Move explicit
instantiation...
* oln/core/1d/bbox1d.hh: ...here (new file).
* oln/core/1d/image1d.hh: Include it.
* oln/basics2d.hh (bbox_<point2d>): Move explicit
instantiation...
* oln/core/2d/bbox2d.hh: ...here (new file).
* oln/core/2d/image2d.hh: Include it.
* oln/core/3d/bbox3d.hh: New file.
* oln/basics3d.hh, oln/core/3d/image3d.hh: Include it.
* oln/Makefile.am (nobase_oln_HEADERS): Add core/1d/bbox1d.hh,
core/2d/bbox2d.hh and core/3d/bbox3d.hh.
* oln/core/2d/array2d.hh: Aesthetic changes.
Makefile.am | 3 +++
basics1d.hh | 7 +------
basics2d.hh | 7 +------
basics3d.hh | 2 +-
core/1d/bbox1d.hh | 45 +++++++++++++++++++++++++++++++++++++++++++++
core/1d/image1d.hh | 5 +++--
core/2d/bbox2d.hh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
core/2d/image2d.hh | 5 +++--
core/3d/bbox3d.hh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
core/3d/image3d.hh | 13 ++++++-------
10 files changed, 155 insertions(+), 24 deletions(-)
Index: oln/basics1d.hh
--- oln/basics1d.hh (revision 625)
+++ oln/basics1d.hh (working copy)
@@ -38,13 +38,8 @@
# include <oln/core/1d/dpoint1d.hh>
# include <oln/core/gen/bbox.hh>
-// FIXME: Inexplicably, this explicit instantiation is required to
-// have topo_lbbox_<point1d> work. See if we can get rid of it.
-namespace oln {
- template class bbox_<point1d>;
-}
-
# include <oln/core/gen/topo_lbbox.hh>
+# include <oln/core/1d/bbox1d.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
# include <oln/core/gen/bkd_piter_bbox.hh>
Index: oln/core/1d/bbox1d.hh
--- oln/core/1d/bbox1d.hh (revision 0)
+++ oln/core/1d/bbox1d.hh (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (C) 2006 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 OLN_CORE_1D_BBOX1D_HH
+# define OLN_CORE_1D_BBOX1D_HH
+
+# include <oln/core/1d/aliases.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/gen/bbox.hh>
+
+namespace oln
+{
+
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point1d> work. See if we can get rid of it.
+ template class bbox_<point1d>;
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_1D_BBOX1D_HH
Index: oln/core/1d/image1d.hh
--- oln/core/1d/image1d.hh (revision 625)
+++ oln/core/1d/image1d.hh (working copy)
@@ -30,10 +30,11 @@
# define OLN_CORE_1D_IMAGE1D_HH
# include <oln/core/image_entry.hh>
-# include <oln/core/1d/array1d.hh>
-# include <oln/core/1d/point1d.hh>
# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+# include <oln/core/1d/array1d.hh>
+# include <oln/core/1d/point1d.hh>
+# include <oln/core/1d/bbox1d.hh>
// For topo1d.
# include <oln/core/1d/aliases.hh>
// For fwd_piter and bkd_piter virtual types.
Index: oln/basics2d.hh
--- oln/basics2d.hh (revision 625)
+++ oln/basics2d.hh (working copy)
@@ -38,13 +38,8 @@
# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/gen/bbox.hh>
-// FIXME: Inexplicably, this explicit instantiation is required to
-// have topo_lbbox_<point2d> work. See if we can get rid of it.
-namespace oln {
- template class bbox_<point2d>;
-}
-
# include <oln/core/gen/topo_lbbox.hh>
+# include <oln/core/2d/bbox2d.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
# include <oln/core/gen/bkd_piter_bbox.hh>
Index: oln/core/2d/bbox2d.hh
--- oln/core/2d/bbox2d.hh (revision 0)
+++ oln/core/2d/bbox2d.hh (revision 0)
@@ -0,0 +1,46 @@
+// Copyright (C) 2006 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 OLN_CORE_2D_BBOX2D_HH
+# define OLN_CORE_2D_BBOX2D_HH
+
+# include <oln/core/2d/aliases.hh>
+# include <oln/core/2d/point2d.hh>
+# include <oln/core/gen/bbox.hh>
+
+namespace oln
+{
+
+ typedef bbox_<point2d> bbox2d;
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point2d> work. See if we can get rid of it.
+ template class bbox_<point2d>;
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_2D_BBOX2D_HH
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 625)
+++ oln/core/2d/image2d.hh (working copy)
@@ -30,10 +30,11 @@
# define OLN_CORE_2D_IMAGE2D_HH
# include <oln/core/image_entry.hh>
-# include <oln/core/2d/array2d.hh>
-# include <oln/core/2d/point2d.hh>
# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+# include <oln/core/2d/array2d.hh>
+# include <oln/core/2d/point2d.hh>
+# include <oln/core/2d/bbox2d.hh>
// For topo2d.
# include <oln/core/2d/aliases.hh>
// For fwd_piter and bkd_piter virtual types.
Index: oln/core/3d/bbox3d.hh
--- oln/core/3d/bbox3d.hh (revision 0)
+++ oln/core/3d/bbox3d.hh (revision 0)
@@ -0,0 +1,46 @@
+// Copyright (C) 2006 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 OLN_CORE_3D_BBOX3D_HH
+# define OLN_CORE_3D_BBOX3D_HH
+
+# include <oln/core/3d/aliases.hh>
+# include <oln/core/3d/point3d.hh>
+# include <oln/core/gen/bbox.hh>
+
+namespace oln
+{
+
+ typedef bbox_<point3d> bbox3d;
+ // FIXME: Inexplicably, this explicit instantiation is required to
+ // have topo_lbbox_<point3d> work. See if we can get rid of it.
+ template class bbox_<point3d>;
+
+} // end of namespace oln
+
+
+#endif // ! OLN_CORE_3D_BBOX3D_HH
Index: oln/basics3d.hh
--- oln/basics3d.hh (revision 625)
+++ oln/basics3d.hh (working copy)
@@ -39,8 +39,8 @@
# include <oln/core/3d/dpoint3d.hh>
# include <oln/core/gen/bbox.hh>
-
# include <oln/core/gen/topo_lbbox.hh>
+# include <oln/core/3d/bbox3d.hh>
# include <oln/core/gen/fwd_piter_bbox.hh>
Index: oln/core/3d/image3d.hh
--- oln/core/3d/image3d.hh (revision 625)
+++ oln/core/3d/image3d.hh (working copy)
@@ -30,22 +30,21 @@
# define OLN_CORE_3D_IMAGE3D_HH
# include <oln/core/image_entry.hh>
-# include <oln/core/3d/array3d.hh>
-# include <oln/core/3d/point3d.hh>
# include <oln/core/gen/topo_lbbox.hh>
# include <oln/core/internal/tracked_ptr.hh>
+# include <oln/core/3d/array3d.hh>
+# include <oln/core/3d/point3d.hh>
+# include <oln/core/3d/bbox3d.hh>
// For topo3d.
# include <oln/core/3d/aliases.hh>
+// For fwd_piter and bkd_piter virtual types.
+// FIXME: Really necessary?
+# include <oln/core/fwd_piter.hh>
namespace oln
{
- // FIXME: Inexplicably, this explicit instantiation is required to
- // have topo_lbbox_<point3d> work. See if we can get rid of it.
- template class bbox_<point3d>;
-
-
// Forward declaration.
template <typename T> class image3d;
Index: oln/Makefile.am
--- oln/Makefile.am (revision 625)
+++ oln/Makefile.am (working copy)
@@ -7,6 +7,7 @@
\
core/1d/aliases.hh \
core/1d/array1d.hh \
+ core/1d/bbox1d.hh \
core/1d/dpoint1d.hh \
core/1d/grid1d.hh \
core/1d/image1d.hh \
@@ -15,6 +16,7 @@
\
core/2d/aliases.hh \
core/2d/array2d.hh \
+ core/2d/bbox2d.hh \
core/2d/dpoint2d.hh \
core/2d/grid2d.hh \
core/2d/image2d.hh \
@@ -23,6 +25,7 @@
\
core/3d/aliases.hh \
core/3d/array3d.hh \
+ core/3d/bbox3d.hh \
core/3d/dpoint3d.hh \
core/3d/grid3d.hh \
core/3d/image3d.hh \
Index: oln/core/2d/array2d.hh
1
0
Index: ChangeLog
===================================================================
--- ChangeLog (révision 624)
+++ ChangeLog (révision 625)
@@ -31,7 +31,7 @@
of oln::image1d...
* oln/core/fwd_piter.hh: ...here.
* oln/core/abstract/image/hybrid/classical.hh
- (oln::abstract:classical_1d_image)
+ (oln::abstract:classical_1d_image): New.
(oln::case_<image_hybrid_hierarchy_wrt_classical, E, 1>)
(oln::case_<image_hybrid_hierarchy_wrt_classical, E, 2>): Rename
as...
@@ -65,7 +65,7 @@
2006-10-11 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add new facilities to access to components such as row, col, etc.
-
+
* oln/core/spe/row.hh: New.
* oln/core/spe/col.hh: New.
* oln/core/spe/slice.hh: New.
@@ -95,7 +95,7 @@
2006-10-11 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
New facilities related to windows and q-iterators.
-
+
* tests/window2d.cc: New.
* tests/Makefile.am (window2d_SOURCES): New.
* oln/debug/print.hh (format): New.
@@ -115,11 +115,11 @@
(include): Update.
* oln/basics2d.hh (include): Add window.hh and fwd_qiter_win.hh.
* oln/Makefile.am (nobase_oln_HEADERS): Update.
-
+
2006-10-11 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add some tools related to morphers over image value.
-
+
* oln/core/abstract/value.hh: New.
* oln/morpher/thru_fun.hh: New.
* oln/morpher/internal/image_value_morpher.hh: New.
@@ -230,7 +230,7 @@
2006-10-10 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add i/o read for pbm and pgm formats.
-
+
* tests/io_pnm.cc: New.
* tests/Makefile.am (check_PROGRAMS): Update.
* oln/io: New directory.
@@ -262,7 +262,7 @@
2006-10-09 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Change stc_virtual_typedef into oln_virtual_typedef.
-
+
* oln/core/macros.hh (oln_virtual_typedef): New macro.
It replaces stc_virtual_typedef.
* oln/core/abstract/image.hh: Update.
@@ -362,7 +362,7 @@
Decouple iterators from image topology; update neighborhood tools
and start to add window tools.
-
+
* oln/core/automatic/topology_having_subset.hh: New.
* oln/core/abstract/topology_having_subset.hh: New.
* oln/core/gen/fwd_niter_neighb.hh: New.
@@ -525,7 +525,7 @@
2006-10-02 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add isubset image morpher and subsequent tools.
-
+
* oln/core/gen/piter_isubset.hh: New.
* oln/core/gen/topo_add_isubset.hh: New.
* oln/morpher/add_isubset.hh: New.
@@ -534,7 +534,7 @@
* oln/core/automatic/image_being_random_accessible.hh
(set_impl): Remove; cause error-prone.
* oln/core/abstract/image/type/hierarchy.hh
- (where_): Rely on xtd_is_binary instead of an hard-coded test.
+ (where_): Rely on xtd_is_binary instead of an hard-coded test.
(include): Update.
* oln/core/gen/fwd_piter_bbox.hh (topo_type): new.
(topo_): Change ref into plain type so it is more secure.
@@ -626,18 +626,18 @@
2006-09-27 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add oln debug print and a "classical" image abstraction.
-
+
* oln/debug/print.hh: New.
* oln/core/abstract/image/hybrid/classical.hh: New.
* oln/core/abstract/image/hierarchies.hh
(image_hybrid_hierarchy_wrt_classical): New.
(include): Update.
* oln/Makefile.am (nobase_oln_HEADERS): Update.
-
+
2006-09-27 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Update grid classes and add static checks for image vtypes.
-
+
* oln/core/abstract/fwd_decls.hh: New.
* tests/image_entry.cc: Update.
* oln/core/abstract/image.hh (include): Add fwd_decls.
@@ -661,7 +661,7 @@
2006-09-27 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Adjust guards to directory names.
-
+
* oln/automatic/topology_having_bbox.hh: Adjust guard to directory
name.
* oln/automatic/image.hh: Likewise.
@@ -751,7 +751,7 @@
2006-09-27 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add array2d and tracked_ptr.
-
+
* oln/core/2d/array2d.hh: New.
This file also provides the tracked_ptr class which should be
moved later in a more appropriate file.
@@ -779,7 +779,7 @@
2006-09-26 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add mapimage type and update.
-
+
* oln/core/gen/mapimage.hh: New.
* oln/automatic/image_being_random_accessible.hh: New.
* oln/core/abstract/topology_having_bbox.hh
@@ -800,11 +800,11 @@
(pmin, pmax): New.
* oln/core/gen/topo_bbox.hh (impl_bbox): New.
* oln/Makefile.am (nobase_oln_HEADERS): Update.
-
+
2006-09-26 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add some abstract image sub-hierarchies.
-
+
* oln/automatic/image_being_mutable.hh: New.
* oln/core/abstract/image/mutability/hierarchy.hh: New.
* oln/core/abstract/image/accessibility/hierarchy.hh: New.
@@ -816,7 +816,7 @@
(image_hierarchy_wrt_bbox): New.
(image_hierarchy_wrt_accessibility): New.
(image_hierarchy_wrt_mutability): New.
- (include): Update.
+ (include): Update.
* oln/core/abstract/image/neighborhood/hierarchy.hh (decl): New.
(~image_having_neighborhood): New.
@@ -836,7 +836,7 @@
2006-09-26 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Dispatch image abstract classes into subdirs and files.
-
+
* oln/core/abstract/image/type: New directory.
* oln/core/abstract/image/dimension: New directory.
* oln/core/abstract/image/neighborhood: New directory.
1
0
12 Oct '06
https://svn.lrde.epita.fr/svn/oln/trunk/olena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Move explicit instantiation of bbox_<point2d> to basics2d.hh.
* oln/core/2d/image2d.hh (oln::vtypes< image2d<T> >): Set
topo_type to topo2d.
* oln/core/2d/image2d.hh (bbox_<point2d>): Move explicit
instantiation...
* oln/basics2d.hh: ...here
basics2d.hh | 5 +++++
core/2d/image2d.hh | 15 +++++----------
2 files changed, 10 insertions(+), 10 deletions(-)
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 623)
+++ oln/core/2d/image2d.hh (working copy)
@@ -36,16 +36,14 @@
# include <oln/core/internal/tracked_ptr.hh>
// For topo2d.
# include <oln/core/2d/aliases.hh>
+// For fwd_piter and bkd_piter virtual types.
+// FIXME: Really necessary?
+# include <oln/core/fwd_piter.hh>
namespace oln
{
- // FIXME: Inexplicably, this explicit instantiation is required to
- // have topo_lbbox_<point2d> work. See if we can get rid of it.
- template class bbox_<point2d>;
-
-
// Forward declaration.
template <typename T> class image2d;
@@ -54,8 +52,7 @@
template <typename T>
struct vtypes< image2d<T> >
{
- // FIXME: or `typedef topo2d topo_type;' ?
- typedef topo_lbbox_<point2d> topo_type;
+ typedef topo2d topo_type;
typedef grid2d grid_type;
typedef point2d point_type;
@@ -95,7 +92,6 @@
const topo2d& impl_topo() const;
T impl_op_read(const point2d& p) const;
-
T& impl_op_readwrite(const point2d& p);
T* adr_at(int row, int col);
@@ -109,7 +105,6 @@
-
# ifndef OLN_INCLUDE_ONLY
template <typename T>
@@ -122,7 +117,6 @@
{
}
- /// Ctor using an existing topology.
template <typename T>
image2d<T>::image2d(const topo2d& topo)
: topo_(topo),
@@ -173,6 +167,7 @@
# endif
+
} // end of namespace oln
Index: oln/basics2d.hh
--- oln/basics2d.hh (revision 623)
+++ oln/basics2d.hh (working copy)
@@ -38,6 +38,11 @@
# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/gen/bbox.hh>
+// FIXME: Inexplicably, this explicit instantiation is required to
+// have topo_lbbox_<point2d> work. See if we can get rid of it.
+namespace oln {
+ template class bbox_<point2d>;
+}
# include <oln/core/gen/topo_lbbox.hh>
1
0